Summary: | sys-libs/musl-1.1.24 : static libraries have all one object file with "no machine" instead of "ARM" | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Johannes Geiss <johannes.geiss> |
Component: | Current packages | Assignee: | Anthony Basile <blueness> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | herrtimson, lu_zero, musl, slyfox, toolchain |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=697428 https://bugs.gentoo.org/show_bug.cgi?id=830213 https://bugs.gentoo.org/show_bug.cgi?id=552616 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 724484 | ||
Bug Blocks: |
Description
Johannes Geiss
2019-11-21 13:45:10 UTC
I think musl will need an equivalent of strip avoidance: https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/glibc/glibc-9999.ebuild#n1202 As a workaround you can rebuild cross-musl package with FEATURES=nostrip to get working objects. was this fixed in musl-1.2.0? If you see no activity in the bug and no equivalent of: # Avoid stripping binaries not targeted by ${CHOST}. Or else # ${CHOST}-strip would break binaries build for ${CTARGET}. is_crosscompile && dostrip -x / in the ebuild then probably not. Especially given that ebuild is EAPI=6. Wed May 20 19:19 anarchy@bull ~ $ file HelloWorld HelloWorld: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, not stripped Wed May 20 19:20 anarchy@bull ~ $ rm HelloWorld Wed May 20 19:20 anarchy@bull ~ $ aarch64-gentoo-linux-musl-gcc -static -o HelloWorld HelloWorld.c Wed May 20 19:20 anarchy@bull ~ $ file HelloWorld HelloWorld: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped I am unable to reproduce with aarch64, I will test with my armv7a toolchain and see if I can duplicate this there. Wed May 20 19:48 anarchy@bull ~ $ armv7a-gentoo-linux-musleabihf-gcc -static -o HelloWorld-Static HelloWorld.c Wed May 20 19:48 anarchy@bull ~ $ armv7a-gentoo-linux-musleabihf-gcc -o HelloWorld HelloWorld.c Wed May 20 19:48 anarchy@bull ~ $ file HelloWorld* HelloWorld: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-armhf.so.1, not stripped HelloWorld-Static: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped Please crossdev -C armv7el-unknown-linux-musleabihf start fresh and test again. I am unable to duplicate even with the armv7a cross toolchain. > /usr/libexec/gcc/armv7el-unknown-linux-musleabihf/ld: skipping incompatible
> /usr/armv7el-unknown-linux-musleabihf/usr/lib/libc.a when searching for -lc
Looks to me like a toolchain issue...
To be able to reproduce it you need your host binutils built with USE=-multitarget. # PORTDIR_OVERLAY=/co crossdev -oO /co -t armv7a-gentoo-linux-musleabihf * crossdev version: 20200125 * Host Portage ARCH: amd64 * Host Portage System: x86_64-pc-linux-gnu (i686-pc-linux-gnu x86_64-pc-linux-gnu) * Target Portage ARCH: arm * Target System: armv7a-gentoo-linux-musleabihf * Stage: 4 (C/C++ compiler) * USE=multilib: no * Target ABIs: default * binutils: binutils-[latest] * gcc: gcc-[latest] * headers: linux-headers-[latest] * libc: musl-[latest] * CROSSDEV_OVERLAY: /co * PORT_LOGDIR: /var/log/portage * PORTAGE_CONFIGROOT: / * Portage flags: * leaving sys-devel/binutils in /co * leaving sys-devel/gcc in /co * leaving sys-kernel/linux-headers in /co * leaving sys-libs/musl in /co * leaving sys-devel/gdb in /co * enabling thin-manifests due to /bound/portage The good hint is usually complains of binutils to try to strip it: # LANG=C PORTDIR_OVERLAY=/co emerge -v1 cross-armv7a-gentoo-linux-musleabihf/musl ... x86_64-pc-linux-gnu-strip: Unable to recognise the format of the input file `/var/tmp/portage/cross-armv7a-gentoo-linux-musleabihf/musl-1.2.0/image/usr/armv7a-gentoo-linux-musleabihf/usr/lib/libc.a(aio.lo)' x86_64-pc-linux-gnu-strip: Unable to recognise the format of the input file `/var/tmp/portage/cross-armv7a-gentoo-linux-musleabihf/musl-1.2.0/image/usr/armv7a-gentoo-linux-musleabihf/usr/lib/libc.a(aio_suspend.lo)' x86_64-pc-linux-gnu-strip: Unable to recognise the format of the input file `/var/tmp/portage/cross-armv7a-gentoo-linux-musleabihf/musl-1.2.0/image/usr/armv7a-gentoo-linux-musleabihf/usr/lib/libc.a(lio_listio.lo)' Wrong strip should never be ran on binaries it does not understand. https://bugs.gentoo.org/697428 was another instance of this bug. |