1 # binfmt preserve-argv[0] wrapper
3 # More details in binfmt-p-wrapper.c
5 # The wrapper has to be static so LD_* environment variables
6 # cannot affect the execution of the wrapper itself.
8 { lib, stdenv, pkgsStatic, enableDebug ? false }:
12 pkgsStatic.stdenv.mkDerivation {
15 src = ./binfmt-p-wrapper.c;
24 $CC -o $out/bin/${name} -static -std=c99 -O2 \
25 -DTARGET_QEMU=\"${emulator}\" \
26 ${lib.optionalString enableDebug "-DDEBUG"} \