summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmily Trau <emily@downunderctf.com>2023-09-21 22:06:58 -0700
committerEmily Trau <emily@downunderctf.com>2023-09-26 22:20:34 -0700
commit7287781fc337c5253e181dce38ebb1972ffa829b (patch)
tree104137627726e1aedca8ce918a9769931b285161
parentminimal-bootstrap.tinycc-musl: add alloca to libtcc1 (diff)
downloadnixpkgs-7287781fc337c5253e181dce38ebb1972ffa829b.tar.gz
minimal-bootstrap.musl11: always flush stdio
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/musl/1.1.nix2
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/musl/always-flush.patch12
2 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/musl/1.1.nix b/pkgs/os-specific/linux/minimal-bootstrap/musl/1.1.nix
index eceb9b72aeb6..704ee42edeb1 100644
--- a/pkgs/os-specific/linux/minimal-bootstrap/musl/1.1.nix
+++ b/pkgs/os-specific/linux/minimal-bootstrap/musl/1.1.nix
@@ -58,6 +58,8 @@ let
# url = "${liveBootstrap}/patches/stdio_flush_on_exit.patch";
# hash = "sha256-/z5ze3h3QTysay8nRvyvwPv3pmTcKptdkBIaMCoeLDg=";
# })
+ # HACK: always flush stdio immediately
+ ./always-flush.patch
(fetchurl {
url = "${liveBootstrap}/patches/va_list.patch";
hash = "sha256-UmcMIl+YCi3wIeVvjbsCyqFlkyYsM4ECNwTfXP+s7vg=";
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/musl/always-flush.patch b/pkgs/os-specific/linux/minimal-bootstrap/musl/always-flush.patch
new file mode 100644
index 000000000000..cdeddf962d9d
--- /dev/null
+++ b/pkgs/os-specific/linux/minimal-bootstrap/musl/always-flush.patch
@@ -0,0 +1,12 @@
+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;
+ }