Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 877093 - sys-libs/libxcrypt: binary cross compiled for wrong architecture
Summary: sys-libs/libxcrypt: binary cross compiled for wrong architecture
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL: https://github.com/gentoo/gentoo/pull...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-14 14:14 UTC by Adrian Ratiu
Modified: 2022-10-15 17:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Ratiu 2022-10-14 14:14:53 UTC
Hi, further testing libxcrypt in cross-compile setups has revealed the library is always compiled for the host build architecture instead of the target arch.



Reproducible: Always

Steps to Reproduce:
1. Build any cross-compiled libxcrypt
2. Run "file" on the installed binary to verify the architecture
Actual Results:  
Cross compilation builds the binary for the host architecture.

Expected Results:  
Cross compilation should build the binary for each target arch.

I've created a pull request with a fix: https://github.com/gentoo/gentoo/pull/27780
Comment 1 Larry the Git Cow gentoo-dev 2022-10-15 17:26:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44e7f86ff7cf80e0ec466778d82695c68a89ead1

commit 44e7f86ff7cf80e0ec466778d82695c68a89ead1
Author:     Adrian Ratiu <adrian.ratiu@collabora.com>
AuthorDate: 2022-10-14 13:47:13 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-10-15 17:25:27 +0000

    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>

 sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild | 11 +++++++++++
 sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild | 11 +++++++++++
 2 files changed, 22 insertions(+)