summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-01-11 15:09:34 -0600
committerWill Dietz <w@wdtz.org>2018-02-13 09:44:39 -0600
commit3ee5094934a99ad40712c2b38b7bd346a920ed14 (patch)
treefa2702fdcb964fc090641bcc6892d35ec8ad3438 /pkgs/stdenv
parente4d5928ba37c705cf2a1b5468f87725a2d5e1dfa (diff)
downloadnixpkgs-3ee5094934a99ad40712c2b38b7bd346a920ed14.tar
nixpkgs-3ee5094934a99ad40712c2b38b7bd346a920ed14.tar.gz
nixpkgs-3ee5094934a99ad40712c2b38b7bd346a920ed14.tar.bz2
nixpkgs-3ee5094934a99ad40712c2b38b7bd346a920ed14.tar.lz
nixpkgs-3ee5094934a99ad40712c2b38b7bd346a920ed14.tar.xz
nixpkgs-3ee5094934a99ad40712c2b38b7bd346a920ed14.tar.zst
nixpkgs-3ee5094934a99ad40712c2b38b7bd346a920ed14.zip
linux bootstrap for musl: kludgery
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/linux/bootstrap-tools-musl/default.nix2
-rw-r--r--pkgs/stdenv/linux/default.nix8
2 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/stdenv/linux/bootstrap-tools-musl/default.nix b/pkgs/stdenv/linux/bootstrap-tools-musl/default.nix
index fbadd447194..6118585d545 100644
--- a/pkgs/stdenv/linux/bootstrap-tools-musl/default.nix
+++ b/pkgs/stdenv/linux/bootstrap-tools-musl/default.nix
@@ -14,5 +14,5 @@ derivation {
   # Needed by the GCC wrapper.
   langC = true;
   langCC = true;
-  isGNU = false;
+  isGNU = true;
 }
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 858323e5cc5..603b8aeea8b 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -6,7 +6,8 @@
 { lib
 , localSystem, crossSystem, config, overlays
 
-, bootstrapFiles ? { # switch
+, bootstrapFiles ? if localSystem.libc == "musl" then import ./bootstrap-files/musl64.nix
+else { # switch
     "i686-linux" = import ./bootstrap-files/i686.nix;
     "x86_64-linux" = import ./bootstrap-files/x86_64.nix;
     "armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
@@ -40,7 +41,7 @@ let
 
 
   # Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
-  bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; };
+  bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) { inherit system bootstrapFiles; };
 
 
   # This function builds the various standard environments used during
@@ -140,7 +141,10 @@ in
         buildCommand = ''
           mkdir -p $out
           ln -s ${bootstrapTools}/lib $out/lib
+        '' + lib.optionalString (localSystem.libc == "glibc") ''
           ln -s ${bootstrapTools}/include-glibc $out/include
+        '' + lib.optionalString (localSystem.libc == "musl") ''
+          ln -s ${bootstrapTools}/include-libc $out/include
         '';
       };
       gcc-unwrapped = bootstrapTools;