nixpkgs-suyu/pkgs
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
..
applications Merge master into staging-next 2021-05-17 06:22:23 +00:00
build-support nukeReferences: fix code signatures on aarch64-darwin 2021-05-17 00:27:03 +09:00
common-updater
data Merge pull request #121119 from SuperSandro2000/remove-gnidorah 2021-05-17 02:42:24 +02:00
desktops Merge master into staging-next 2021-05-17 06:22:23 +00:00
development llvmPackages*.clang: fix linker invocation with LLVMgold plugin 2021-05-18 16:15:03 +02:00
games Merge master into staging-next 2021-05-17 06:22:23 +00:00
misc Merge master into staging-next 2021-05-17 06:22:23 +00:00
os-specific Merge master into staging-next 2021-05-17 06:22:23 +00:00
pkgs-lib
servers Merge master into staging-next 2021-05-17 06:22:23 +00:00
shells Merge staging-next into staging 2021-05-15 06:22:25 +00:00
stdenv stdenv/darwin: Apple Silicon support 2021-05-17 00:27:02 +09:00
test
tools Merge master into staging-next 2021-05-17 06:22:23 +00:00
top-level Merge master into staging-next 2021-05-17 06:22:23 +00:00