From fe899eecc76d3edb82bb2c47d32ff630a7a60e90 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 6 Jan 2020 15:07:01 +0100 Subject: [PATCH] base-linux: fix configurable host toolchain With the '-x' argument of the 'g++' tool the language gets specified, therefore it has to be 'c++' furthermore, not CUSTOM_HOST_CXX. Moreover, when import-lx_hybrid.mk gets evaluated first, global.mk is not included yet, therefore we cannot eagerly evaluate the CXX_LINK_OPT_NO_PIE variable. Issue #3466 --- repos/base-linux/lib/import/import-lx_hybrid.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/base-linux/lib/import/import-lx_hybrid.mk b/repos/base-linux/lib/import/import-lx_hybrid.mk index 8235c47d19..e47af6fa07 100644 --- a/repos/base-linux/lib/import/import-lx_hybrid.mk +++ b/repos/base-linux/lib/import/import-lx_hybrid.mk @@ -18,7 +18,7 @@ HOST_LIB_SEARCH_DIRS = $(shell $(CUSTOM_HOST_CC) $(CC_MARCH) -print-search-dirs # is appended to the include directory list. # HOST_INC_DIR += $(shell echo "int main() {return 0;}" |\ - LANG=C $(CXX) -x $(CUSTOM_HOST_CXX) -v -E - 2>&1 |\ + LANG=C $(CXX) -x c++ -v -E - 2>&1 |\ sed '/^\#include <\.\.\.> search starts here:/,/^End of search list/!d' |\ grep "include-fixed") @@ -114,8 +114,8 @@ CC_OPT += -Wno-format-security # Disable position-independent executables (which are enabled by default on # Ubuntu 16.10 or newer) # -CXX_LINK_OPT_NO_PIE := $(shell \ - (echo "int main(){}" | $(LD_CMD) -no-pie -x $(CUSTOM_HOST_CXX) - -o /dev/null >& /dev/null \ +CXX_LINK_OPT_NO_PIE = $(shell \ + (echo "int main(){}" | $(CUSTOM_HOST_CXX) -no-pie -x c++ - -o /dev/null >& /dev/null \ && echo "-no-pie") || true) CXX_LINK_OPT += $(CXX_LINK_OPT_NO_PIE)