diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index 1b6a3b56e622..c474a2e85f15 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -66,7 +66,8 @@ stdenv.mkDerivation (args // { dontAddStaticConfigureFlags = lib.versionOlder version "4.08"; configurePlatforms = lib.optionals (lib.versionAtLeast version "4.08") [ "host" "target" ]; # x86_64-unknown-linux-musl-ld: -r and -pie may not be used together - hardeningDisable = lib.optional (lib.versionAtLeast version "4.09" && stdenv.hostPlatform.isMusl) "pie"; + hardeningDisable = lib.optional (lib.versionAtLeast version "4.09" && stdenv.hostPlatform.isMusl) "pie" + ++ lib.optionals (args ? hardeningDisable) args.hardeningDisable; buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ]; buildInputs = optional (!lib.versionAtLeast version "4.07") ncurses