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
This commit is contained in:
Stefan Kalkowski 2020-01-06 15:07:01 +01:00 committed by Christian Helmuth
parent c2a2ec121f
commit fe899eecc7
1 changed files with 3 additions and 3 deletions

View File

@ -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)