diff options
author | Tomasz Figa <tfiga@chromium.org> | 2017-05-16 15:09:58 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2017-05-16 15:10:33 -0400 |
commit | 9aae1e787fb4ce16eb7a0a0a338b801aa4c482b8 (patch) | |
tree | 9bb4299f890112923b64c9f5b982e5ea9a0bf31d /eclass/multilib.eclass | |
parent | cargo.eclass: fix quoting/arg handling (diff) | |
download | gentoo-9aae1e787fb4ce16eb7a0a0a338b801aa4c482b8.tar.gz gentoo-9aae1e787fb4ce16eb7a0a0a338b801aa4c482b8.tar.bz2 gentoo-9aae1e787fb4ce16eb7a0a0a338b801aa4c482b8.zip |
multilib.eclass: fix cross-compiling multilib ebuilds
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.
Diffstat (limited to 'eclass/multilib.eclass')
-rw-r--r-- | eclass/multilib.eclass | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass index 956f3aeed889..350b6f949d12 100644 --- a/eclass/multilib.eclass +++ b/eclass/multilib.eclass @@ -450,6 +450,11 @@ multilib_toolchain_setup() { 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}) @@ -459,7 +464,6 @@ multilib_toolchain_setup() { 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 |