llvm-project/lld/test
Fangrui Song 232578804a [ELF] Add --warn-backrefs-exclude=<glob>
D77522 changed --warn-backrefs to not warn for linking sandwich
problems (-ldef1 -lref -ldef2). This removed lots of false positives.

However, glibc still has some problems. libc.a defines some symbols
which are normally in libm.a and libpthread.a, e.g. __isnanl/raise.

For a linking order `-lm -lpthread -lc`, I have seen:

```
// different resolutions: GNU ld/gold select libc.a(s_isnan.o) as the definition
backward reference detected: __isnanl in libc.a(printf_fp.o) refers to libm.a(m_isnanl.o)

// different resolutions: GNU ld/gold select libc.a(raise.o) as the definition
backward reference detected: raise in libc.a(abort.o) refers to libpthread.a(pt-raise.o)
```

To facilitate deployment of --warn-backrefs, add --warn-backrefs-exclude= so that
certain known issues (which may be impractical to fix) can be whitelisted.

Deliberate choices:

* Not a comma-separated list (`--warn-backrefs-exclude=liba.a,libb.a`).
  -Wl, splits the argument at commas, so we cannot use commas.
  --export-dynamic-symbol is similar.
* Not in the style of `--warn-backrefs='*' --warn-backrefs=-liba.a`.
  We just need exclusion, not inclusion. For easier build system
  integration, we should avoid order dependency. With the current
  scheme, we enable --warn-backrefs, and indivial libraries can add
  --warn-backrefs-exclude=<glob> to their LDFLAGS.

Reviewed By: psmith

Differential Revision: https://reviews.llvm.org/D77512
2020-04-20 07:52:15 -07:00
..
COFF [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
Driver/Inputs
ELF [ELF] Add --warn-backrefs-exclude=<glob> 2020-04-20 07:52:15 -07:00
MachO Reland D75382 "[lld] Initial commit for new Mach-O backend" 2020-04-02 12:03:43 -07:00
MinGW Use error instead of fatal to report usage errors 2019-10-10 09:46:41 +00:00
Unit
darwin
mach-o [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
wasm [WebAssembly] Add int32 DW_OP_WASM_location variant 2020-04-16 16:32:17 -07:00
CMakeLists.txt Stop passing site cfg files via --param to llvm-lit. 2020-04-07 08:20:40 -04:00
lit.cfg.py ELF: Change FileSize back to a uint64_t. 2019-03-01 18:53:41 +00:00
lit.site.cfg.py.in Revert abb00753 "build: reduce CMake handling for zlib" (PR44780) 2020-03-03 11:03:09 +01:00