Add noNakedPointer option to the ocaml package (#404668)

This commit is contained in:
Pierre Villemot 2025-05-07 08:40:24 +02:00 committed by GitHub
parent 40a6f04759
commit bb0ca5271d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,6 +30,7 @@ in
spaceTimeSupport ? false, spaceTimeSupport ? false,
unsafeStringSupport ? false, unsafeStringSupport ? false,
framePointerSupport ? false, framePointerSupport ? false,
noNakedPointers ? false,
}: }:
assert useX11 -> safeX11 stdenv; assert useX11 -> safeX11 stdenv;
@ -38,6 +39,7 @@ assert flambdaSupport -> lib.versionAtLeast version "4.03";
assert spaceTimeSupport -> lib.versionAtLeast version "4.04" && lib.versionOlder version "4.12"; assert spaceTimeSupport -> lib.versionAtLeast version "4.04" && lib.versionOlder version "4.12";
assert unsafeStringSupport -> lib.versionAtLeast version "4.06" && lib.versionOlder version "5.0"; assert unsafeStringSupport -> lib.versionAtLeast version "4.06" && lib.versionOlder version "5.0";
assert framePointerSupport -> lib.versionAtLeast version "4.01"; assert framePointerSupport -> lib.versionAtLeast version "4.01";
assert noNakedPointers -> lib.versionAtLeast version "4.02" && lib.versionOlder version "5.0";
let let
src = src =
@ -112,7 +114,8 @@ stdenv.mkDerivation (
++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && lib.versionOlder version "4.08") [ ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && lib.versionOlder version "4.08") [
"-host ${stdenv.hostPlatform.config}" "-host ${stdenv.hostPlatform.config}"
"-target ${stdenv.targetPlatform.config}" "-target ${stdenv.targetPlatform.config}"
]; ]
++ optional noNakedPointers (flags "--disable-naked-pointers" "-no-naked-pointers");
dontAddStaticConfigureFlags = lib.versionOlder version "4.08"; dontAddStaticConfigureFlags = lib.versionOlder version "4.08";
# on aarch64-darwin using --host and --target causes the build to invoke # on aarch64-darwin using --host and --target causes the build to invoke