nixpkgs/pkgs/development/compilers/llvm
sternenseemann 3530837417 llvmPackages*.clang: fix linker invocation with LLVMgold plugin
When using GNU binutils, clang passes the LLVMgold.so plugin to the
linker for certain operations that require special support in the linker
like doing link time optimization (LTO). When passing the plugin to the
linker's command line, clang assumes that llvm and itself are installed
in the same prefix and thus `/path/to/clang/bin/../lib/LLVMgold.so` is
the plugin.

Since we install clang and llvm to separate store paths, this assumption
does not hold. When clang-unwrapped only had a single output, we worked
around this issue by symlinking `$out/lib/LLVMgold.so` to
`${llvm}/lib/LLVMgold.so`. However since we split all llvm packages into
multiple outputs clang's `$out` no longer has a lib directory and clang
can't discover clangs lib output on its own. As a result LTO was broken.

Instead of introducing yet another hack and having a symlink to
LLVMgold.so in `$out/lib` (despite having `$lib/lib` as well), we patch
clang to use a hard coded path to `${libllvm.lib}/lib` for discovering
`LLVMgold.so`.

Resolves #123361.
2021-05-18 16:15:03 +02:00
..
5 llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
6 llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
7 llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
8 llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
9 llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
10 llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
11 llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
12 llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
common/compiler-rt llvmPackages: Organize files 2021-03-24 05:02:50 +00:00
rocm llvmPackages: Multuple outputs for everythting 2021-04-30 05:41:00 +00:00
aarch64.patch llvm: Include aarch64 patch in repo 2017-11-29 17:01:17 +02:00
clang-6-10-LLVMgold-path.patch llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
clang-11-12-LLVMgold-path.patch llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
exegesis-force-bdver2.patch llvmPackages_12.llvm: fix building on older CPUs 2021-04-17 01:55:53 +00:00
libcxx-0001-musl-hacks.patch llvmPackages_{4,5}: musl compat 2018-02-19 11:19:32 -06:00
multi.nix clang, cc-wrapper: Move --gcc-toolchain logic into CC wrapper 2021-01-24 15:49:32 -05:00
TLI-musl.patch llvmPackages_{4,5}: musl compat 2018-02-19 11:19:32 -06:00
update.sh llvmPackages: Add an update script 2021-04-01 13:31:48 +02:00