diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index 1b6a3b56e622..3aa90733a92d 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -64,7 +64,12 @@ stdenv.mkDerivation (args // { "-target ${stdenv.targetPlatform.config}" ]; dontAddStaticConfigureFlags = lib.versionOlder version "4.08"; - configurePlatforms = lib.optionals (lib.versionAtLeast version "4.08") [ "host" "target" ]; + + # on aarch64-darwin using --host and --target causes the build to invoke + # `aarch64-apple-darwin-clang` while using assembler. However, such binary + # does not exist. So, disable these configure flags on `aarch64-darwin`. + # See #144785 for details. + configurePlatforms = lib.optionals (lib.versionAtLeast version "4.08" && !(stdenv.isDarwin && stdenv.isAarch64)) [ "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";