about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/cc-wrapper
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-15 07:58:52 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-15 07:58:52 +0000
commit9d1daa60832979d5d361dfdac136fb9e5a1af2c5 (patch)
tree5192dd85903cb092cf7dff0e3403387b3b683d84 /nixpkgs/pkgs/build-support/cc-wrapper
parent67cdfc7d42f721bf85814af5a0095fb9f9ea455d (diff)
parentf2ea252d23ebc9a5336bf6a61e0644921f64e67c (diff)
downloadnixlib-9d1daa60832979d5d361dfdac136fb9e5a1af2c5.tar
nixlib-9d1daa60832979d5d361dfdac136fb9e5a1af2c5.tar.gz
nixlib-9d1daa60832979d5d361dfdac136fb9e5a1af2c5.tar.bz2
nixlib-9d1daa60832979d5d361dfdac136fb9e5a1af2c5.tar.lz
nixlib-9d1daa60832979d5d361dfdac136fb9e5a1af2c5.tar.xz
nixlib-9d1daa60832979d5d361dfdac136fb9e5a1af2c5.tar.zst
nixlib-9d1daa60832979d5d361dfdac136fb9e5a1af2c5.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/build-support/cc-wrapper')
-rw-r--r--nixpkgs/pkgs/build-support/cc-wrapper/default.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/build-support/cc-wrapper/default.nix b/nixpkgs/pkgs/build-support/cc-wrapper/default.nix
index 8412aabfe5fa..e1da3ceb5bc9 100644
--- a/nixpkgs/pkgs/build-support/cc-wrapper/default.nix
+++ b/nixpkgs/pkgs/build-support/cc-wrapper/default.nix
@@ -107,6 +107,8 @@ let
     && !(stdenv.targetPlatform.useAndroidPrebuilt or false)
     && !(stdenv.targetPlatform.isiOS or false)
     && gccForLibs != null;
+  gccForLibs_solib = getLib gccForLibs
+    + optionalString (targetPlatform != hostPlatform) "/${targetPlatform.config}";
 
   # older compilers (for example bootstrap's GCC 5) fail with -march=too-modern-cpu
   isGccArchSupported = arch:
@@ -374,7 +376,7 @@ stdenv.mkDerivation {
     ''
     + optionalString useGccForLibs ''
       echo "-L${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-ldflags
-      echo "-L${gccForLibs.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags
+      echo "-L${gccForLibs_solib}/lib" >> $out/nix-support/cc-ldflags
     ''
 
     # TODO We would like to connect this to `useGccForLibs`, but we cannot yet