Borrowck: Polonius FFI
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?
To solve:
- [ ] explain cargo dependency in readme
- [ ] resolve dependencies for GH actions
- [ ] ??? Configure option to enable/disable borrowchecker
I have added cargo install to GH actions.
Should we somehow use autoconf to find cargo?
We should at least ensure it is available during configuration.
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)?
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.
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: @.***>
Replaced with #2889