From a596ec5b39f900b1f4b481cc46afd20b0e5457d2 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 26 Mar 2017 23:32:27 -0700 Subject: Fix up the sysroot issue for sh4 in a different way (see the comments in the code for details on the issue) Old workaround in 100-gcc.sh stopped working (probably, due to one of GCC version upgrades), so switch to the other approach originally described there: adjust the list of multilibs to not include the default target explicitly. Signed-off-by: Alexey Neyman --- scripts/build/arch/sh.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'scripts/build/arch') diff --git a/scripts/build/arch/sh.sh b/scripts/build/arch/sh.sh index 6761435d..59bc08aa 100644 --- a/scripts/build/arch/sh.sh +++ b/scripts/build/arch/sh.sh @@ -36,6 +36,29 @@ CT_DoArchTupleValues () { CT_ARCH_FLOAT_CFLAG= } +CT_DoArchMultilibList() { + local save_ifs="${IFS}" + local new + local x + + # In a configuration for SuperH, GCC list of multilibs shall not include + # the default CPU. E.g. if configuring for sh4-*-*, we need to remove + # "sh4" or "m4" from the multilib list. Otherwise, the resulting compiler + # will fail when that CPU is selected explicitly "sh4-multilib-linux-gnu-gcc -m4 ..." + # as it will fail to find the sysroot with that suffix. + IFS=, + for x in ${CT_CC_GCC_MULTILIB_LIST}; do + if [ "${x}" = "${CT_ARCH_SH_VARIANT}" -o "sh${x#m}" = "${CT_ARCH_SH_VARIANT}" ]; then + CT_DoLog WARN "Ignoring '${x}' in multilib list: it is the default multilib" + continue + fi + new="${new:+${new},}${x}" + done + IFS="${save_ifs}" + CT_CC_GCC_MULTILIB_LIST="${new}" + CT_DoLog DEBUG "Adjusted CT_CC_GCC_MULTILIB_LIST to '${CT_CC_GCC_MULTILIB_LIST}'" +} + CT_DoArchUClibcConfig() { local cfg="${1}" -- cgit v1.2.3