From 64a4e05f0d2932619fa8b4642d89ea97512771e8 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:17:40 +0100 Subject: [PATCH] ocaml: add unsafe string support --- pkgs/development/compilers/ocaml/generic.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index d3c15b8aa4e2..ea89458c078c 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -11,12 +11,14 @@ in , aflSupport ? false , flambdaSupport ? false , spaceTimeSupport ? false +, unsafeStringSupport ? false }: assert useX11 -> safeX11 stdenv; assert aflSupport -> lib.versionAtLeast version "4.05"; assert flambdaSupport -> lib.versionAtLeast version "4.03"; assert spaceTimeSupport -> lib.versionAtLeast version "4.04"; +assert unsafeStringSupport -> lib.versionAtLeast version "4.06" && lib.versionOlder version "5.0"; let src = args.src or (fetchurl { @@ -59,6 +61,10 @@ stdenv.mkDerivation (args // { ++ optional aflSupport (flags "--with-afl" "-afl-instrument") ++ optional flambdaSupport (flags "--enable-flambda" "-flambda") ++ optional spaceTimeSupport (flags "--enable-spacetime" "-spacetime") + ++ optionals unsafeStringSupport [ + "--disable-force-safe-string" + "DEFAULT_STRING=unsafe" + ] ++ optional (stdenv.hostPlatform.isStatic && (lib.versionOlder version "4.08")) "-no-shared-libs" ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && lib.versionOlder version "4.08") [ "-host ${stdenv.hostPlatform.config}"