Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Compliation error when verifying programs that use dynamically linked libraries #111

Closed
alastairreid opened this issue Mar 16, 2021 · 2 comments

Comments

@alastairreid
Copy link
Contributor

While trying to verify some code in uutils/coreutils, I got the following error

Compiling uucore_procs v0.0.5 (/home/rust-verification-tools/expt/coreutils/src/uucore_procs)
error: cannot prefer dynamic linking when performing LTO
note: only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO
error: aborting due to previous error
error: could not compile uucore_procs
To learn more, run the command again with --verbose.

It's not obvious how we can use the current LTO trick with dynamically linked libraries so this may be tricky to overcome?

@alastairreid
Copy link
Contributor Author

The problem seems to be using RUSTFLAGS="... -Clto ..."
which attempts to use lto with everything built in the process of building the binary.

We might be able to fix this by using

cargo build -Zunstable-options --config 'lto="yes"'

which only applies lto to the final result.

@alastairreid
Copy link
Contributor Author

Closing this because it has not recurred since report

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant