Merge pull request #147043 from arkivm/darwin-fixes-ocaml

ocaml: Fix aarch64-darwin build
This commit is contained in:
Domen Kožar 2021-11-23 10:11:10 +01:00 committed by GitHub
commit 1799f8e87b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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";