Merge pull request #88988 from tobim/optimize-cross-libstdc++

gcc: optimize cross-compiled libraries
This commit is contained in:
Matthew Bauer 2020-05-27 10:12:35 -05:00 committed by GitHub
commit 7e571eb994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,9 +5,12 @@ let
in
{
# For non-cross builds these flags are currently assigned in builder.sh.
# It would be good to consolidate the generation of makeFlags
# ({C,CXX,LD}FLAGS_FOR_{BUILD,TARGET}, etc...) at some point.
EXTRA_TARGET_FLAGS = let
mkFlags = dep: langD: lib.optionals (targetPlatform != hostPlatform && dep != null && !langD) ([
"-idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
"-O2 -idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
] ++ stdenv.lib.optionals (! crossStageStatic) [
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
]);