llvmPackages_16.compiler-rt: fix FreeBSD build

The clang_rt.crt* files are only built on Linux (see the
COMPILER_RT_HAS_CRT CMake variable).
This commit is contained in:
Alyssa Ross 2023-11-04 18:08:31 +01:00
parent 3c43b804d4
commit 772a2502f1
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0

View File

@ -121,7 +121,7 @@ stdenv.mkDerivation {
# Hack around weird upsream RPATH bug
postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin) ''
ln -s "$out/lib"/*/* "$out/lib"
'' + lib.optionalString (useLLVM && !stdenv.hostPlatform.isWasm) ''
'' + lib.optionalString (useLLVM && stdenv.hostPlatform.isLinux) ''
ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o
ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
# Note the history of crt{begin,end}S in previous versions of llvm in nixpkg: