minimal-bootstrap.stage0-posix: 1.6.0 -> 1.9.1

Gives us smaller bootstrap tarballs, better M2-Planet, and more.
This commit is contained in:
dish
2025-08-29 20:51:37 -04:00
parent 5d6bdbddb4
commit 5d6cff8d64
8 changed files with 54 additions and 20 deletions
@@ -4,10 +4,10 @@
rec {
name = "stage0-posix-${version}-source";
version = "1.6.0";
version = "1.9.1";
rev = "Release_${version}";
outputHashAlgo = "sha256";
outputHash = "sha256-epUaShjKiAd749ICvc6rS6WhUkS8R4heKuPdwUjEtsQ=";
outputHash = "sha256-UNoyb2teqH26VM7YoOcazyqZ0AlDae045aWc31ZHFdw=";
/*
Since `make-minimal-bootstrap-sources` requires nixpkgs and nix it
@@ -12,16 +12,16 @@ let
hash =
{
"AArch64" = "sha256-XTPsoKeI6wTZAF0UwEJPzuHelWOJe//wXg4HYO0dEJo=";
"AMD64" = "sha256-RCgK9oZRDQUiWLVkcIBSR2HeoB+Bh0czthrpjFEkCaY=";
"x86" = "sha256-QU3RPGy51W7M2xnfFY1IqruKzusrSLU+L190ztN6JW8=";
"AMD64" = "sha256-DCzZduYrix9yOeJoem/Jhz/WDzAss7UWwjZbkXJq6Ms=";
"x86" = "sha256-DFmSpy4EYoKBSuPQRqtTsUfIUjlg794PnMrEg5stOFY=";
}
.${stage0Arch} or (throw "Unsupported system: ${hostPlatform.system}");
# Pinned from https://github.com/oriansj/stage0-posix/commit/3189b5f325b7ef8b88e3edec7c1cde4fce73c76c
# This 256 byte seed is the only pre-compiled binary in the bootstrap chain.
# Pinned from https://github.com/oriansj/stage0-posix/commit/45d90f5955b6907dc6cdea9ebafce558359edcd3
# This 181 byte seed is the only pre-compiled binary in the bootstrap chain.
hex0-seed = import <nix/fetchurl.nix> {
name = "hex0-seed";
url = "https://github.com/oriansj/bootstrap-seeds/raw/b1263ff14a17835f4d12539226208c426ced4fba/POSIX/${stage0Arch}/hex0-seed";
url = "https://github.com/oriansj/bootstrap-seeds/raw/cedec6b8066d1db229b6c77d42d120a23c6980ed/POSIX/${stage0Arch}/hex0-seed";
executable = true;
inherit hash;
};
@@ -40,15 +40,6 @@ fetchFromGitHub {
$out/M2-Planet/M2libc \
$out/mescc-tools/M2libc \
$out/mescc-tools-extra/M2libc
# aarch64: syscall: mkdir -> mkdirat
# https://github.com/oriansj/M2libc/pull/17
patch -Np1 -d $out/M2libc -i ${
(fetchpatch {
url = "https://github.com/oriansj/M2libc/commit/ff7c3023b3ab6cfcffc5364620b25f8d0279e96b.patch";
hash = "sha256-QAKddv4TixIQHpFa9SVu9fAkeKbzhQaxjaWzW2yJy7A=";
})
}
'';
meta = {
@@ -159,6 +159,7 @@ rec {
"${src}/M2-Planet/cc_reader.c"
"${src}/M2-Planet/cc_strings.c"
"${src}/M2-Planet/cc_types.c"
"${src}/M2-Planet/cc_emit.c"
"${src}/M2-Planet/cc_core.c"
"${src}/M2-Planet/cc_macro.c"
"${src}/M2-Planet/cc.c"
@@ -298,6 +299,8 @@ rec {
"-f"
"${m2libc}/stddef.h"
"-f"
"${m2libc}/sys/utsname.h"
"-f"
"${m2libc}/${m2libcArch}/linux/unistd.c"
"-f"
"${m2libc}/${m2libcArch}/linux/fcntl.c"
@@ -306,8 +309,12 @@ rec {
"-f"
"${m2libc}/${m2libcArch}/linux/sys/stat.c"
"-f"
"${m2libc}/ctype.c"
"-f"
"${m2libc}/stdlib.c"
"-f"
"${m2libc}/stdarg.h"
"-f"
"${m2libc}/stdio.h"
"-f"
"${m2libc}/stdio.c"
@@ -379,14 +386,20 @@ rec {
"-f"
"${m2libc}/stddef.h"
"-f"
"${m2libc}/sys/utsname.h"
"-f"
"${m2libc}/${m2libcArch}/linux/fcntl.c"
"-f"
"${m2libc}/fcntl.c"
"-f"
"${m2libc}/${m2libcArch}/linux/unistd.c"
"-f"
"${m2libc}/stdarg.h"
"-f"
"${m2libc}/string.c"
"-f"
"${m2libc}/ctype.c"
"-f"
"${m2libc}/stdlib.c"
"-f"
"${m2libc}/stdio.h"
@@ -456,6 +469,8 @@ rec {
"-f"
"${m2libc}/stddef.h"
"-f"
"${m2libc}/sys/utsname.h"
"-f"
"${m2libc}/${m2libcArch}/linux/unistd.c"
"-f"
"${m2libc}/${m2libcArch}/linux/fcntl.c"
@@ -464,8 +479,12 @@ rec {
"-f"
"${m2libc}/${m2libcArch}/linux/sys/stat.c"
"-f"
"${m2libc}/ctype.c"
"-f"
"${m2libc}/stdlib.c"
"-f"
"${m2libc}/stdarg.h"
"-f"
"${m2libc}/stdio.h"
"-f"
"${m2libc}/stdio.c"
@@ -537,7 +556,7 @@ rec {
"-f"
"${m2libc}/stddef.h"
"-f"
"${m2libc}/string.c"
"${m2libc}/sys/utsname.h"
"-f"
"${m2libc}/${m2libcArch}/linux/unistd.c"
"-f"
@@ -545,8 +564,14 @@ rec {
"-f"
"${m2libc}/fcntl.c"
"-f"
"${m2libc}/ctype.c"
"-f"
"${m2libc}/stdlib.c"
"-f"
"${m2libc}/string.c"
"-f"
"${m2libc}/stdarg.h"
"-f"
"${m2libc}/stdio.h"
"-f"
"${m2libc}/stdio.c"
@@ -1,5 +1,5 @@
# This is a modified version of mescc-tools-extra/mescc-tools-extra.kaem
# https://github.com/oriansj/mescc-tools-extra/blob/ec53af69d6d2119b47b369cd0ec37ac806e7ad60/mescc-tools-extra.kaem
# https://github.com/oriansj/mescc-tools-extra/blob/56e6b8df3e95f4bc04f8b420a4cd8c82c70b9efa/mescc-tools-extra.kaem
# - Paths to build inputs have been changed for nix
# - Added additional step to create $out directory
@@ -32,8 +32,10 @@ CC mkdir.c -o ${out}/bin/mkdir
CC untar.c -o ${out}/bin/untar
CC ungz.c -o ${out}/bin/ungz
CC unbz2.c -o ${out}/bin/unbz2
CC unxz.c -o ${out}/bin/unxz
CC catm.c -o ${out}/bin/catm
CC cp.c -o ${out}/bin/cp
CC chmod.c -o ${out}/bin/chmod
CC rm.c -o ${out}/bin/rm
CC replace.c -o ${out}/bin/replace
CC wrap.c -o ${out}/bin/wrap
@@ -1,5 +1,5 @@
# This is a modified version of stage0-posix/x86/mescc-tools-full-kaem.kaem
# https://github.com/oriansj/stage0-posix-x86/blob/56e6b8df3e95f4bc04f8b420a4cd8c82c70b9efa/mescc-tools-full-kaem.kaem
# https://github.com/oriansj/stage0-posix-x86/blob/3b9c2bb6d4155e4f2e5f642b5e0f59255dfc5934/mescc-tools-full-kaem.kaem
# - Paths to build inputs have been changed for nix
# Mes --- Maxwell Equations of Software
@@ -51,9 +51,12 @@ ${M2} --architecture ${m2libcArch} \
-f ${m2libc}/stddef.h \
-f ${m2libc}/${m2libcArch}/linux/fcntl.c \
-f ${m2libc}/fcntl.c \
-f ${m2libc}/sys/utsname.h \
-f ${m2libc}/${m2libcArch}/linux/unistd.c \
-f ${m2libc}/${m2libcArch}/linux/sys/stat.c \
-f ${m2libc}/ctype.c \
-f ${m2libc}/stdlib.c \
-f ${m2libc}/stdarg.h \
-f ${m2libc}/stdio.h \
-f ${m2libc}/stdio.c \
-f ${m2libc}/string.c \
@@ -95,8 +98,11 @@ ${M2} --architecture ${m2libcArch} \
-f ${m2libc}/stddef.h \
-f ${m2libc}/${m2libcArch}/linux/fcntl.c \
-f ${m2libc}/fcntl.c \
-f ${m2libc}/sys/utsname.h \
-f ${m2libc}/${m2libcArch}/linux/unistd.c \
-f ${m2libc}/ctype.c \
-f ${m2libc}/stdlib.c \
-f ${m2libc}/stdarg.h \
-f ${m2libc}/stdio.h \
-f ${m2libc}/stdio.c \
-f ${m2libc}/bootstrappable.c \
@@ -133,10 +139,13 @@ ${hex2} --architecture ${m2libcArch} \
${M2} --architecture ${m2libcArch} \
-f ${m2libc}/sys/types.h \
-f ${m2libc}/stddef.h \
-f ${m2libc}/sys/utsname.h \
-f ${m2libc}/${m2libcArch}/linux/unistd.c \
-f ${m2libc}/${m2libcArch}/linux/fcntl.c \
-f ${m2libc}/fcntl.c \
-f ${m2libc}/ctype.c \
-f ${m2libc}/stdlib.c \
-f ${m2libc}/stdarg.h \
-f ${m2libc}/stdio.h \
-f ${m2libc}/stdio.c \
-f ${m2libc}/bootstrappable.c \
@@ -168,10 +177,13 @@ ${hex2} --architecture ${m2libcArch} \
${M2} --architecture ${m2libcArch} \
-f ${m2libc}/sys/types.h \
-f ${m2libc}/stddef.h \
-f ${m2libc}/sys/utsname.h \
-f ${m2libc}/${m2libcArch}/linux/unistd.c \
-f ${m2libc}/${m2libcArch}/linux/fcntl.c \
-f ${m2libc}/fcntl.c \
-f ${m2libc}/ctype.c \
-f ${m2libc}/stdlib.c \
-f ${m2libc}/stdarg.h \
-f ${m2libc}/stdio.h \
-f ${m2libc}/stdio.c \
-f ${m2libc}/bootstrappable.c \
@@ -180,6 +192,7 @@ ${M2} --architecture ${m2libcArch} \
-f ${src}/M2-Planet/cc_reader.c \
-f ${src}/M2-Planet/cc_strings.c \
-f ${src}/M2-Planet/cc_types.c \
-f ${src}/M2-Planet/cc_emit.c \
-f ${src}/M2-Planet/cc_core.c \
-f ${src}/M2-Planet/cc_macro.c \
-f ${src}/M2-Planet/cc.c \
@@ -33,11 +33,14 @@ let
''${M2} --architecture ${m2libcArch} \
-f ''${m2libc}/sys/types.h \
-f ''${m2libc}/stddef.h \
-f ''${m2libc}/sys/utsname.h \
-f ''${m2libc}/${m2libcArch}/linux/fcntl.c \
-f ''${m2libc}/fcntl.c \
-f ''${m2libc}/${m2libcArch}/linux/unistd.c \
-f ''${m2libc}/${m2libcArch}/linux/sys/stat.c \
-f ''${m2libc}/ctype.c \
-f ''${m2libc}/stdlib.c \
-f ''${m2libc}/stdarg.h \
-f ''${m2libc}/stdio.h \
-f ''${m2libc}/stdio.c \
-f ''${m2libc}/string.c \
@@ -26,7 +26,7 @@ rec {
# Passed to M2-Mesoplanet as --operating-system
m2libcOS =
if hostPlatform.isLinux then "linux" else throw "Unsupported system: ${hostPlatform.system}";
if hostPlatform.isLinux then "Linux" else throw "Unsupported system: ${hostPlatform.system}";
baseAddress =
{