freshBootstrapTools: unify glibc and musl into the same directory

CI required that I `nixfmt` them at the same time.
This commit is contained in:
Philip Taron
2024-07-27 19:44:59 -07:00
parent 0a8120ff7d
commit 052ecdbfae
8 changed files with 72 additions and 46 deletions
@@ -1,19 +0,0 @@
{ system, bootstrapFiles, extraAttrs }:
derivation ({
name = "bootstrap-tools";
builder = bootstrapFiles.busybox;
args = [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
tarball = bootstrapFiles.bootstrapTools;
inherit system;
# Needed by the GCC wrapper.
langC = true;
langCC = true;
isGNU = true;
hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" "trivialautovarinit" ];
} // extraAttrs)
@@ -1,24 +0,0 @@
{ system, bootstrapFiles, extraAttrs }:
derivation ({
name = "bootstrap-tools";
builder = bootstrapFiles.busybox;
args = [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
tarball = bootstrapFiles.bootstrapTools;
inherit system;
# Needed by the GCC wrapper.
langC = true;
langCC = true;
isGNU = true;
hardeningUnsupportedFlags = [
"fortify3"
"stackclashprotection"
"trivialautovarinit"
"zerocallusedregs"
];
} // extraAttrs)
@@ -0,0 +1,35 @@
{
system,
bootstrapFiles,
extraAttrs,
}:
derivation (
{
name = "bootstrap-tools";
builder = bootstrapFiles.busybox;
args = [
"ash"
"-e"
./glibc/unpack-bootstrap-tools.sh
];
tarball = bootstrapFiles.bootstrapTools;
inherit system;
# Needed by the GCC wrapper.
langC = true;
langCC = true;
isGNU = true;
hardeningUnsupportedFlags = [
"fortify3"
"stackclashprotection"
"trivialautovarinit"
"zerocallusedregs"
];
}
// extraAttrs
)
@@ -0,0 +1,34 @@
{
system,
bootstrapFiles,
extraAttrs,
}:
derivation (
{
name = "bootstrap-tools";
builder = bootstrapFiles.busybox;
args = [
"ash"
"-e"
./musl/unpack-bootstrap-tools.sh
];
tarball = bootstrapFiles.bootstrapTools;
inherit system;
# Needed by the GCC wrapper.
langC = true;
langCC = true;
isGNU = true;
hardeningUnsupportedFlags = [
"fortify3"
"zerocallusedregs"
"trivialautovarinit"
];
}
// extraAttrs
)
+1 -1
View File
@@ -139,7 +139,7 @@ let
# Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
bootstrapTools = (import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) {
bootstrapTools = (import (if localSystem.libc == "musl" then ./bootstrap-tools/musl.nix else ./bootstrap-tools/glibc.nix) {
inherit system bootstrapFiles;
extraAttrs = lib.optionalAttrs config.contentAddressedByDefault {
__contentAddressed = true;
+2 -2
View File
@@ -59,12 +59,12 @@ rec {
};
in
if (stdenv.hostPlatform.libc == "glibc") then
import ./bootstrap-tools {
import ./bootstrap-tools/glibc.nix {
inherit (stdenv.buildPlatform) system; # Used to determine where to build
inherit bootstrapFiles extraAttrs;
}
else if (stdenv.hostPlatform.libc == "musl") then
import ./bootstrap-tools-musl {
import ./bootstrap-tools/musl.nix {
inherit (stdenv.buildPlatform) system; # Used to determine where to build
inherit bootstrapFiles extraAttrs;
}