Gentoo Archives: gentoo-embedded

From: Jeremi Piotrowski <jeremi.piotrowski@×××××.com>
To: gentoo-embedded@l.g.o
Subject: Re: [gentoo-embedded] musl: static-linking fails with crossdev built toolchain
Date: Tue, 31 Oct 2017 13:36:30
Message-Id: 20171031133626.GA28605@gentoo-tp
In Reply to: Re: [gentoo-embedded] musl: static-linking fails with crossdev built toolchain by "Anthony G. Basile"
1 On Sat, Oct 28, 2017 at 01:17:57PM -0400, Anthony G. Basile wrote:
2 >
3 > I know its not what you are trying to do, but do you know if the
4 > stage3's in experitmental/arm/musl have the same problem?
5 >
6
7 I do not have the same issue with the stage3's in experimental/arm/musl -
8 those allow static linking without issues. But I debugged further and
9 found the issue: the ebuild uses the wrong strip command (host one) when
10 stripping the built cross-musl. This makes it bug #552616 and I should
11 have found it sooner because there are lots of messages like the following
12 in the build-log:
13
14 x86_64-pc-linux-gnu-strip: Unable to recognise the format of the input file `/var/tmp/portage/cross-armv7a-hardfloat-linux-musleabi/musl-1.1.16/image/usr/armv7a-hardfloat-linux-musleabi/usr/lib/libc.a(cabs.o)'
15
16 For now I solved the issue with RESTRICT="strip" but manual stripping
17 similar to glibc probably should be added at some point.
18
19 There's also another issue with the ebuild and cross-compiling: the
20 getconf/getent/iconv tools get built before a libc is available and so
21 fail to compile. They shouldn't even be built when cross-compiling,
22 because there's a check in src_install to prevent them from being
23 installed. Below is my patch to the ebuild to make things work. Would be
24 nice to atleast get the src_compile() part commited.

Attachments

File name MIME type
musl-1.1.16.patch text/x-diff

Replies

Subject Author
Re: [gentoo-embedded] musl: static-linking fails with crossdev built toolchain "Anthony G. Basile" <basile@××××××××××.net>