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.
This commit is contained in:
John Ericson 2017-07-25 14:25:37 -04:00
parent 47821f1cf0
commit 98cff3f446
2 changed files with 3 additions and 1 deletions

View File

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

View File

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