llvm-project/lld/wasm
Nico Weber bbfe0b79e2 Omit path to lld binary from lld's error, warning, and log output.
lld currently prepends the absolute path to itself to every diagnostic it
emits. This path can be longer than the diagnostic, and makes the actual error
message hard to read.

There isn't a good reason for printing this path: if you want to know which lld
you're running, pass -v to clang – chances are that if you're unsure of this,
you're not only unsure when it errors out. Some people want an indication that
the diagnostic is from the linker though, so instead print just the basename of
the linker's path.

Before:

```
$ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld 
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crt1.o: No such file or directory
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crti.o: No such file or directory
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtbegin.o: No such file or directory
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lc
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtend.o: No such file or directory
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtn.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

After:

```
$ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld 
ld.lld: error: cannot open crt1.o: No such file or directory
ld.lld: error: cannot open crti.o: No such file or directory
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: unable to find library -lc
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: cannot open crtend.o: No such file or directory
ld.lld: error: cannot open crtn.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

https://reviews.llvm.org/D49189

llvm-svn: 337634
2018-07-20 23:09:12 +00:00
..
CMakeLists.txt [WebAssembly] Fix broken build due to missing attributes.inc 2018-06-13 08:38:23 +00:00
Config.h [WebAssembly] Add --export-all flag 2018-06-07 01:27:07 +00:00
Driver.cpp Omit path to lld binary from lld's error, warning, and log output. 2018-07-20 23:09:12 +00:00
InputChunks.cpp Replace last DEBUG occurrence with LLVM_DEBUG in lld. 2018-05-23 14:03:01 +00:00
InputChunks.h [WebAssembly] Add option to remove LEB padding at relocate sites 2018-05-18 23:28:05 +00:00
InputFiles.cpp [WebAssembly] Fix archive member display in error messages 2018-07-18 21:46:09 +00:00
InputFiles.h [WebAssembly] Fix archive member display in error messages 2018-07-18 21:46:09 +00:00
InputGlobal.h [WebAssembly] Implement -print-gc-sections, to better test GC of globals 2018-04-20 17:28:12 +00:00
LTO.cpp [WebAssembly] Set threadmodel during LTO 2018-07-02 16:27:50 +00:00
LTO.h [WebAssembly] Initial support for LTO 2018-05-30 18:07:52 +00:00
MarkLive.cpp [WebAssembly] Add support for bitcode archive members 2018-06-28 17:04:58 +00:00
MarkLive.h Consistent (non) use of empty lines in include blocks 2018-02-20 21:53:18 +00:00
Options.td [WebAssembly] Add --export-all flag 2018-06-07 01:27:07 +00:00
OutputSections.cpp [WebAssembly] Add option to remove LEB padding at relocate sites 2018-05-18 23:28:05 +00:00
OutputSections.h [WebAssembly] Add support for debug (DWARF) sections 2018-05-04 23:14:42 +00:00
OutputSegment.h [WebAssembly] Remove another trivial accessor. 2018-04-05 19:37:31 +00:00
SymbolTable.cpp [WebAssemlby] Set IsUsedInRegularObj correctly for undefined data symbols 2018-07-17 19:15:02 +00:00
SymbolTable.h [WebAssembly] Initial support for LTO 2018-05-30 18:07:52 +00:00
Symbols.cpp [WebAssembly] Fix --export of LTO symbols 2018-06-28 17:21:46 +00:00
Symbols.h [WebAssembly] Fix --export of LTO symbols 2018-06-28 17:21:46 +00:00
Writer.cpp [WebAssembly] Add support for bitcode archive members 2018-06-28 17:04:58 +00:00
Writer.h
WriterUtils.cpp Support: Simplify endian stream interface. NFCI. 2018-05-18 19:46:24 +00:00
WriterUtils.h [WebAssembly] Add export/import for function pointer table 2018-03-27 17:38:51 +00:00