darwin.apple_sdk_11_0: use stdenv objc4

Stdenv on aarch64-darwin pulls in (bootstrap-stage4) objc4, unlike
x86_64. However derivations that otherwise depend on objc4 would use a
a different objc4 derivation on top of the final stdenv.

Because this library defines an LLVM module, having multiple instances
of it in the import path will interfere with builds.

Changed files
+8 -1
pkgs
os-specific
darwin
apple-sdk-11.0
stdenv
darwin
+3 -1
pkgs/os-specific/darwin/apple-sdk-11.0/default.nix
···
libcharset = callPackage ./libcharset.nix {};
libunwind = callPackage ./libunwind.nix {};
libnetwork = callPackage ./libnetwork.nix {};
-
objc4 = callPackage ./libobjc.nix {};
+
# Avoid introducing a new objc4 if stdenv already has one, to prevent
+
# conflicting LLVM modules.
+
objc4 = if stdenv ? objc4 then stdenv.objc4 else callPackage ./libobjc.nix {};
# questionable aliases
configd = pkgs.darwin.apple_sdk.frameworks.SystemConfiguration;
+5
pkgs/stdenv/darwin/default.nix
···
libc = pkgs.darwin.Libsystem;
shellPackage = pkgs.bash;
inherit bootstrapTools;
+
} // lib.optionalAttrs useAppleSDKLibs {
+
# This objc4 will be propagated to all builds using the final stdenv,
+
# and we shouldn't mix different builds, because they would be
+
# conflicting LLVM modules. Export it here so we can grab it later.
+
inherit (pkgs.darwin) objc4;
};
allowedRequisites = (with pkgs; [