summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/11/default.nix
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-06-27 18:43:42 -0700
committerAdam Joseph <adam@westernsemico.com>2023-07-01 13:12:41 -0700
commit63305d00d32e8c743e36155a7d8cd544dc676d5b (patch)
treedce3f1a79070be6900f803f9ac215fb6436c7c7f /pkgs/development/compilers/gcc/11/default.nix
parent443dfc4b05360794aa0304459177557107274559 (diff)
downloadnixpkgs-63305d00d32e8c743e36155a7d8cd544dc676d5b.tar
nixpkgs-63305d00d32e8c743e36155a7d8cd544dc676d5b.tar.gz
nixpkgs-63305d00d32e8c743e36155a7d8cd544dc676d5b.tar.bz2
nixpkgs-63305d00d32e8c743e36155a7d8cd544dc676d5b.tar.lz
nixpkgs-63305d00d32e8c743e36155a7d8cd544dc676d5b.tar.xz
nixpkgs-63305d00d32e8c743e36155a7d8cd544dc676d5b.tar.zst
nixpkgs-63305d00d32e8c743e36155a7d8cd544dc676d5b.zip
gcc: withoutTargetLibc: build libgcc_s.so
We want a `libgcc_s.so` to be built by the first stage
cross-compiler (withoutTargetLibc), since that is the compiler which
will compile the target libc.

This commit accomplishes that, by making three changes:

1. Replacing the `targetPlatform.libc == "msvcrt" &&` conditional
   with `enableShared`, so that the code which cross-build
   `libgcc_s.so` is used for all cross compilers capable of emitting
   shared libraries.

2. Removing the `targetPlatform == hostPlatform` guard from the code
   which produces the `libgcc` output.

3. Looking for build products in in "lib/${targetPlatform.config}/"
   rather than "lib/", so we will find them when cross compiling.
Diffstat (limited to 'pkgs/development/compilers/gcc/11/default.nix')
-rw-r--r--pkgs/development/compilers/gcc/11/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix
index c64fd0853f9..f61e51e2cab 100644
--- a/pkgs/development/compilers/gcc/11/default.nix
+++ b/pkgs/development/compilers/gcc/11/default.nix
@@ -307,6 +307,6 @@ lib.pipe (stdenv.mkDerivation ({
 // optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
 ))
 [
-  (callPackage ../common/libgcc.nix   { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc; })
+  (callPackage ../common/libgcc.nix   { inherit version langC langCC langJit targetPlatform hostPlatform withoutTargetLibc enableShared; })
   (callPackage ../common/checksum.nix { inherit langC langCC; })
 ]