Current code assumes that CBUILD is always the same as CHOST, however it
is desirable to allow cross compiling into multilib sysroots, where
obviously the assumed condition does not hold anymore. To fix this,
let's override CBUILD only if original CHOST and CBUILD are equal, i.e.
we are not cross-compiling.
done
export _DEFAULT_ABI_SAVED="true"
+ # Set CBUILD only if not cross-compiling.
+ if [[ ${CBUILD} == "${CHOST}" ]]; then
+ export CBUILD=$(get_abi_CHOST $1)
+ fi
+
# Set the CHOST native first so that we pick up the native
# toolchain and not a cross-compiler by accident #202811.
export CHOST=$(get_abi_CHOST ${DEFAULT_ABI})
export FC="$(tc-getFC) $(get_abi_CFLAGS)"
export LD="$(tc-getLD) $(get_abi_LDFLAGS)"
export CHOST=$(get_abi_CHOST $1)
- export CBUILD=$(get_abi_CHOST $1)
export PKG_CONFIG_LIBDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig
export PKG_CONFIG_PATH=${EPREFIX}/usr/share/pkgconfig
fi