diff options
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/llvm/14/default.nix | 46 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/1_60.nix | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/rustc.nix | 4 |
4 files changed, 29 insertions, 27 deletions
diff --git a/pkgs/development/compilers/llvm/14/default.nix b/pkgs/development/compilers/llvm/14/default.nix index 4e5e85684a2aa..b18b558d5b8e6 100644 --- a/pkgs/development/compilers/llvm/14/default.nix +++ b/pkgs/development/compilers/llvm/14/default.nix @@ -158,16 +158,17 @@ let ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [ targetLlvmLibraries.libunwind ]; - extraBuildCommands = '' - echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags - echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags - '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' - echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags - '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' - echo "-lunwind" >> $out/nix-support/cc-ldflags - '' + lib.optionalString stdenv.targetPlatform.isWasm '' - echo "-fno-exceptions" >> $out/nix-support/cc-cflags - '' + mkExtraBuildCommands cc; + extraBuildCommands = mkExtraBuildCommands cc; + nixSupport.cc-cflags = + [ "-rtlib=compiler-rt" + "-Wno-unused-command-line-argument" + "-B${targetLlvmLibraries.compiler-rt}/lib" + ] + ++ lib.optional (!stdenv.targetPlatform.isWasm) "--unwindlib=libunwind" + ++ lib.optional + (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) + "-lunwind" + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; }; clangNoLibcxx = wrapCCWith rec { @@ -177,11 +178,12 @@ let extraPackages = [ targetLlvmLibraries.compiler-rt ]; - extraBuildCommands = '' - echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags - echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags - echo "-nostdlib++" >> $out/nix-support/cc-cflags - '' + mkExtraBuildCommands cc; + extraBuildCommands = mkExtraBuildCommands cc; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-B${targetLlvmLibraries.compiler-rt}/lib" + "-nostdlib++" + ]; }; clangNoLibc = wrapCCWith rec { @@ -191,10 +193,11 @@ let extraPackages = [ targetLlvmLibraries.compiler-rt ]; - extraBuildCommands = '' - echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags - echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags - '' + mkExtraBuildCommands cc; + extraBuildCommands = mkExtraBuildCommands cc; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-B${targetLlvmLibraries.compiler-rt}/lib" + ]; }; clangNoCompilerRt = wrapCCWith rec { @@ -202,9 +205,8 @@ let libcxx = null; bintools = bintoolsNoLibc'; extraPackages = [ ]; - extraBuildCommands = '' - echo "-nostartfiles" >> $out/nix-support/cc-cflags - '' + mkExtraBuildCommands0 cc; + extraBuildCommands = mkExtraBuildCommands0 cc; + nixSupport.cc-cflags = [ "-nostartfiles" ]; }; clangNoCompilerRtWithLibc = wrapCCWith rec { diff --git a/pkgs/development/compilers/rust/1_60.nix b/pkgs/development/compilers/rust/1_60.nix index 0153b5d23a904..16f8512952d41 100644 --- a/pkgs/development/compilers/rust/1_60.nix +++ b/pkgs/development/compilers/rust/1_60.nix @@ -33,7 +33,7 @@ import ./default.nix { llvmShared = llvm_14.override { enableSharedLibraries = true; }; # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox - llvmPackagesForBuild = pkgsBuildBuild.llvmPackages_14; + llvmPackages = llvmPackages_14; # Note: the version MUST be one version prior to the version we're # building diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index 6dfc8a49063f9..6c579373f5dcf 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -10,7 +10,7 @@ , llvmSharedForBuild , llvmSharedForHost , llvmSharedForTarget -, llvmPackagesForBuild # Exposed through rustc for LTO in Firefox +, llvmPackages # Exposed through rustc for LTO in Firefox }: { stdenv, lib , buildPackages @@ -64,7 +64,7 @@ in version = rustcVersion; sha256 = rustcSha256; inherit enableRustcDev; - inherit llvmShared llvmSharedForBuild llvmSharedForHost llvmSharedForTarget llvmPackagesForBuild; + inherit llvmShared llvmSharedForBuild llvmSharedForHost llvmSharedForTarget llvmPackages; patches = rustcPatches; diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 1087ac0590820..d167cf91c3610 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -1,5 +1,5 @@ { lib, stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget -, llvmShared, llvmSharedForBuild, llvmSharedForHost, llvmSharedForTarget, llvmPackagesForBuild +, llvmShared, llvmSharedForBuild, llvmSharedForHost, llvmSharedForTarget, llvmPackages , fetchurl, file, python3 , darwin, cmake, rust, rustPlatform , pkg-config, openssl @@ -179,7 +179,7 @@ in stdenv.mkDerivation rec { passthru = { llvm = llvmShared; - llvmPackages = llvmPackagesForBuild; + inherit llvmPackages; }; meta = with lib; { |