preinit: disable nolibc
- it stopped working with 22.11->23.05 - linking statically against musl is about 17k, so this is costing us 11k or so
This commit is contained in:
parent
d66f5901a2
commit
a7e7146887
2 changed files with 5 additions and 3 deletions
|
@ -13,12 +13,13 @@ stdenv.mkDerivation {
|
||||||
name = "preinit";
|
name = "preinit";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
# NIX_DEBUG=2;
|
# NIX_DEBUG=2;
|
||||||
hardeningDisable = [ "all" ];
|
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 = ''
|
postBuild = ''
|
||||||
$STRIP --remove-section=.note --remove-section=.comment preinit
|
$STRIP --remove-section=.note --remove-section=.comment preinit
|
||||||
|
ls -l preinit
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeFlags = ["preinit"];
|
makeFlags = ["preinit"];
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifdef USE_LIBC
|
#ifdef PREINIT_USE_LIBC
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
Loading…
Reference in a new issue