Merge pull request #192459 from danielfullmer/fix-cc-wrapper-libdir

This commit is contained in:
Artturi 2023-09-07 01:58:51 +03:00 committed by GitHub
commit fa3a4a18c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,6 +107,8 @@ let
&& !(stdenv.targetPlatform.useAndroidPrebuilt or false) && !(stdenv.targetPlatform.useAndroidPrebuilt or false)
&& !(stdenv.targetPlatform.isiOS or false) && !(stdenv.targetPlatform.isiOS or false)
&& gccForLibs != null; && 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 # older compilers (for example bootstrap's GCC 5) fail with -march=too-modern-cpu
isGccArchSupported = arch: isGccArchSupported = arch:
@ -374,7 +376,7 @@ stdenv.mkDerivation {
'' ''
+ optionalString useGccForLibs '' + optionalString useGccForLibs ''
echo "-L${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-ldflags 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 # TODO We would like to connect this to `useGccForLibs`, but we cannot yet