gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Borrowck: Polonius FFI

Open jdupak opened this issue 2 years ago • 6 comments

FFI gccrs -> Polonius and build of Polonius (via FFI-Polonius bindigs) with gcc build system.

Cargo supports --outdir to copy final library to, which would be nice here, but right now it is unstable. :(

@CohenArthur

@tschwinge Is the clean alright? Should we somehow use autoconf to find cargo? Should/can we pass down the the information whether debug symbols are to be created to Rust?

jdupak avatar Oct 29 '23 17:10 jdupak

To solve:

  • [ ] explain cargo dependency in readme
  • [ ] resolve dependencies for GH actions
  • [ ] ??? Configure option to enable/disable borrowchecker

jdupak avatar Oct 29 '23 18:10 jdupak

I have added cargo install to GH actions.

jdupak avatar Oct 29 '23 19:10 jdupak

Should we somehow use autoconf to find cargo?

We should at least ensure it is available during configuration.

P-E-P avatar Oct 30 '23 08:10 P-E-P

Btw could anyone help me with the gcc4.8. It builds on my machine and I am not sure what is wrong there with pthreads linking (different then elsewhere)?

jdupak avatar Oct 30 '23 13:10 jdupak

gcc4.8 [...] what is wrong there with pthreads linking

Possibly in the old system, pthreads symbols are still in a separate library, before that was all moved into libc (in the glibc context -- may still be separate on other architectures), and thus -lpthread needs to be specified explicitly.

Generally there should be a way to query cargo for link flags that need to be specified when linking the Polonius library that it has built, which should return -lpthread for old glibc vs. empty string for new glibc, approximately.

tschwinge avatar Oct 31 '23 09:10 tschwinge

I don't see why not.

On Thu, 2 Nov 2023, at 23:06, Owen Avery wrote:

@.**** commented on this pull request.

In gcc/rust/Make-lang.in https://github.com/Rust-GCC/gccrs/pull/2716#discussion_r1380828907:

@@ -461,3 +464,9 @@ rust/%.o: rust/checks/errors/borrowck/%.cc rust/%.o: rust/metadata/%.cc $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< $(POSTCOMPILE)

+rust/libffi_polonius.a: \

  • rust/checks/errors/borrowck/ffi-polonius/Cargo.toml \
  • $(wildcard $(srcdir)/rust/checks/errors/borrowck/ffi-polonius/src/*)
  • cargo build --manifest-path $(srcdir)/rust/checks/errors/borrowck/ffi-polonius/Cargo.toml --release --target-dir rust/ffi-polonius

Could polonius be loaded as a shared library by the compiler? The actual implementation, as opposed to the bindings, could be kept out-of-tree for now.

— Reply to this email directly, view it on GitHub https://github.com/Rust-GCC/gccrs/pull/2716#discussion_r1380828907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNB76E4M7H4RQPWGILTUADYCQKNDAVCNFSM6AAAAAA6U67LSGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOMJRGMYTKMJTG4. You are receiving this because you authored the thread.Message ID: @.***>

jdupak avatar Nov 03 '23 08:11 jdupak

Replaced with #2889

jdupak avatar Mar 22 '24 19:03 jdupak