about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-12-07 16:28:45 +0100
committerest31 <MTest31@outlook.com>2016-12-30 15:17:28 +0100
commit92e6c53a2568417495db00fcfc9cb1677bbd105d (patch)
tree33dc6a5db8a75b6f792d3acd302296565e068f55 /src/test/incremental/thinlto
parent3e2046214ca7054bb438259c0287568976323040 (diff)
downloadrust-92e6c53a2568417495db00fcfc9cb1677bbd105d.tar.gz
rust-92e6c53a2568417495db00fcfc9cb1677bbd105d.zip
libcompiler_builtins: don't codegen dead code call to eh_personality
There was a linker error on 32 bit platforms with optimisations turned off,
complaining that there was an undefined reference to "rust_eh_personality",
when compiling the rustc_const_math as stage1 artifact.

Apparently the compiler_builtins crate includes a call to "rust_eh_personality".
If compiled for 64 bits, this call doesn't appear, which explains why the linker
error only happens on 32 bit platforms, and optimisations will get it removed
on 32 bit as well.

There were two origins of the call:
    1. A for loop where apparently the compiler wasn't sure
       whether next() could panic or not, and therefore generated a landing
       pad for the worst case. The minimal reproducible example is "for _ in 0..sr { }".
    2. A default impl of uabs where the compiler apparently wasn't sure either
       whether iabs() could panic or not. Many thanks to nagisa for
       contributing the fix.

This commit also puts extern "C" to the intrinsics, as this is generally a
good thing to do.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions