https://bugs.llvm.org/show_bug.cgi?id=40045

            Bug ID: 40045
           Summary: lld regression: LTO references unused compiler
                    builtins symbols, raising binary libgcc requirements
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedb...@nondot.org
          Reporter: a...@crichton.co
                CC: llvm-bugs@lists.llvm.org, peter.sm...@linaro.org,
                    pe...@pcc.me.uk, r...@google.com

Hello! We've recently discovered a regression [1] in the downstream
rust-lang/rust project about how the rustc binary we're producing has a higher
binary version requirement than intended. We build in a super-old CentOS
container for a very low glibc (2.5) and libgcc binary requirement. When we
updated our build to use LLVM 7 to compile LLVM [2], however, we noticed that
our compiler required symbols like `__floatuntitf` with the symbol version
`GCC_4.3.0` which it didn't before. This in turn causes the compiler to be not
runnable on these old systems because libgcc doesn't have the symbols within.

Some bisection on our end has turned up [3] as the culprit. It looks like
that's injecting references to even unused symbols, which seems to be raising
our binary requirement. 

I've cc'd those on the diff for that, and I'm curious if y'all have thoughts on
this? Is it a bug in LLD that it's referencing these symbols in the final
binary when the binary itself doesn't need the symbols? Or is this a bug on our
end where we just shouldn't enable LTO (or more specifically, ThinLTO in our
case)


[1]: https://github.com/rust-lang/rust/issues/56849
[2]: https://github.com/rust-lang/rust/pull/55952
[3]: https://reviews.llvm.org/D50017

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to