From 0b3244db9b490c28909f7f6fd543b2a24a63e467 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 19 Feb 2021 10:01:40 -0600 Subject: [PATCH 1/2] gyp: use LDFLAGS_host for host toolset This makes the behaviour similar to that of CFLAGS_host --- pylib/gyp/generator/ninja.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py index c57bec6a..ca032aef 100644 --- a/pylib/gyp/generator/ninja.py +++ b/pylib/gyp/generator/ninja.py @@ -1417,7 +1417,11 @@ def WriteLinkForArch( is_executable = spec["type"] == "executable" # The ldflags config key is not used on mac or win. On those platforms # linker flags are set via xcode_settings and msvs_settings, respectively. - env_ldflags = os.environ.get("LDFLAGS", "").split() + if self.toolset == "target": + env_ldflags = os.environ.get("LDFLAGS", "").split() + elif self.toolset == "host": + env_ldflags = os.environ.get("LDFLAGS_host", "").split() + if self.flavor == "mac": ldflags = self.xcode_settings.GetLdflags( config_name, From af673bca87a019f57e01569e84dbeedc19e77c39 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 20 Feb 2021 14:14:21 -0600 Subject: [PATCH 2/2] Support LDFLAGS_host in make too --- pylib/gyp/generator/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index 857875a5..eb9102dd 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -319,7 +319,7 @@ def CalculateGeneratorInputInfo(params): CXX.host ?= %(CXX.host)s CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) LINK.host ?= %(LINK.host)s -LDFLAGS.host ?= +LDFLAGS.host ?= $(LDFLAGS_host) AR.host ?= %(AR.host)s # Define a dir function that can handle spaces.