From 9aae1e787fb4ce16eb7a0a0a338b801aa4c482b8 Mon Sep 17 00:00:00 2001 From: Tomasz Figa Date: Tue, 16 May 2017 15:09:58 -0400 Subject: [PATCH] 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. --- eclass/multilib.eclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.26.2