diff --git a/pkgs/preinit/default.nix b/pkgs/preinit/default.nix index 4b5ef5c..232f2f4 100644 --- a/pkgs/preinit/default.nix +++ b/pkgs/preinit/default.nix @@ -13,12 +13,13 @@ stdenv.mkDerivation { name = "preinit"; src = ./.; - # NIX_DEBUG=2; +# NIX_DEBUG=2; hardeningDisable = [ "all" ]; - CFLAGS = "-Os -nostartfiles -nostdlib -fno-stack-protector -fpic -fPIC -I ./ -I ${kernel}/tools/include/nolibc"; + CFLAGS = "-Os -static -DPREINIT_USE_LIBC -fno-stack-protector -fpic -fPIC -I ./ -I ${kernel}/tools/include/nolibc"; postBuild = '' $STRIP --remove-section=.note --remove-section=.comment preinit + ls -l preinit ''; makeFlags = ["preinit"]; diff --git a/pkgs/preinit/preinit.c b/pkgs/preinit/preinit.c index 16f24b5..b34c95a 100644 --- a/pkgs/preinit/preinit.c +++ b/pkgs/preinit/preinit.c @@ -1,6 +1,7 @@ -#ifdef USE_LIBC +#ifdef PREINIT_USE_LIBC #include #include +#include #include #include #include