-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo build fails due to -flto #2014
Comments
Thanks for the report! Could you provide the steps I need to reproduce this? I tried locally and was unable to by setting |
Are you saying other flags could have been at fault? I was guessing about lto due to the link errors, however I deliberately wrote about unsetting all flags as I also had (-O3 -march=athlon-xp -fipa-pta). Ditto for CXXFLAGS. The rustc I was using generates pentium2 code by default. |
Nope, my guess was right, this one flag is enough to trigger the failure. Cargo was configured with --disable-debug --enable-optimize and using local rust/cargo binaries. https://gist.github.com/petevine/e43745e50b5792521927 |
Hm it could be the case that Oddly enough for me on gcc 4.8.4 doing |
I'll try that - could you tell me if there's any static linking involved? Cause then ar, nm, ranlib have to be invoked as gcc-ar, etc. when doing lto (normally configurable via Makefiles). In that case your setup might simply be doing this automatically. EDIT: I was using ./configure followed by make and not cargo build (probably no difference) |
After adding |
Ah yeah if you're required to use |
Trying to build the latest cargo master fails at link time due to -flto being present in CFLAGS resulting in 'undefined reference' errors.
Unsetting the flags allows to finish the optimized build. Encountered on 32 bit Linux, i686 and gcc 4.9.2 - didn't check if using -ffat-lto-objects helps.
The text was updated successfully, but these errors were encountered: