From 4a8262149139a9dee25a63a2d2c2888ede7d73dd Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Wed, 26 Aug 2020 14:30:46 +0200 Subject: [PATCH] llvm_11: Enable build-id when linking libLLVM shared libs This is used by mesa.drivers (still on LLVM 9) as a cache key. I've ported that change to LLVM 11 to test it and so that it doesn't get lost in future versions. Credit for the change goes to David McFarland. See #93946 for details. Co-Authored-By: David McFarland --- pkgs/development/compilers/llvm/11/llvm.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/compilers/llvm/11/llvm.nix b/pkgs/development/compilers/llvm/11/llvm.nix index 9cd0da4f4f9..f15a7d12b80 100644 --- a/pkgs/development/compilers/llvm/11/llvm.nix +++ b/pkgs/development/compilers/llvm/11/llvm.nix @@ -95,6 +95,9 @@ in stdenv.mkDerivation (rec { ln -sv $PWD/lib $out ''; + # E.g. mesa.drivers use the build-id as a cache key (see #93946): + LDFLAGS = optionalString enableSharedLibraries "-Wl,--build-id=sha1"; + cmakeFlags = with stdenv; [ "-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}" "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc