From 63305d00d32e8c743e36155a7d8cd544dc676d5b Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 27 Jun 2023 18:43:42 -0700 Subject: 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. --- pkgs/development/compilers/gcc/11/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/development/compilers/gcc/11/default.nix') 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; }) ] -- cgit 1.4.1