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 <corngood@gmail.com>
This commit is contained in:
Michael Weiss 2020-08-26 14:30:46 +02:00
parent 64a2de1fc0
commit 4a82621491
No known key found for this signature in database
GPG key ID: 5BE487C4D4771D83

View file

@ -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