From 36d6d7a255c3dafea5bfff0caca81197404c56d1 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Sat, 18 May 2019 13:29:22 -0400 Subject: [PATCH] Two fixes to win32 cross compilation - The default mingw32 gfortran on ubuntu prints the version as `GNU Fortran (GCC) 7.3-win32 20180312`, rather than `7.3.0` most other gfortrans do, so be robust to that in normalize_triplet - When shelling out to python use the host path rather than the windows-equivalent path, since python is a host tool. --- contrib/normalize_triplet.py | 2 +- deps/tools/bb-install.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/normalize_triplet.py b/contrib/normalize_triplet.py index ce23ea065b893..7bc5554ffff3d 100755 --- a/contrib/normalize_triplet.py +++ b/contrib/normalize_triplet.py @@ -117,7 +117,7 @@ def p(x): "7": "gcc7", "8": "gcc8", "9": "gcc8", - }[list(filter(lambda x: re.match("\d+\.\d+\.\d+", x), sys.argv[2].split()))[-1][0]] + }[list(filter(lambda x: re.match("\d+\.\d+(\.\d+)?", x), sys.argv[2].split()))[-1][0]] if cxx_abi == "blank_cxx_abi": if len(sys.argv) == 4: diff --git a/deps/tools/bb-install.mk b/deps/tools/bb-install.mk index 198cfe1fc84cd..4db7c5d029691 100644 --- a/deps/tools/bb-install.mk +++ b/deps/tools/bb-install.mk @@ -1,6 +1,6 @@ # Auto-detect triplet once, create different versions that we use as defaults below for each BB install target # This is much more efficient than launching `gcc` and `python` once for each BB install target. -BB_TRIPLET_GCCABI_CXXABI := $(shell python $(call cygpath_w,$(JULIAHOME)/contrib/normalize_triplet.py) $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) "$(shell $(FC) --version | head -1)" "$(shell echo '\#include ' | $(CXX) $(CXXFLAGS) -x c++ -dM -E - | grep _GLIBCXX_USE_CXX11_ABI | awk '{ print $$3 }' )") +BB_TRIPLET_GCCABI_CXXABI := $(shell python $(JULIAHOME)/contrib/normalize_triplet.py $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) "$(shell $(FC) --version | head -1)" "$(shell echo '\#include ' | $(CXX) $(CXXFLAGS) -x c++ -dM -E - | grep _GLIBCXX_USE_CXX11_ABI | awk '{ print $$3 }' )") BB_TRIPLET_GCCABI := $(subst $(SPACE),-,$(filter-out cxx%,$(subst -,$(SPACE),$(BB_TRIPLET_GCCABI_CXXABI)))) BB_TRIPLET_CXXABI := $(subst $(SPACE),-,$(filter-out gcc%,$(subst -,$(SPACE),$(BB_TRIPLET_GCCABI_CXXABI)))) BB_TRIPLET := $(subst $(SPACE),-,$(filter-out cxx%,$(filter-out gcc%,$(subst -,$(SPACE),$(BB_TRIPLET_GCCABI_CXXABI)))))