From 98cff3f44679665ce0d1da474865db10a1de1439 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 25 Jul 2017 14:25:37 -0400 Subject: [PATCH] darwin stdenv: Ensure libSystem reexports the right libraries The logic was made pure for the normal libSystem, but this change never made it to the bootstrap tools. Deduplication the logic as the comment suggests would have prevented this, but here's a stop-gap until we do so. --- pkgs/stdenv/darwin/default.nix | 2 ++ pkgs/stdenv/darwin/unpack-bootstrap-tools.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index e7ce04b0a14..cac33a1bebb 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -50,6 +50,8 @@ in rec { args = [ ./unpack-bootstrap-tools.sh ]; inherit (bootstrapFiles) mkdir bzip2 cpio tarball; + reexportedLibrariesFile = + ../../os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries; __sandboxProfile = binShClosure + libSystemProfile; }; diff --git a/pkgs/stdenv/darwin/unpack-bootstrap-tools.sh b/pkgs/stdenv/darwin/unpack-bootstrap-tools.sh index 66c4e9ebeda..0da80ec5ce5 100644 --- a/pkgs/stdenv/darwin/unpack-bootstrap-tools.sh +++ b/pkgs/stdenv/darwin/unpack-bootstrap-tools.sh @@ -26,7 +26,7 @@ install_name_tool \ $out/lib/system/libsystem_kernel.dylib # TODO: this logic basically duplicates similar logic in the Libsystem expression. Deduplicate them! -libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }') +libs=$(cat $reexportedLibrariesFile | grep -v '^#') for i in $libs; do if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then