Gentoo Archives: gentoo-musl

From: Jens Staal <staal1978@×××××.com>
To: Luca Barbato <lu_zero@g.o>
Cc: "Michał Górny" <mgorny@g.o>, gentoo-musl <gentoo-musl@l.g.o>, llvm@g.o
Subject: [gentoo-musl] Re: Self-hosting Clang-based (libc++, musl libc) stage4
Date: Sun, 07 May 2017 18:30:34
Message-Id: 20170507182925.GA651@Krypton.localdomain
1 On Sun, May 07, 2017 at 02:08:03PM +0200, Luca Barbato wrote:
2 > On 5/7/17 11:19 AM, Jens Staal wrote:
3 > > On Sun, May 07, 2017 at 09:27:41AM +0200, Michał Górny wrote:
4 > >> On nie, 2017-05-07 at 08:05 +0200, Jens Staal wrote:
5 > >>> - it would be really cool if an "official" custom crt package for
6 > >>> llvm/clang could be in portage
7 > >>>
8 > >>
9 > >> This is something I really look forward to adding. Any suggestion on
10 > >> which crt implementation to use?
11 > >>
12 > >> I know that glibc provides crt1/i/n. Does musl provide them too, or does
13 > >> it need a more complete crt* set?
14 > >>
15 > >> --
16 > >> Best regards,
17 > >> Michał Górny
18 > >
19 > > musl itself does not provide crt* as far as I know, but I downloaded the
20 > > relevant files from ELLCC, which is a musl/libc++ LLVM/clang toolchain
21 > >
22 > > http://ellcc.org/viewvc/svn/ellcc/trunk/libecc/src/musl/crt/
23 > >
24 > > Those crt files originate from NetBSD and googling for crt
25 > > implementations often point to the NetBSD variants as drop-in
26 > > replacements of libgcc.
27 > >
28 > >
29 >
30 > IIRC during the GSoC the netbsd crt is the one that was used. I'd check
31 > how hard is to package it properly.
32 >
33 > lu
34
35 In principle not very hard at all, I just installed the .o files in
36 /usr/lib and it worked.
37 It might be interesting to put the crt* source files in a separate source
38 repository for making a new package.
39
40 For building and which files that are needed, see
41 /usr/local/hack/crt/build.sh in my stage4
42
43 In my case, I only used the files needed for amd64, but ELLCC supports
44 several architectures so a more properly layed out source with
45 architecture-dependent build system would definitely be possible.
46
47 An important difference with the ELLCC crt-files: I had to move
48 __dso_handle from crt1 to crtbegin in order to replace libgcc (no idea
49 why!).
50
51 PS.
52 If a self-hosting clang would evolve into a true alternative system
53 compiler for Gentoo, it would definitely be interesting to evolve
54 "gcc-config" to a more generic "compiler-config" that also would point
55 to LLVM/Clang installations
56 DS.