Commit Graph

3 Commits

Author SHA1 Message Date
Peter Collingbourne 98930115ea ELF: Only add libcall symbols to the link if defined in bitcode.
Adding all libcall symbols to the link can have undesired consequences.
For example, the libgcc implementation of __sync_val_compare_and_swap_8
on 32-bit ARM pulls in an .init_array entry that aborts the program if
the Linux kernel does not support 64-bit atomics, which would prevent
the program from running even if it does not use 64-bit atomics.

This change makes it so that we only add libcall symbols to the
link before LTO if we have to, i.e. if the symbol's definition is in
bitcode. Any other required libcall symbols will be added to the link
after LTO when we add the LTO object file to the link.

Differential Revision: https://reviews.llvm.org/D50475

llvm-svn: 339301
2018-08-08 23:48:12 +00:00
Peter Smith 5c57957281 Add missing REQUIRES x86 to tests.
Add REQUIRES to tests that fail when an x86 backend is not present.

Differential Revision: https://reviews.llvm.org/D50440

llvm-svn: 339253
2018-08-08 14:50:33 +00:00
Peter Collingbourne 2da4e52182 ELF: Add libcall symbols to the link when LTO is being used.
If any of our inputs are bitcode files, the LTO code generator may create
references to certain library functions that might not be explicit in the
bitcode file's symbol table. If any of those library functions are defined
in a bitcode file in an archive member, we need to arrange to use LTO to
compile those archive members by adding them to the link beforehand.

Differential Revision: https://reviews.llvm.org/D50017

llvm-svn: 338434
2018-07-31 20:36:17 +00:00