-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unoptimised builds of compiler_builtins on ARM have references to core::panicking::panic
#40508
Comments
As far as I can tell, |
I was with the impression that all builds of compiler_builtins were optimized? In this case it seems we have some dead code remnant of a panic call. I think its too hard to avoid all of them, and considering that we want to increase the amount of rust code code in the compiler_builtins implementation (see https://github.com/rust-lang-nursery/compiler-builtins), it will only get worse. So what about always enabling optimisations, at least for the std crates? |
AFAIK we can't disable debug assertions on a per-function basis, so we'd need to add an intrinsic perhaps here. |
I'll try the "fix with intrinsics" approach and see if that fixes the problem. |
I'm not sure IF this kind of panic freedom should be a goal (after all, who wants unoptimized builds?), but if it is a goal, this change should be backported to the upcoming replacement of this crate, the pure rust compiler builtins: https://github.com/rust-lang-nursery/compiler-builtins |
(with "this change" I mean #40521) |
Implemente overflowing_sh* with new unchecked_sh* intrinsics Also update some 128 bit builtins to not rely on the constant evaluator to avoid checked operations. Fixes rust-lang#40508. cc @nagisa, @alexcrichton Note: I still have a build running to see if the 128 bit changes worked (unoptimized builds take *forever* to compile), however at least the overflowing builtins no longer reference `core::panicking::panic`.
Implemente overflowing_sh* with new unchecked_sh* intrinsics Also update some 128 bit builtins to not rely on the constant evaluator to avoid checked operations. Fixes rust-lang#40508. cc @nagisa, @alexcrichton Note: I still have a build running to see if the 128 bit changes worked (unoptimized builds take *forever* to compile), however at least the overflowing builtins no longer reference `core::panicking::panic`.
Implemente overflowing_sh* with new unchecked_sh* intrinsics Also update some 128 bit builtins to not rely on the constant evaluator to avoid checked operations. Fixes rust-lang#40508. cc @nagisa, @alexcrichton Note: I still have a build running to see if the 128 bit changes worked (unoptimized builds take *forever* to compile), however at least the overflowing builtins no longer reference `core::panicking::panic`.
Implemente overflowing_sh* with new unchecked_sh* intrinsics Also update some 128 bit builtins to not rely on the constant evaluator to avoid checked operations. Fixes rust-lang#40508. cc @nagisa, @alexcrichton Note: I still have a build running to see if the 128 bit changes worked (unoptimized builds take *forever* to compile), however at least the overflowing builtins no longer reference `core::panicking::panic`.
Implemente overflowing_sh* with new unchecked_sh* intrinsics Also update some 128 bit builtins to not rely on the constant evaluator to avoid checked operations. Fixes rust-lang#40508. cc @nagisa, @alexcrichton Note: I still have a build running to see if the 128 bit changes worked (unoptimized builds take *forever* to compile), however at least the overflowing builtins no longer reference `core::panicking::panic`.
Implemente overflowing_sh* with new unchecked_sh* intrinsics Also update some 128 bit builtins to not rely on the constant evaluator to avoid checked operations. Fixes rust-lang#40508. cc @nagisa, @alexcrichton Note: I still have a build running to see if the 128 bit changes worked (unoptimized builds take *forever* to compile), however at least the overflowing builtins no longer reference `core::panicking::panic`.
Performing an ARM build with
--disable-optimize
causeslibcompiler_builtins.rlib
(for ARM) to have references tocore::panicking::panic
. Note that the IR does not contain calls to those functions, howeverreadelf
/nm
shows references to them.As far as I can tell, this then causes
libstd.so
to havecore::panicking::panic
as a non-public symbol, leading to build failures later on.This does not affect x86_64 linux as far as I can tell.
The IR and
readelf
output ofcompiler_builtins
(these were generated with LLVM 4.0, but the problem also occurs with LLVM 3.9).Edit: with LLVM 4.0, the following symbols have references to
core::panic::panicking
:Regarding a fix, see @nagisa's comment #40123 (comment):
cc @nagisa, @alexcrichton, #40123
The text was updated successfully, but these errors were encountered: