minimal-bootstrap: lots of updates (#448701)
This commit is contained in:
@@ -20,8 +20,8 @@ let
|
||||
};
|
||||
|
||||
# Thanks to the live-bootstrap project!
|
||||
# See https://github.com/fosslinux/live-bootstrap/blob/1bc4296091c51f53a5598050c8956d16e945b0f5/sysa/bash-2.05b/bash-2.05b.kaem
|
||||
liveBootstrap = "https://github.com/fosslinux/live-bootstrap/raw/1bc4296091c51f53a5598050c8956d16e945b0f5/sysa/bash-2.05b";
|
||||
# See https://github.com/fosslinux/live-bootstrap/blob/c0494d9af84b9e8c3e76e34c6e898978013a3b39/steps/bash-2.05b/pass1.kaem
|
||||
liveBootstrap = "https://github.com/fosslinux/live-bootstrap/raw/c0494d9af84b9e8c3e76e34c6e898978013a3b39/steps/bash-2.05b";
|
||||
|
||||
main_mk = fetchurl {
|
||||
url = "${liveBootstrap}/mk/main.mk";
|
||||
@@ -30,7 +30,7 @@ let
|
||||
|
||||
common_mk = fetchurl {
|
||||
url = "${liveBootstrap}/mk/common.mk";
|
||||
sha256 = "09rigxxf85p2ybnq248sai1gdx95yykc8jmwi4yjx389zh09mcr8";
|
||||
sha256 = "sha256-9BzUJPz6Vx+r69i2SQlqRTH9ihgLaUp1JSYGlTbWWu8=";
|
||||
};
|
||||
|
||||
builtins_mk = fetchurl {
|
||||
|
||||
@@ -28,7 +28,10 @@ let
|
||||
# musl 1.1.x doesn't use 64bit time_t
|
||||
"--disable-year2038"
|
||||
# libstdbuf.so fails in static builds
|
||||
"--enable-no-install-program=stdbuf"
|
||||
"--enable-no-install-program=stdbuf,arch,coreutils,hostname"
|
||||
# Disable PATH_MAX for better reproducibility
|
||||
"gl_cv_func_getcwd_path_max=\"no, but it is partly working\""
|
||||
"gl_cv_have_unlimited_file_name_length=no"
|
||||
];
|
||||
in
|
||||
bash.runCommand "${pname}-${version}"
|
||||
@@ -68,6 +71,7 @@ bash.runCommand "${pname}-${version}"
|
||||
# Configure
|
||||
export CC="tcc -B ${tinycc.libs}/lib"
|
||||
export LD=tcc
|
||||
export LDFLAGS="-L ./lib"
|
||||
bash ./configure ${lib.concatStringsSep " " configureFlags}
|
||||
|
||||
# Build
|
||||
|
||||
@@ -75,7 +75,7 @@ lib.makeScope
|
||||
|
||||
gawk-mes = callPackage ./gawk/mes.nix {
|
||||
bash = bash_2_05;
|
||||
tinycc = tinycc-mes;
|
||||
tinycc = tinycc-bootstrappable;
|
||||
gnused = gnused-mes;
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ lib.makeScope
|
||||
tinycc = tinycc-mes;
|
||||
};
|
||||
|
||||
gnumake = callPackage ./gnumake { tinycc = tinycc-mes; };
|
||||
gnumake = callPackage ./gnumake { tinycc = tinycc-bootstrappable; };
|
||||
|
||||
gnumake-musl = callPackage ./gnumake/musl.nix {
|
||||
bash = bash_2_05;
|
||||
@@ -141,7 +141,7 @@ lib.makeScope
|
||||
};
|
||||
gnused-mes = callPackage ./gnused/mes.nix {
|
||||
bash = bash_2_05;
|
||||
tinycc = tinycc-mes;
|
||||
tinycc = tinycc-bootstrappable;
|
||||
};
|
||||
|
||||
gnutar = callPackage ./gnutar/mes.nix {
|
||||
@@ -165,13 +165,13 @@ lib.makeScope
|
||||
|
||||
gzip = callPackage ./gzip {
|
||||
bash = bash_2_05;
|
||||
tinycc = tinycc-mes;
|
||||
tinycc = tinycc-bootstrappable;
|
||||
gnused = gnused-mes;
|
||||
};
|
||||
|
||||
heirloom = callPackage ./heirloom {
|
||||
bash = bash_2_05;
|
||||
tinycc = tinycc-mes;
|
||||
tinycc = tinycc-bootstrappable;
|
||||
};
|
||||
|
||||
heirloom-devtools = callPackage ./heirloom-devtools { tinycc = tinycc-mes; };
|
||||
|
||||
@@ -28,15 +28,6 @@ int mkstemp(char *t)
|
||||
return fd;
|
||||
}
|
||||
|
||||
int putenv(char *string)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* realpath (char* path, char* resolved) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define strncasecmp(a,b,n) strncmp(strupr(a),strupr(b),n)
|
||||
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
|
||||
let
|
||||
pname = "mes";
|
||||
version = "0.25";
|
||||
version = "0.27.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/mes/mes-${version}.tar.gz";
|
||||
hash = "sha256-MlJQs1Z+2SA7pwFhyDWvAQeec+vtl7S1u3fKUAuCiUA=";
|
||||
hash = "sha256-GDpA6kfqSfih470bnRLmdjdNZNY7x557wa59Zz398l0=";
|
||||
};
|
||||
|
||||
nyacc = callPackage ./nyacc.nix { inherit nyacc; };
|
||||
@@ -28,6 +28,7 @@ let
|
||||
'';
|
||||
|
||||
sources = (import ./sources.nix).x86.linux.mescc;
|
||||
|
||||
inherit (sources)
|
||||
libc_mini_SOURCES
|
||||
libmescc_SOURCES
|
||||
@@ -43,7 +44,9 @@ let
|
||||
homepage = "https://www.gnu.org/software/mes";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
teams = [ lib.teams.minimal-bootstrap ];
|
||||
platforms = [ "i686-linux" ];
|
||||
platforms = [
|
||||
"i686-linux"
|
||||
];
|
||||
};
|
||||
|
||||
srcPost =
|
||||
@@ -69,8 +72,9 @@ let
|
||||
cp ${config_h} include/mes/config.h
|
||||
|
||||
mkdir include/arch
|
||||
cp include/linux/x86/syscall.h include/arch/syscall.h
|
||||
cp include/linux/x86/kernel-stat.h include/arch/kernel-stat.h
|
||||
cp include/linux/x86/signal.h include/arch/signal.h
|
||||
cp include/linux/x86/syscall.h include/arch/syscall.h
|
||||
|
||||
# Remove pregenerated files
|
||||
rm mes/module/mes/psyntax.pp mes/module/mes/psyntax.pp.header
|
||||
@@ -81,9 +85,9 @@ let
|
||||
|
||||
# Remove environment impurities
|
||||
__GUILE_LOAD_PATH="\"''${MES_PREFIX}/mes/module:''${MES_PREFIX}/module:${nyacc.guilePath}\""
|
||||
boot0_scm=mes/module/mes/boot-0.scm
|
||||
guile_module_scm=mes/module/mes/guile-module.mes
|
||||
guile_mes=mes/module/mes/guile.mes
|
||||
replace --file ''${boot0_scm} --output ''${boot0_scm} --match-on "(getenv \"GUILE_LOAD_PATH\")" --replace-with ''${__GUILE_LOAD_PATH}
|
||||
replace --file ''${guile_module_scm} --output ''${guile_module_scm} --match-on "(getenv \"GUILE_LOAD_PATH\")" --replace-with ''${__GUILE_LOAD_PATH}
|
||||
replace --file ''${guile_mes} --output ''${guile_mes} --match-on "(getenv \"GUILE_LOAD_PATH\")" --replace-with ''${__GUILE_LOAD_PATH}
|
||||
|
||||
module_mescc_scm=module/mescc/mescc.scm
|
||||
@@ -127,7 +131,6 @@ let
|
||||
"-e"
|
||||
"main"
|
||||
"${srcPost.bin}/bin/mescc.scm"
|
||||
"--"
|
||||
"-D"
|
||||
"HAVE_CONFIG_H=1"
|
||||
"-I"
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
let
|
||||
pname = "nyacc";
|
||||
# NYACC is a tightly coupled dependency of mes. This version is known to work
|
||||
# with mes 0.25.
|
||||
# https://git.savannah.gnu.org/cgit/mes.git/tree/INSTALL?h=v0.25#n31
|
||||
version = "1.00.2";
|
||||
# with mes 0.27.1.
|
||||
# https://git.savannah.gnu.org/cgit/mes.git/tree/INSTALL?h=v0.27.1#n31
|
||||
version = "2.02.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://savannah/nyacc/nyacc-${version}.tar.gz";
|
||||
sha256 = "065ksalfllbdrzl12dz9d9dcxrv97wqxblslngsc6kajvnvlyvpk";
|
||||
hash = "sha256-aRpTcKU6c6Lc+onZL4EbPlZIOmf5IZnNAGGUTQRLAgU=";
|
||||
};
|
||||
in
|
||||
kaem.runCommand "${pname}-${version}"
|
||||
|
||||
@@ -55,6 +55,9 @@
|
||||
"lib/posix/write.c"
|
||||
"lib/stdlib/atoi.c"
|
||||
"lib/linux/lseek.c"
|
||||
"lib/dirent/__getdirentries.c"
|
||||
"lib/dirent/closedir.c"
|
||||
"lib/dirent/opendir.c"
|
||||
"lib/mes/__assert_fail.c"
|
||||
"lib/mes/__buffered_read.c"
|
||||
"lib/mes/__mes_debug.c"
|
||||
@@ -74,6 +77,7 @@
|
||||
"lib/stdio/putc.c"
|
||||
"lib/stdio/putchar.c"
|
||||
"lib/stdio/ungetc.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/free.c"
|
||||
"lib/stdlib/realloc.c"
|
||||
"lib/string/memchr.c"
|
||||
@@ -87,21 +91,39 @@
|
||||
"lib/posix/raise.c"
|
||||
"lib/linux/access.c"
|
||||
"lib/linux/brk.c"
|
||||
"lib/linux/chdir.c"
|
||||
"lib/linux/chmod.c"
|
||||
"lib/linux/clock_gettime.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/dup.c"
|
||||
"lib/linux/dup2.c"
|
||||
"lib/linux/execve.c"
|
||||
"lib/linux/fcntl.c"
|
||||
"lib/linux/fork.c"
|
||||
"lib/linux/fstat.c"
|
||||
"lib/linux/fsync.c"
|
||||
"lib/linux/_getcwd.c"
|
||||
"lib/linux/getdents.c"
|
||||
"lib/linux/gettimeofday.c"
|
||||
"lib/linux/ioctl3.c"
|
||||
"lib/linux/link.c"
|
||||
"lib/linux/lstat.c"
|
||||
"lib/linux/_open3.c"
|
||||
"lib/linux/malloc.c"
|
||||
"lib/linux/mkdir.c"
|
||||
"lib/linux/nanosleep.c"
|
||||
"lib/linux/pipe.c"
|
||||
"lib/linux/_read.c"
|
||||
"lib/linux/readdir.c"
|
||||
"lib/linux/rename.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
"lib/linux/symlink.c"
|
||||
"lib/linux/time.c"
|
||||
"lib/linux/umask.c"
|
||||
"lib/linux/uname.c"
|
||||
"lib/linux/unlink.c"
|
||||
"lib/linux/utimensat.c"
|
||||
"lib/linux/wait4.c"
|
||||
"lib/linux/waitpid.c"
|
||||
"lib/linux/x86-mes-mescc/syscall.c"
|
||||
@@ -142,6 +164,9 @@
|
||||
"lib/posix/write.c"
|
||||
"lib/stdlib/atoi.c"
|
||||
"lib/linux/lseek.c"
|
||||
"lib/dirent/__getdirentries.c"
|
||||
"lib/dirent/closedir.c"
|
||||
"lib/dirent/opendir.c"
|
||||
"lib/mes/__assert_fail.c"
|
||||
"lib/mes/__buffered_read.c"
|
||||
"lib/mes/__mes_debug.c"
|
||||
@@ -161,6 +186,7 @@
|
||||
"lib/stdio/putc.c"
|
||||
"lib/stdio/putchar.c"
|
||||
"lib/stdio/ungetc.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/free.c"
|
||||
"lib/stdlib/realloc.c"
|
||||
"lib/string/memchr.c"
|
||||
@@ -174,21 +200,39 @@
|
||||
"lib/posix/raise.c"
|
||||
"lib/linux/access.c"
|
||||
"lib/linux/brk.c"
|
||||
"lib/linux/chdir.c"
|
||||
"lib/linux/chmod.c"
|
||||
"lib/linux/clock_gettime.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/dup.c"
|
||||
"lib/linux/dup2.c"
|
||||
"lib/linux/execve.c"
|
||||
"lib/linux/fcntl.c"
|
||||
"lib/linux/fork.c"
|
||||
"lib/linux/fstat.c"
|
||||
"lib/linux/fsync.c"
|
||||
"lib/linux/_getcwd.c"
|
||||
"lib/linux/getdents.c"
|
||||
"lib/linux/gettimeofday.c"
|
||||
"lib/linux/ioctl3.c"
|
||||
"lib/linux/link.c"
|
||||
"lib/linux/lstat.c"
|
||||
"lib/linux/_open3.c"
|
||||
"lib/linux/malloc.c"
|
||||
"lib/linux/mkdir.c"
|
||||
"lib/linux/nanosleep.c"
|
||||
"lib/linux/pipe.c"
|
||||
"lib/linux/_read.c"
|
||||
"lib/linux/readdir.c"
|
||||
"lib/linux/rename.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
"lib/linux/symlink.c"
|
||||
"lib/linux/time.c"
|
||||
"lib/linux/umask.c"
|
||||
"lib/linux/uname.c"
|
||||
"lib/linux/unlink.c"
|
||||
"lib/linux/utimensat.c"
|
||||
"lib/linux/wait4.c"
|
||||
"lib/linux/waitpid.c"
|
||||
"lib/linux/x86-mes-mescc/syscall.c"
|
||||
@@ -222,7 +266,6 @@
|
||||
"lib/stdio/vsnprintf.c"
|
||||
"lib/stdio/vsprintf.c"
|
||||
"lib/stdio/vsscanf.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/qsort.c"
|
||||
"lib/stdlib/strtod.c"
|
||||
"lib/stdlib/strtof.c"
|
||||
@@ -243,11 +286,10 @@
|
||||
"lib/stub/ldexp.c"
|
||||
"lib/stub/mprotect.c"
|
||||
"lib/stub/localtime.c"
|
||||
"lib/stub/putenv.c"
|
||||
"lib/stub/realpath.c"
|
||||
"lib/stub/sigemptyset.c"
|
||||
"lib/x86-mes-mescc/setjmp.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
];
|
||||
libc_gnu_SOURCES = [
|
||||
"lib/mes/__init_io.c"
|
||||
@@ -283,6 +325,9 @@
|
||||
"lib/posix/write.c"
|
||||
"lib/stdlib/atoi.c"
|
||||
"lib/linux/lseek.c"
|
||||
"lib/dirent/__getdirentries.c"
|
||||
"lib/dirent/closedir.c"
|
||||
"lib/dirent/opendir.c"
|
||||
"lib/mes/__assert_fail.c"
|
||||
"lib/mes/__buffered_read.c"
|
||||
"lib/mes/__mes_debug.c"
|
||||
@@ -302,6 +347,7 @@
|
||||
"lib/stdio/putc.c"
|
||||
"lib/stdio/putchar.c"
|
||||
"lib/stdio/ungetc.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/free.c"
|
||||
"lib/stdlib/realloc.c"
|
||||
"lib/string/memchr.c"
|
||||
@@ -315,21 +361,39 @@
|
||||
"lib/posix/raise.c"
|
||||
"lib/linux/access.c"
|
||||
"lib/linux/brk.c"
|
||||
"lib/linux/chdir.c"
|
||||
"lib/linux/chmod.c"
|
||||
"lib/linux/clock_gettime.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/dup.c"
|
||||
"lib/linux/dup2.c"
|
||||
"lib/linux/execve.c"
|
||||
"lib/linux/fcntl.c"
|
||||
"lib/linux/fork.c"
|
||||
"lib/linux/fstat.c"
|
||||
"lib/linux/fsync.c"
|
||||
"lib/linux/_getcwd.c"
|
||||
"lib/linux/getdents.c"
|
||||
"lib/linux/gettimeofday.c"
|
||||
"lib/linux/ioctl3.c"
|
||||
"lib/linux/link.c"
|
||||
"lib/linux/lstat.c"
|
||||
"lib/linux/_open3.c"
|
||||
"lib/linux/malloc.c"
|
||||
"lib/linux/mkdir.c"
|
||||
"lib/linux/nanosleep.c"
|
||||
"lib/linux/pipe.c"
|
||||
"lib/linux/_read.c"
|
||||
"lib/linux/readdir.c"
|
||||
"lib/linux/rename.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
"lib/linux/symlink.c"
|
||||
"lib/linux/time.c"
|
||||
"lib/linux/umask.c"
|
||||
"lib/linux/uname.c"
|
||||
"lib/linux/unlink.c"
|
||||
"lib/linux/utimensat.c"
|
||||
"lib/linux/wait4.c"
|
||||
"lib/linux/waitpid.c"
|
||||
"lib/linux/x86-mes-mescc/syscall.c"
|
||||
@@ -363,7 +427,6 @@
|
||||
"lib/stdio/vsnprintf.c"
|
||||
"lib/stdio/vsprintf.c"
|
||||
"lib/stdio/vsscanf.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/qsort.c"
|
||||
"lib/stdlib/strtod.c"
|
||||
"lib/stdlib/strtof.c"
|
||||
@@ -384,11 +447,10 @@
|
||||
"lib/stub/ldexp.c"
|
||||
"lib/stub/mprotect.c"
|
||||
"lib/stub/localtime.c"
|
||||
"lib/stub/putenv.c"
|
||||
"lib/stub/realpath.c"
|
||||
"lib/stub/sigemptyset.c"
|
||||
"lib/x86-mes-mescc/setjmp.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
"lib/ctype/isalnum.c"
|
||||
"lib/ctype/isalpha.c"
|
||||
"lib/ctype/isascii.c"
|
||||
@@ -396,10 +458,6 @@
|
||||
"lib/ctype/isgraph.c"
|
||||
"lib/ctype/isprint.c"
|
||||
"lib/ctype/ispunct.c"
|
||||
"lib/dirent/__getdirentries.c"
|
||||
"lib/dirent/closedir.c"
|
||||
"lib/dirent/opendir.c"
|
||||
"lib/dirent/readdir.c"
|
||||
"lib/math/ceil.c"
|
||||
"lib/math/fabs.c"
|
||||
"lib/math/floor.c"
|
||||
@@ -408,6 +466,7 @@
|
||||
"lib/posix/execl.c"
|
||||
"lib/posix/execlp.c"
|
||||
"lib/posix/mktemp.c"
|
||||
"lib/posix/pathconf.c"
|
||||
"lib/posix/sbrk.c"
|
||||
"lib/posix/sleep.c"
|
||||
"lib/posix/unsetenv.c"
|
||||
@@ -479,12 +538,7 @@
|
||||
"lib/stub/system.c"
|
||||
"lib/stub/times.c"
|
||||
"lib/stub/ttyname.c"
|
||||
"lib/stub/umask.c"
|
||||
"lib/stub/utime.c"
|
||||
"lib/linux/chdir.c"
|
||||
"lib/linux/fcntl.c"
|
||||
"lib/linux/fstat.c"
|
||||
"lib/linux/getdents.c"
|
||||
"lib/linux/getegid.c"
|
||||
"lib/linux/geteuid.c"
|
||||
"lib/linux/getgid.c"
|
||||
@@ -492,20 +546,13 @@
|
||||
"lib/linux/getrusage.c"
|
||||
"lib/linux/getuid.c"
|
||||
"lib/linux/ioctl.c"
|
||||
"lib/linux/link.c"
|
||||
"lib/linux/lstat.c"
|
||||
"lib/linux/mkdir.c"
|
||||
"lib/linux/mknod.c"
|
||||
"lib/linux/nanosleep.c"
|
||||
"lib/linux/pipe.c"
|
||||
"lib/linux/readlink.c"
|
||||
"lib/linux/rename.c"
|
||||
"lib/linux/setgid.c"
|
||||
"lib/linux/settimer.c"
|
||||
"lib/linux/setuid.c"
|
||||
"lib/linux/signal.c"
|
||||
"lib/linux/sigprogmask.c"
|
||||
"lib/linux/symlink.c"
|
||||
];
|
||||
mes_SOURCES = [
|
||||
"src/builtins.c"
|
||||
@@ -526,6 +573,7 @@
|
||||
"src/string.c"
|
||||
"src/struct.c"
|
||||
"src/symbol.c"
|
||||
"src/variable.c"
|
||||
"src/vector.c"
|
||||
];
|
||||
};
|
||||
@@ -583,6 +631,9 @@
|
||||
"lib/posix/write.c"
|
||||
"lib/stdlib/atoi.c"
|
||||
"lib/linux/lseek.c"
|
||||
"lib/dirent/__getdirentries.c"
|
||||
"lib/dirent/closedir.c"
|
||||
"lib/dirent/opendir.c"
|
||||
"lib/mes/__assert_fail.c"
|
||||
"lib/mes/__buffered_read.c"
|
||||
"lib/mes/__mes_debug.c"
|
||||
@@ -602,6 +653,7 @@
|
||||
"lib/stdio/putc.c"
|
||||
"lib/stdio/putchar.c"
|
||||
"lib/stdio/ungetc.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/free.c"
|
||||
"lib/stdlib/realloc.c"
|
||||
"lib/string/memchr.c"
|
||||
@@ -615,21 +667,39 @@
|
||||
"lib/posix/raise.c"
|
||||
"lib/linux/access.c"
|
||||
"lib/linux/brk.c"
|
||||
"lib/linux/chdir.c"
|
||||
"lib/linux/chmod.c"
|
||||
"lib/linux/clock_gettime.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/dup.c"
|
||||
"lib/linux/dup2.c"
|
||||
"lib/linux/execve.c"
|
||||
"lib/linux/fcntl.c"
|
||||
"lib/linux/fork.c"
|
||||
"lib/linux/fstat.c"
|
||||
"lib/linux/fsync.c"
|
||||
"lib/linux/_getcwd.c"
|
||||
"lib/linux/getdents.c"
|
||||
"lib/linux/gettimeofday.c"
|
||||
"lib/linux/ioctl3.c"
|
||||
"lib/linux/link.c"
|
||||
"lib/linux/lstat.c"
|
||||
"lib/linux/_open3.c"
|
||||
"lib/linux/malloc.c"
|
||||
"lib/linux/mkdir.c"
|
||||
"lib/linux/nanosleep.c"
|
||||
"lib/linux/pipe.c"
|
||||
"lib/linux/_read.c"
|
||||
"lib/linux/readdir.c"
|
||||
"lib/linux/rename.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
"lib/linux/symlink.c"
|
||||
"lib/linux/time.c"
|
||||
"lib/linux/umask.c"
|
||||
"lib/linux/uname.c"
|
||||
"lib/linux/unlink.c"
|
||||
"lib/linux/utimensat.c"
|
||||
"lib/linux/wait4.c"
|
||||
"lib/linux/waitpid.c"
|
||||
"lib/linux/x86-mes-gcc/syscall.c"
|
||||
@@ -670,6 +740,9 @@
|
||||
"lib/posix/write.c"
|
||||
"lib/stdlib/atoi.c"
|
||||
"lib/linux/lseek.c"
|
||||
"lib/dirent/__getdirentries.c"
|
||||
"lib/dirent/closedir.c"
|
||||
"lib/dirent/opendir.c"
|
||||
"lib/mes/__assert_fail.c"
|
||||
"lib/mes/__buffered_read.c"
|
||||
"lib/mes/__mes_debug.c"
|
||||
@@ -689,6 +762,7 @@
|
||||
"lib/stdio/putc.c"
|
||||
"lib/stdio/putchar.c"
|
||||
"lib/stdio/ungetc.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/free.c"
|
||||
"lib/stdlib/realloc.c"
|
||||
"lib/string/memchr.c"
|
||||
@@ -702,21 +776,39 @@
|
||||
"lib/posix/raise.c"
|
||||
"lib/linux/access.c"
|
||||
"lib/linux/brk.c"
|
||||
"lib/linux/chdir.c"
|
||||
"lib/linux/chmod.c"
|
||||
"lib/linux/clock_gettime.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/dup.c"
|
||||
"lib/linux/dup2.c"
|
||||
"lib/linux/execve.c"
|
||||
"lib/linux/fcntl.c"
|
||||
"lib/linux/fork.c"
|
||||
"lib/linux/fstat.c"
|
||||
"lib/linux/fsync.c"
|
||||
"lib/linux/_getcwd.c"
|
||||
"lib/linux/getdents.c"
|
||||
"lib/linux/gettimeofday.c"
|
||||
"lib/linux/ioctl3.c"
|
||||
"lib/linux/link.c"
|
||||
"lib/linux/lstat.c"
|
||||
"lib/linux/_open3.c"
|
||||
"lib/linux/malloc.c"
|
||||
"lib/linux/mkdir.c"
|
||||
"lib/linux/nanosleep.c"
|
||||
"lib/linux/pipe.c"
|
||||
"lib/linux/_read.c"
|
||||
"lib/linux/readdir.c"
|
||||
"lib/linux/rename.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
"lib/linux/symlink.c"
|
||||
"lib/linux/time.c"
|
||||
"lib/linux/umask.c"
|
||||
"lib/linux/uname.c"
|
||||
"lib/linux/unlink.c"
|
||||
"lib/linux/utimensat.c"
|
||||
"lib/linux/wait4.c"
|
||||
"lib/linux/waitpid.c"
|
||||
"lib/linux/x86-mes-gcc/syscall.c"
|
||||
@@ -750,7 +842,6 @@
|
||||
"lib/stdio/vsnprintf.c"
|
||||
"lib/stdio/vsprintf.c"
|
||||
"lib/stdio/vsscanf.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/qsort.c"
|
||||
"lib/stdlib/strtod.c"
|
||||
"lib/stdlib/strtof.c"
|
||||
@@ -771,11 +862,10 @@
|
||||
"lib/stub/ldexp.c"
|
||||
"lib/stub/mprotect.c"
|
||||
"lib/stub/localtime.c"
|
||||
"lib/stub/putenv.c"
|
||||
"lib/stub/realpath.c"
|
||||
"lib/stub/sigemptyset.c"
|
||||
"lib/x86-mes-gcc/setjmp.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
];
|
||||
libc_gnu_SOURCES = [
|
||||
"lib/mes/__init_io.c"
|
||||
@@ -811,6 +901,9 @@
|
||||
"lib/posix/write.c"
|
||||
"lib/stdlib/atoi.c"
|
||||
"lib/linux/lseek.c"
|
||||
"lib/dirent/__getdirentries.c"
|
||||
"lib/dirent/closedir.c"
|
||||
"lib/dirent/opendir.c"
|
||||
"lib/mes/__assert_fail.c"
|
||||
"lib/mes/__buffered_read.c"
|
||||
"lib/mes/__mes_debug.c"
|
||||
@@ -830,6 +923,7 @@
|
||||
"lib/stdio/putc.c"
|
||||
"lib/stdio/putchar.c"
|
||||
"lib/stdio/ungetc.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/free.c"
|
||||
"lib/stdlib/realloc.c"
|
||||
"lib/string/memchr.c"
|
||||
@@ -843,21 +937,39 @@
|
||||
"lib/posix/raise.c"
|
||||
"lib/linux/access.c"
|
||||
"lib/linux/brk.c"
|
||||
"lib/linux/chdir.c"
|
||||
"lib/linux/chmod.c"
|
||||
"lib/linux/clock_gettime.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/dup.c"
|
||||
"lib/linux/dup2.c"
|
||||
"lib/linux/execve.c"
|
||||
"lib/linux/fcntl.c"
|
||||
"lib/linux/fork.c"
|
||||
"lib/linux/fstat.c"
|
||||
"lib/linux/fsync.c"
|
||||
"lib/linux/_getcwd.c"
|
||||
"lib/linux/getdents.c"
|
||||
"lib/linux/gettimeofday.c"
|
||||
"lib/linux/ioctl3.c"
|
||||
"lib/linux/link.c"
|
||||
"lib/linux/lstat.c"
|
||||
"lib/linux/_open3.c"
|
||||
"lib/linux/malloc.c"
|
||||
"lib/linux/mkdir.c"
|
||||
"lib/linux/nanosleep.c"
|
||||
"lib/linux/pipe.c"
|
||||
"lib/linux/_read.c"
|
||||
"lib/linux/readdir.c"
|
||||
"lib/linux/rename.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
"lib/linux/symlink.c"
|
||||
"lib/linux/time.c"
|
||||
"lib/linux/umask.c"
|
||||
"lib/linux/uname.c"
|
||||
"lib/linux/unlink.c"
|
||||
"lib/linux/utimensat.c"
|
||||
"lib/linux/wait4.c"
|
||||
"lib/linux/waitpid.c"
|
||||
"lib/linux/x86-mes-gcc/syscall.c"
|
||||
@@ -891,7 +1003,6 @@
|
||||
"lib/stdio/vsnprintf.c"
|
||||
"lib/stdio/vsprintf.c"
|
||||
"lib/stdio/vsscanf.c"
|
||||
"lib/stdlib/calloc.c"
|
||||
"lib/stdlib/qsort.c"
|
||||
"lib/stdlib/strtod.c"
|
||||
"lib/stdlib/strtof.c"
|
||||
@@ -912,11 +1023,10 @@
|
||||
"lib/stub/ldexp.c"
|
||||
"lib/stub/mprotect.c"
|
||||
"lib/stub/localtime.c"
|
||||
"lib/stub/putenv.c"
|
||||
"lib/stub/realpath.c"
|
||||
"lib/stub/sigemptyset.c"
|
||||
"lib/x86-mes-gcc/setjmp.c"
|
||||
"lib/linux/close.c"
|
||||
"lib/linux/rmdir.c"
|
||||
"lib/linux/stat.c"
|
||||
"lib/ctype/isalnum.c"
|
||||
"lib/ctype/isalpha.c"
|
||||
"lib/ctype/isascii.c"
|
||||
@@ -924,10 +1034,6 @@
|
||||
"lib/ctype/isgraph.c"
|
||||
"lib/ctype/isprint.c"
|
||||
"lib/ctype/ispunct.c"
|
||||
"lib/dirent/__getdirentries.c"
|
||||
"lib/dirent/closedir.c"
|
||||
"lib/dirent/opendir.c"
|
||||
"lib/dirent/readdir.c"
|
||||
"lib/math/ceil.c"
|
||||
"lib/math/fabs.c"
|
||||
"lib/math/floor.c"
|
||||
@@ -936,6 +1042,7 @@
|
||||
"lib/posix/execl.c"
|
||||
"lib/posix/execlp.c"
|
||||
"lib/posix/mktemp.c"
|
||||
"lib/posix/pathconf.c"
|
||||
"lib/posix/sbrk.c"
|
||||
"lib/posix/sleep.c"
|
||||
"lib/posix/unsetenv.c"
|
||||
@@ -1007,12 +1114,7 @@
|
||||
"lib/stub/system.c"
|
||||
"lib/stub/times.c"
|
||||
"lib/stub/ttyname.c"
|
||||
"lib/stub/umask.c"
|
||||
"lib/stub/utime.c"
|
||||
"lib/linux/chdir.c"
|
||||
"lib/linux/fcntl.c"
|
||||
"lib/linux/fstat.c"
|
||||
"lib/linux/getdents.c"
|
||||
"lib/linux/getegid.c"
|
||||
"lib/linux/geteuid.c"
|
||||
"lib/linux/getgid.c"
|
||||
@@ -1020,20 +1122,13 @@
|
||||
"lib/linux/getrusage.c"
|
||||
"lib/linux/getuid.c"
|
||||
"lib/linux/ioctl.c"
|
||||
"lib/linux/link.c"
|
||||
"lib/linux/lstat.c"
|
||||
"lib/linux/mkdir.c"
|
||||
"lib/linux/mknod.c"
|
||||
"lib/linux/nanosleep.c"
|
||||
"lib/linux/pipe.c"
|
||||
"lib/linux/readlink.c"
|
||||
"lib/linux/rename.c"
|
||||
"lib/linux/setgid.c"
|
||||
"lib/linux/settimer.c"
|
||||
"lib/linux/setuid.c"
|
||||
"lib/linux/signal.c"
|
||||
"lib/linux/sigprogmask.c"
|
||||
"lib/linux/symlink.c"
|
||||
];
|
||||
mes_SOURCES = [
|
||||
"src/builtins.c"
|
||||
@@ -1054,6 +1149,7 @@
|
||||
"src/string.c"
|
||||
"src/struct.c"
|
||||
"src/symbol.c"
|
||||
"src/variable.c"
|
||||
"src/vector.c"
|
||||
];
|
||||
};
|
||||
|
||||
@@ -54,13 +54,10 @@ let
|
||||
url = "${liveBootstrap}/patches/sigsetjmp.patch";
|
||||
hash = "sha256-wd2Aev1zPJXy3q933aiup5p1IMKzVJBquAyl3gbK4PU=";
|
||||
})
|
||||
# FIXME: this patch causes the build to fail
|
||||
# (fetchurl {
|
||||
# url = "${liveBootstrap}/patches/stdio_flush_on_exit.patch";
|
||||
# hash = "sha256-/z5ze3h3QTysay8nRvyvwPv3pmTcKptdkBIaMCoeLDg=";
|
||||
# })
|
||||
# HACK: always flush stdio immediately
|
||||
./always-flush.patch
|
||||
# liveBootstrap/sysa/musl-1.1.24/patches/stdio_flush_on_exit.patch with forward declarations added
|
||||
# to avoid `error: implicit declaration of function '__stdio_exit'`
|
||||
# Required to fix buffered stdout being truncated on exit
|
||||
./stdio_flush_on_exit.patch
|
||||
(fetchurl {
|
||||
url = "${liveBootstrap}/patches/va_list.patch";
|
||||
hash = "sha256-UmcMIl+YCi3wIeVvjbsCyqFlkyYsM4ECNwTfXP+s7vg=";
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --git src/env/__libc_start_main.c src/env/__libc_start_main.c
|
||||
index 8fbe526..9476c22 100644
|
||||
--- src/env/__libc_start_main.c
|
||||
+++ src/env/__libc_start_main.c
|
||||
@@ -91,6 +91,7 @@ static int libc_start_main_stage2(int (*main)(int,char **,char **), int argc, ch
|
||||
__libc_start_init();
|
||||
|
||||
/* Pass control to the application */
|
||||
+ setbuf(stdout, NULL);
|
||||
exit(main(argc, argv, envp));
|
||||
return 0;
|
||||
}
|
||||
@@ -14,11 +14,11 @@
|
||||
}:
|
||||
let
|
||||
inherit (import ./common.nix { inherit lib; }) pname meta;
|
||||
version = "1.2.4";
|
||||
version = "1.2.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://musl.libc.org/releases/musl-${version}.tar.gz";
|
||||
hash = "sha256-ejXq4z1TcqfA2hGI3nmHJvaIJVE7euPr6XqqpSEU8Dk=";
|
||||
hash = "sha256-qaEYu+hNh2TaDqDSizqz+uhHf8fkCF2QECuFlvx8deQ=";
|
||||
};
|
||||
in
|
||||
bash.runCommand "${pname}-${version}"
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
Initial patch version retrieved from
|
||||
https://git.stikonas.eu/andrius/live-bootstrap/src/commit/cd361e63f77842d9780303d63382eb686843c76b/sysa/musl-1.1.24/patches/stdio_flush_on_exit.patch
|
||||
|
||||
SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
|
||||
SPDX-FileCopyrightText: 2025 Luna Nova <git@lunnova.dev>
|
||||
|
||||
SPDX-License-Identifier: MIT
|
||||
|
||||
Make sure real __stdio_exit() is called on exit and not the dummy
|
||||
noop versions. This fixes the issue of truncated output when redirecting
|
||||
output to a file or pipe. It also fixes truncated output on programs
|
||||
that forget to call fclose()
|
||||
|
||||
Adds forward declarations to avoid implicit declaration error.
|
||||
|
||||
diff --git a/src/exit/exit.c b/src/exit/exit.c
|
||||
index a6869b37..a4164682 100644
|
||||
--- src/exit/exit.c
|
||||
+++ src/exit/exit.c
|
||||
@@ -2,16 +2,10 @@
|
||||
#include <stdint.h>
|
||||
#include "libc.h"
|
||||
|
||||
-static void dummy()
|
||||
-{
|
||||
-}
|
||||
-
|
||||
-/* atexit.c and __stdio_exit.c override these. the latter is linked
|
||||
- * as a consequence of linking either __toread.c or __towrite.c. */
|
||||
-weak_alias(dummy, __funcs_on_exit);
|
||||
-weak_alias(dummy, __stdio_exit);
|
||||
-weak_alias(dummy, _fini);
|
||||
+void __funcs_on_exit(void);
|
||||
+void __stdio_exit(void);
|
||||
+void _fini(void);
|
||||
|
||||
extern weak hidden void (*const __fini_array_start)(void), (*const __fini_array_end)(void);
|
||||
|
||||
static void libc_exit_fini(void)
|
||||
diff --git a/src/internal/stdio_impl.h b/src/internal/stdio_impl.h
|
||||
index d7398f59..69141813 100644
|
||||
--- src/internal/stdio_impl.h
|
||||
+++ src/internal/stdio_impl.h
|
||||
@@ -47,9 +47,9 @@ struct _IO_FILE {
|
||||
struct __locale_struct *locale;
|
||||
};
|
||||
|
||||
-extern hidden FILE *volatile __stdin_used;
|
||||
-extern hidden FILE *volatile __stdout_used;
|
||||
-extern hidden FILE *volatile __stderr_used;
|
||||
+extern FILE *volatile __stdin_used;
|
||||
+extern FILE *volatile __stdout_used;
|
||||
+extern FILE *volatile __stderr_used;
|
||||
|
||||
hidden int __lockfile(FILE *);
|
||||
hidden void __unlockfile(FILE *);
|
||||
diff --git a/src/stdio/__stdio_exit.c b/src/stdio/__stdio_exit.c
|
||||
index a5e42c67..5947a141 100644
|
||||
--- src/stdio/__stdio_exit.c
|
||||
+++ src/stdio/__stdio_exit.c
|
||||
@@ -1,10 +1,5 @@
|
||||
#include "stdio_impl.h"
|
||||
|
||||
-static FILE *volatile dummy_file = 0;
|
||||
-weak_alias(dummy_file, __stdin_used);
|
||||
-weak_alias(dummy_file, __stdout_used);
|
||||
-weak_alias(dummy_file, __stderr_used);
|
||||
-
|
||||
static void close_file(FILE *f)
|
||||
{
|
||||
if (!f) return;
|
||||
@@ -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 =
|
||||
{
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
let
|
||||
inherit (callPackage ./common.nix { }) buildTinyccMes recompileLibc;
|
||||
|
||||
version = "unstable-2023-04-20";
|
||||
rev = "80114c4da6b17fbaabb399cc29f427e368309bc8";
|
||||
version = "unstable-2024-07-07";
|
||||
rev = "ea3900f6d5e71776c5cfabcabee317652e3a19ee";
|
||||
|
||||
tarball = fetchurl {
|
||||
url = "https://gitlab.com/janneke/tinycc/-/archive/${rev}/tinycc-${rev}.tar.gz";
|
||||
sha256 = "1a0cw9a62qc76qqn5sjmp3xrbbvsz2dxrw21lrnx9q0s74mwaxbq";
|
||||
sha256 = "sha256-16JBGJATAWP+lPylOi3+lojpdv0SR5pqyxOV2PiVx0A=";
|
||||
};
|
||||
src =
|
||||
(kaem.runCommand "tinycc-bootstrappable-${version}-source" { } ''
|
||||
@@ -67,6 +67,7 @@ let
|
||||
-o tcc.s \
|
||||
-I . \
|
||||
-D BOOTSTRAP=1 \
|
||||
-D HAVE_LONG_LONG=0 \
|
||||
-I ${src} \
|
||||
-D TCC_TARGET_I386=1 \
|
||||
-D inline= \
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
fetchurl,
|
||||
callPackage,
|
||||
bash,
|
||||
tinycc-bootstrappable,
|
||||
musl,
|
||||
@@ -12,7 +11,7 @@
|
||||
let
|
||||
pname = "tinycc-musl";
|
||||
# next commit introduces use of realpath (unsupported in mes-libc)
|
||||
version = "unstable-2023-07-10";
|
||||
version = "unstable-2023-07-31";
|
||||
rev = "fd6d2180c5c801bb0b4c5dde27d61503059fc97d";
|
||||
|
||||
src = fetchurl {
|
||||
|
||||
Reference in New Issue
Block a user