Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 642612 - sys-libs/musl-1.1.18: cannot be built with crossdev under gentoo prefix
Summary: sys-libs/musl-1.1.18: cannot be built with crossdev under gentoo prefix
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-29 10:49 UTC by hanetzer
Modified: 2018-01-04 08:05 UTC (History)
2 users (show)

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


Attachments
sys-libs/musl-1.1.18-r1.ebuild (file_642612.txt,3.14 KB, text/plain)
2017-12-29 10:49 UTC, hanetzer
Details
sys-apps/musl-9999 patch (file_642612.txt,825 bytes, patch)
2017-12-29 10:50 UTC, hanetzer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description hanetzer 2017-12-29 10:49:14 UTC
Created attachment 511946 [details]
sys-libs/musl-1.1.18-r1.ebuild

A fairly simple bug; the ebuild does not respect EPREFIX, and as such will
not merge in a prefix because it installs files to locations outside of the
prefix (at least when using crossdev inside prefix itself; unsure about how
a rap style musl prefix will work, but that's another project for another
day)

Attached is musl-1.1.18-r1.ebuild which fixes the issue (and still works
with non-prefixed crossdev, will need testing as the main system's libc,
however), and a patch to musl-9999.ebuild with the same fix included.
Comment 1 hanetzer 2017-12-29 10:50:00 UTC
Created attachment 511948 [details, diff]
sys-apps/musl-9999 patch
Comment 2 hanetzer 2017-12-29 11:04:42 UTC
Alternatively, you can merge this pull request on our git mirror:
https://github.com/gentoo/gentoo/pull/6678
Comment 3 Sergei Trofimovich gentoo-dev 2017-12-29 15:52:05 UTC
The change looks good to me.
Comment 4 Larry the Git Cow gentoo-dev 2017-12-29 18:22:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fcf2e327095c1329a4044950cadfda036db8245

commit 0fcf2e327095c1329a4044950cadfda036db8245
Author:     Marty E. Plummer <hanetzer@protonmail.com>
AuthorDate: 2017-12-29 11:02:09 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2017-12-29 18:21:44 +0000

    sys-libs/musl: prefixify build
    
    Currently building a musl libc toolchain inside of gentoo prefix with
    crossdev will fail, due to installing files outside of the prefix. Added
    ${EPREFIX} and ${ED} where apropriate fixed this issue.
    
    Tested in a prefix with toolchain x86_64-gentoo-linux-musl, and tested on bare
    gentoo with x86_64-gentoo-linux-musl.
    
    Acked-by: blueness
    Package-Manager: Portage-2.3.19, Repoman-2.3.6
    Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
    
    Closes: https://bugs.gentoo.org/642612
    Closes: https://github.com/gentoo/gentoo/pull/6678

 sys-libs/musl/musl-1.1.18-r1.ebuild | 118 ++++++++++++++++++++++++++++++++++++
 sys-libs/musl/musl-9999.ebuild      |   4 +-
 2 files changed, 120 insertions(+), 2 deletions(-)
Comment 6 tt_1 2018-01-01 11:03:32 UTC
I'm very much interested into having a working arm cross compiler, so please ping me if you need cpu time on arm for testing this.
Comment 7 Anthony Basile gentoo-dev 2018-01-01 11:55:46 UTC
(In reply to tt_1 from comment #6)
> I'm very much interested into having a working arm cross compiler, so please
> ping me if you need cpu time on arm for testing this.

I'm not in principle opposed to this.  The first commit was innocent.  The second commit (presented on github) was no where tested enough.  Let me explain why I'm worried.  Certain operations in certain environments must be atomic.  Touching ldconfig in the way suggested may break during bootstrapping in a catalyst or GRS environment.  I'm willing to test at my end, but not in a piecemeal fashion.

Here's what I suggest: get an overlay read with *all* of the commits there.  When you feel its ready, I'll submit it to testing in various build environments at my end.

There is a further problem with this approach and that is that I plan to replace ldconfig (currenly a bash script) with a program written in C.  At that point, your approach will break.  You can cross that bridge when we get there.
Comment 8 hanetzer 2018-01-04 08:05:43 UTC
(In reply to Anthony Basile from comment #7)
> (In reply to tt_1 from comment #6)
> > I'm very much interested into having a working arm cross compiler, so please
> > ping me if you need cpu time on arm for testing this.
> 
> I'm not in principle opposed to this.  The first commit was innocent.  The
> second commit (presented on github) was no where tested enough.  Let me
> explain why I'm worried.  Certain operations in certain environments must be
> atomic.  Touching ldconfig in the way suggested may break during
> bootstrapping in a catalyst or GRS environment.  I'm willing to test at my
> end, but not in a piecemeal fashion.
> 
> Here's what I suggest: get an overlay read with *all* of the commits there. 
> When you feel its ready, I'll submit it to testing in various build
> environments at my end.
> 
> There is a further problem with this approach and that is that I plan to
> replace ldconfig (currenly a bash script) with a program written in C.  At
> that point, your approach will break.  You can cross that bridge when we get
> there.

Well, I did do some testing on baremetal (musl based chroot) and via crossdev
(glibc, main system) and prefix (glibc prefix on glibc root), plus work on
a musl prefix on baremetal musl (prior musl chroot).

Granted, I did not test catalyst, so that should be done.
https://github.com/hanetzer/musl-prefix is the work I've done so far on it, but
I really can't get the profiles to play nice from overlays.