llvmPackages_{15,16}: fix libcxxabi -fno-exceptions build for wasm

This commit is contained in:
Lily Foster
2023-11-08 13:51:49 -05:00
parent 536833ef29
commit e58eaa0ee9
2 changed files with 44 additions and 24 deletions
+22 -12
View File
@@ -266,11 +266,13 @@ in let
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = mkExtraBuildCommands cc;
nixSupport.cc-cflags = [
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt}/lib"
"-nostdlib++"
];
nixSupport.cc-cflags =
[
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt}/lib"
"-nostdlib++"
]
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
clangNoLibc = wrapCCWith rec {
@@ -281,10 +283,12 @@ in let
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = mkExtraBuildCommands cc;
nixSupport.cc-cflags = [
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt}/lib"
];
nixSupport.cc-cflags =
[
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt}/lib"
]
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
clangNoCompilerRt = wrapCCWith rec {
@@ -293,16 +297,22 @@ in let
bintools = bintoolsNoLibc';
extraPackages = [ ];
extraBuildCommands = mkExtraBuildCommands0 cc;
nixSupport.cc-cflags = [ "-nostartfiles" ];
nixSupport.cc-cflags =
[
"-nostartfiles"
]
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
clangNoCompilerRtWithLibc = wrapCCWith rec {
clangNoCompilerRtWithLibc = wrapCCWith (rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = bintools';
extraPackages = [ ];
extraBuildCommands = mkExtraBuildCommands0 cc;
};
} // lib.optionalAttrs stdenv.targetPlatform.isWasm {
nixSupport.cc-cflags = [ "-fno-exceptions" ];
});
});
+22 -12
View File
@@ -271,11 +271,13 @@ in let
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = mkExtraBuildCommands cc;
nixSupport.cc-cflags = [
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt}/lib"
"-nostdlib++"
];
nixSupport.cc-cflags =
[
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt}/lib"
"-nostdlib++"
]
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
clangNoLibc = wrapCCWith rec {
@@ -286,10 +288,12 @@ in let
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = mkExtraBuildCommands cc;
nixSupport.cc-cflags = [
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt}/lib"
];
nixSupport.cc-cflags =
[
"-rtlib=compiler-rt"
"-B${targetLlvmLibraries.compiler-rt}/lib"
]
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
clangNoCompilerRt = wrapCCWith rec {
@@ -298,16 +302,22 @@ in let
bintools = bintoolsNoLibc';
extraPackages = [ ];
extraBuildCommands = mkExtraBuildCommands0 cc;
nixSupport.cc-cflags = [ "-nostartfiles" ];
nixSupport.cc-cflags =
[
"-nostartfiles"
]
++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions";
};
clangNoCompilerRtWithLibc = wrapCCWith rec {
clangNoCompilerRtWithLibc = wrapCCWith (rec {
cc = tools.clang-unwrapped;
libcxx = null;
bintools = bintools';
extraPackages = [ ];
extraBuildCommands = mkExtraBuildCommands0 cc;
};
} // lib.optionalAttrs stdenv.targetPlatform.isWasm {
nixSupport.cc-cflags = [ "-fno-exceptions" ];
});
# Has to be in tools despite mostly being a library,
# because we use a native helper executable from a