diff --git a/pkgs/by-name/to/toybox/package.nix b/pkgs/by-name/to/toybox/package.nix index e12d2f9edc98..84dde2316d7c 100644 --- a/pkgs/by-name/to/toybox/package.nix +++ b/pkgs/by-name/to/toybox/package.nix @@ -64,7 +64,19 @@ stdenv.mkDerivation rec { make oldconfig ''; - makeFlags = [ "PREFIX=$(out)/bin" ] ++ optionals enableStatic [ "LDFLAGS=--static" ]; + hardeningDisable = lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic) [ + # breaks string.h header in musl + "fortify" + ]; + + makeFlags = + [ + "PREFIX=$(out)/bin" + "CC=${stdenv.cc.targetPrefix}cc" + ] + ++ optionals (enableStatic && !stdenv.hostPlatform.isDarwin) [ + "LDFLAGS=--static" + ]; installTargets = [ "install_flat" ];