From 3ee5094934a99ad40712c2b38b7bd346a920ed14 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 11 Jan 2018 15:09:34 -0600 Subject: [PATCH] linux bootstrap for musl: kludgery --- pkgs/stdenv/linux/bootstrap-tools-musl/default.nix | 2 +- pkgs/stdenv/linux/default.nix | 8 ++++++-- 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;