llvmPackages: fix wasm with common opts

This commit is contained in:
Tristan Ross 2024-08-03 23:07:14 -07:00
parent 68f51c7bbb
commit 0b07b7e4b7
No known key found for this signature in database
GPG Key ID: B09C422035669AF8

View File

@ -471,10 +471,12 @@ let
&& stdenv.targetPlatform.useLLVM or false
) "-lunwind"
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
nixSupport.cc-ldflags = lib.optionals (
!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD
) [ "-L${targetLlvmLibraries.libunwind}/lib" ]
++ lib.optional (lib.versionAtLeast metadata.release_version "17") "--undefined-version";
nixSupport.cc-ldflags =
lib.optionals (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD)
(
[ "-L${targetLlvmLibraries.libunwind}/lib" ]
++ lib.optional (lib.versionAtLeast metadata.release_version "17") "--undefined-version"
);
}
);
@ -695,13 +697,11 @@ let
./compiler-rt/armv6-scudo-no-yield.patch
./compiler-rt/armv6-scudo-libatomic.patch
]
++ lib.optional (lib.versionAtLeast metadata.release_version "19") (
fetchpatch {
url = "https://github.com/llvm/llvm-project/pull/99837/commits/14ae0a660a38e1feb151928a14f35ff0f4487351.patch";
hash = "sha256-JykABCaNNhYhZQxCvKiBn54DZ5ZguksgCHnpdwWF2no=";
relative = "compiler-rt";
}
);
++ lib.optional (lib.versionAtLeast metadata.release_version "19") (fetchpatch {
url = "https://github.com/llvm/llvm-project/pull/99837/commits/14ae0a660a38e1feb151928a14f35ff0f4487351.patch";
hash = "sha256-JykABCaNNhYhZQxCvKiBn54DZ5ZguksgCHnpdwWF2no=";
relative = "compiler-rt";
});
in
{
compiler-rt-libc = callPackage ./compiler-rt (