Announcement

Collapse
No announcement yet.

Gentoo stage4 with musl and libc++ (clang, no gcc)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gentoo stage4 with musl and libc++ (clang, no gcc)

    Hi
    I thought I could share this here too:
    https://archives.gentoo.org/gentoo-m...aeae48ec5b255c

    Basically started off from the musl libc stage3 vanilla gentoo image, re-bootstrapped the whole system to use clang and libc++ instead of gcc and libstdc++ (some very annoying circular dependencies to take care of). One annoying issue is that the llvm project does not provide crt{begin,end} which are needed to eliminate libgcc.

    My personal aim with this stage4 (run in chroot, not yet booting / self-hosting since I have not made a llvmlinux ebuild yet) is to replace as many things as possible in a gentoo base system with alternative implementations.

    Currently
    glibc-->musl (from the musl stage3)
    gcc(libstdc++) --> clang(libc++)
    openssl-->libressl
    readline-->libedit

    lld installed, but not sure if it is possible to use as standard linker yet
    lots of stuff TODO, but others might want to take this early result in different directions which is why I want to share it now already.

  • #2
    I just realized that I had to share the download url with the key
    https://mega.nz/#!g7oV2ZTA!Z3xWJwlsK...0M18ZIrpnaNf70

    I made that update as a reply to the mailing list (sha256sums in the original mail linked above), I also put it here.
    sorry about that

    Comment


    • #3
      The stage4 is now potentially self-hosting with llvm-patched linux!

      https://archives.gentoo.org/gentoo-m...07a036e86c33a5

      This means that it is possible to build a complete Gentoo system with only clang without any gcc.

      Comment


      • #4
        Thanks, downloaded it.

        Comment


        • #5
          Originally posted by aht0 View Post
          Thanks, downloaded it.
          Cool! Let me know what you think

          I have now also placed the crt* files needed to replace libgcc if one wants a self-hosting Clang system without gcc in a sepparate source repository:
          https://github.com/staalmannen/llvm-crt-replacement

          Also, a heads up / warning. I am running several parallel experiments in this image apart from replacing gcc with clang:

          * openssl replaced with libressl

          * readline replaced with libedit (bash had to be built with the built-in readline implementation)

          * nano --> vim : I also use vim as default pager (replaced "less") and manpager, w3m as html pager

          * several packages in "@system" (findutils, gawk, grep, iputils, man-db, psmisc, sed, wget, which) replaced with symlinks to busybox

          All of these changes are trivial to revert in order to build the system that you want
          Last edited by staalmannen; 05-09-2017, 03:17 AM.

          Comment


          • #6
            I have tried your stage4, but some packages complain for not having gcc-config saying could not run/locate 'x86_64-gentoo-linux-musl-gcc' and gcc-config -l says no active profile...

            linux-headers complain about it and many others... Is there any way to work around this?

            Comment


            • #7
              Someone followed up on this work and there is a new self-hosting system using only LLVM tools (clang, libc++, llvm-binutils)!

              https://www.reddit.com/r/Gentoo/comm...mental_stage4/

              Comment


              • #8
                Probably a more official announcement:
                https://archives.gentoo.org/gentoo-m...1a02d4be838ba0

                Comment

                Working...
                X