Skip to content

Commit

Permalink
darwin stdenv: Ensure libSystem reexports the right libraries
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ericson2314 committed Jul 25, 2017
1 parent 47821f1 commit 98cff3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkgs/stdenv/darwin/default.nix
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/darwin/unpack-bootstrap-tools.sh
Expand Up @@ -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
Expand Down

0 comments on commit 98cff3f

Please sign in to comment.