Commit e5d1511d authored by Alyssa Ross's avatar Alyssa Ross
Browse files

lib.systems: allow specifying libc = null

It makes sense to allow platform definitions to opt out of having libc
at all.  One use case would be targetting some obscure new Linux
target that doesn't have a libc implementation yet, and another is
UEFI, which is basically libc-less Windows.

Not having libc is not commonly specified in (GNU) triples (even
Linux's build system will just target either -gnu or -musl depending
on the platform), so instead, we use a separate attribute for it.
parent 3e0cb1ab
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ rec {
        else if final.isFreeBSD             then "fblibc"
        else if final.isNetBSD              then "nblibc"
        else if final.isAvr                 then "avrlibc"
        else if final.isGhcjs               then null
        else if final.isNone                then "newlib"
        # TODO(@Ericson2314) think more about other operating systems
        else                                     "native/impure";
+2 −2
Original line number Diff line number Diff line
@@ -20400,7 +20400,8 @@ with pkgs;
  libcCrossChooser = name:
    # libc is hackily often used from the previous stage. This `or`
    # hack fixes the hack, *sigh*.
    /**/ if name == "glibc" then targetPackages.glibcCross or glibcCross
    /**/ if name == null then null
    else if name == "glibc" then targetPackages.glibcCross or glibcCross
    else if name == "bionic" then targetPackages.bionic or bionic
    else if name == "uclibc" then targetPackages.uclibcCross or uclibcCross
    else if name == "avrlibc" then targetPackages.avrlibcCross or avrlibcCross
@@ -20419,7 +20420,6 @@ with pkgs;
    else if name == "nblibc" then targetPackages.netbsdCross.libc or netbsdCross.libc
    else if name == "wasilibc" then targetPackages.wasilibc or wasilibc
    else if name == "relibc" then targetPackages.relibc or relibc
    else if stdenv.targetPlatform.isGhcjs then null
    else throw "Unknown libc ${name}";
  libcCross = assert stdenv.targetPlatform != stdenv.buildPlatform; libcCrossChooser stdenv.targetPlatform.libc;