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

+44 -24
+22 -12
pkgs/development/compilers/llvm/15/default.nix
··· 266 targetLlvmLibraries.compiler-rt 267 ]; 268 extraBuildCommands = mkExtraBuildCommands cc; 269 - nixSupport.cc-cflags = [ 270 - "-rtlib=compiler-rt" 271 - "-B${targetLlvmLibraries.compiler-rt}/lib" 272 - "-nostdlib++" 273 - ]; 274 }; 275 276 clangNoLibc = wrapCCWith rec { ··· 281 targetLlvmLibraries.compiler-rt 282 ]; 283 extraBuildCommands = mkExtraBuildCommands cc; 284 - nixSupport.cc-cflags = [ 285 - "-rtlib=compiler-rt" 286 - "-B${targetLlvmLibraries.compiler-rt}/lib" 287 - ]; 288 }; 289 290 clangNoCompilerRt = wrapCCWith rec { ··· 293 bintools = bintoolsNoLibc'; 294 extraPackages = [ ]; 295 extraBuildCommands = mkExtraBuildCommands0 cc; 296 - nixSupport.cc-cflags = [ "-nostartfiles" ]; 297 }; 298 299 - clangNoCompilerRtWithLibc = wrapCCWith rec { 300 cc = tools.clang-unwrapped; 301 libcxx = null; 302 bintools = bintools'; 303 extraPackages = [ ]; 304 extraBuildCommands = mkExtraBuildCommands0 cc; 305 - }; 306 307 }); 308
··· 266 targetLlvmLibraries.compiler-rt 267 ]; 268 extraBuildCommands = mkExtraBuildCommands cc; 269 + nixSupport.cc-cflags = 270 + [ 271 + "-rtlib=compiler-rt" 272 + "-B${targetLlvmLibraries.compiler-rt}/lib" 273 + "-nostdlib++" 274 + ] 275 + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; 276 }; 277 278 clangNoLibc = wrapCCWith rec { ··· 283 targetLlvmLibraries.compiler-rt 284 ]; 285 extraBuildCommands = mkExtraBuildCommands cc; 286 + nixSupport.cc-cflags = 287 + [ 288 + "-rtlib=compiler-rt" 289 + "-B${targetLlvmLibraries.compiler-rt}/lib" 290 + ] 291 + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; 292 }; 293 294 clangNoCompilerRt = wrapCCWith rec { ··· 297 bintools = bintoolsNoLibc'; 298 extraPackages = [ ]; 299 extraBuildCommands = mkExtraBuildCommands0 cc; 300 + nixSupport.cc-cflags = 301 + [ 302 + "-nostartfiles" 303 + ] 304 + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; 305 }; 306 307 + clangNoCompilerRtWithLibc = wrapCCWith (rec { 308 cc = tools.clang-unwrapped; 309 libcxx = null; 310 bintools = bintools'; 311 extraPackages = [ ]; 312 extraBuildCommands = mkExtraBuildCommands0 cc; 313 + } // lib.optionalAttrs stdenv.targetPlatform.isWasm { 314 + nixSupport.cc-cflags = [ "-fno-exceptions" ]; 315 + }); 316 317 }); 318
+22 -12
pkgs/development/compilers/llvm/16/default.nix
··· 271 targetLlvmLibraries.compiler-rt 272 ]; 273 extraBuildCommands = mkExtraBuildCommands cc; 274 - nixSupport.cc-cflags = [ 275 - "-rtlib=compiler-rt" 276 - "-B${targetLlvmLibraries.compiler-rt}/lib" 277 - "-nostdlib++" 278 - ]; 279 }; 280 281 clangNoLibc = wrapCCWith rec { ··· 286 targetLlvmLibraries.compiler-rt 287 ]; 288 extraBuildCommands = mkExtraBuildCommands cc; 289 - nixSupport.cc-cflags = [ 290 - "-rtlib=compiler-rt" 291 - "-B${targetLlvmLibraries.compiler-rt}/lib" 292 - ]; 293 }; 294 295 clangNoCompilerRt = wrapCCWith rec { ··· 298 bintools = bintoolsNoLibc'; 299 extraPackages = [ ]; 300 extraBuildCommands = mkExtraBuildCommands0 cc; 301 - nixSupport.cc-cflags = [ "-nostartfiles" ]; 302 }; 303 304 - clangNoCompilerRtWithLibc = wrapCCWith rec { 305 cc = tools.clang-unwrapped; 306 libcxx = null; 307 bintools = bintools'; 308 extraPackages = [ ]; 309 extraBuildCommands = mkExtraBuildCommands0 cc; 310 - }; 311 312 # Has to be in tools despite mostly being a library, 313 # because we use a native helper executable from a
··· 271 targetLlvmLibraries.compiler-rt 272 ]; 273 extraBuildCommands = mkExtraBuildCommands cc; 274 + nixSupport.cc-cflags = 275 + [ 276 + "-rtlib=compiler-rt" 277 + "-B${targetLlvmLibraries.compiler-rt}/lib" 278 + "-nostdlib++" 279 + ] 280 + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; 281 }; 282 283 clangNoLibc = wrapCCWith rec { ··· 288 targetLlvmLibraries.compiler-rt 289 ]; 290 extraBuildCommands = mkExtraBuildCommands cc; 291 + nixSupport.cc-cflags = 292 + [ 293 + "-rtlib=compiler-rt" 294 + "-B${targetLlvmLibraries.compiler-rt}/lib" 295 + ] 296 + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; 297 }; 298 299 clangNoCompilerRt = wrapCCWith rec { ··· 302 bintools = bintoolsNoLibc'; 303 extraPackages = [ ]; 304 extraBuildCommands = mkExtraBuildCommands0 cc; 305 + nixSupport.cc-cflags = 306 + [ 307 + "-nostartfiles" 308 + ] 309 + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; 310 }; 311 312 + clangNoCompilerRtWithLibc = wrapCCWith (rec { 313 cc = tools.clang-unwrapped; 314 libcxx = null; 315 bintools = bintools'; 316 extraPackages = [ ]; 317 extraBuildCommands = mkExtraBuildCommands0 cc; 318 + } // lib.optionalAttrs stdenv.targetPlatform.isWasm { 319 + nixSupport.cc-cflags = [ "-fno-exceptions" ]; 320 + }); 321 322 # Has to be in tools despite mostly being a library, 323 # because we use a native helper executable from a