diff options
author | Dan Peebles <pumpkin@me.com> | 2018-09-15 16:49:44 -0400 |
---|---|---|
committer | Dan Peebles <pumpkin@me.com> | 2018-09-16 02:12:11 -0400 |
commit | 110c2528709ee10466a6b4bee5a2adefe11a0c3f (patch) | |
tree | eb398c8ec993c79ba28756b1c7484b8cc9c730c0 /pkgs/development/compilers/llvm | |
parent | b91ad0e54f6a44737198b8cbcea67467ec991aee (diff) | |
download | nixlib-110c2528709ee10466a6b4bee5a2adefe11a0c3f.tar nixlib-110c2528709ee10466a6b4bee5a2adefe11a0c3f.tar.gz nixlib-110c2528709ee10466a6b4bee5a2adefe11a0c3f.tar.bz2 nixlib-110c2528709ee10466a6b4bee5a2adefe11a0c3f.tar.lz nixlib-110c2528709ee10466a6b4bee5a2adefe11a0c3f.tar.xz nixlib-110c2528709ee10466a6b4bee5a2adefe11a0c3f.tar.zst nixlib-110c2528709ee10466a6b4bee5a2adefe11a0c3f.zip |
cctools: support LTO on Darwin
LTO is disabled during bootstrap to keep the bootstrap tools small and avoid unnecessary LLVM rebuilds, but is enabled in the final stdenv stage and should be usable by normal packages.
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rw-r--r-- | pkgs/development/compilers/llvm/5/llvm.nix | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm.nix index 3abba0ed340f..6dae8be97c88 100644 --- a/pkgs/development/compilers/llvm/5/llvm.nix +++ b/pkgs/development/compilers/llvm/5/llvm.nix @@ -119,12 +119,14 @@ in stdenv.mkDerivation (rec { + stdenv.lib.optionalString enableSharedLibraries '' moveToOutput "lib/libLLVM-*" "$lib" moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" + moveToOutput "lib/libLTO${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib" substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-" '' + stdenv.lib.optionalString (stdenv.isDarwin && enableSharedLibraries) '' substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \ - --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" + --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" \ + --replace "\''${_IMPORT_PREFIX}/lib/libLTO.dylib" "$lib/lib/libLTO.dylib" ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib ''; |