summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Ratiu <adrian.ratiu@collabora.com>2022-10-14 16:47:13 +0300
committerMike Gilbert <floppym@gentoo.org>2022-10-15 13:25:27 -0400
commit44e7f86ff7cf80e0ec466778d82695c68a89ead1 (patch)
tree03fc7913779781bb49743b543a260d3744f93063
parentdev-ml/core: adj deps (diff)
downloadgentoo-44e7f86ff7cf80e0ec466778d82695c68a89ead1.tar.gz
gentoo-44e7f86ff7cf80e0ec466778d82695c68a89ead1.tar.bz2
gentoo-44e7f86ff7cf80e0ec466778d82695c68a89ead1.zip
sys-libs/libxcrypt: fix binary cross compilation
Even though all files are installed in the proper places when cross compiling, further testing revealed the libxcrypt binary itself is not correctly cross-complied for the target architecture, instead it is compiled for the host. Set up the proper variables to ensure the binary is built for the correct architecture. Before: libcrypt.so.2.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[xxHash]=0d041ee2539129be, stripped After: libcrypt.so.2.0.0: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[xxHash]=ba09206297aebce3, stripped Closes: https://bugs.gentoo.org/877093 Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> Closes: https://github.com/gentoo/gentoo/pull/27780 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r--sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild11
-rw-r--r--sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild11
2 files changed, 22 insertions, 0 deletions
diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
index c55c58c004b0..7c7340f29a7b 100644
--- a/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
+++ b/sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild
@@ -165,6 +165,7 @@ get_xcpkgconfigdir() {
multilib_src_configure() {
local -a myconf=(
+ --host=${CTARGET}
--disable-werror
--libdir=$(get_xclibdir)
--with-pkgconfigdir=$(get_xcpkgconfigdir)
@@ -196,6 +197,16 @@ multilib_src_configure() {
*) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";;
esac
+ tc-export PKG_CONFIG
+
+ if is_cross; then
+ if tc-is-clang; then
+ export CC="${CTARGET}-clang"
+ else
+ export CC="${CTARGET}-gcc"
+ fi
+ fi
+
ECONF_SOURCE="${S}" econf "${myconf[@]}"
}
diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
index 8cd9318c3373..3f390bf67ca3 100644
--- a/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
+++ b/sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild
@@ -167,6 +167,7 @@ get_xcpkgconfigdir() {
multilib_src_configure() {
local -a myconf=(
+ --host=${CTARGET}
--disable-werror
--libdir=$(get_xclibdir)
--with-pkgconfigdir=$(get_xcpkgconfigdir)
@@ -174,6 +175,16 @@ multilib_src_configure() {
--mandir="$(get_xcmandir)"
)
+ tc-export PKG_CONFIG
+
+ if is_cross; then
+ if tc-is-clang; then
+ export CC="${CTARGET}-clang"
+ else
+ export CC="${CTARGET}-gcc"
+ fi
+ fi
+
if use elibc_musl; then
# musl declares getcontext and swapcontext in ucontext.h,
# but does not implement them in libc.