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.

authored by Stéphan Kochen and committed by toonn 6515b568 cd532f7b

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