darwin.Libsystem: export _mach_init_routine
This commit is contained in:
parent
ef320da79c
commit
16a90832cd
@ -56,9 +56,8 @@ appleDerivation rec {
|
||||
# The startup object files
|
||||
cp ${Csu}/lib/* $out/lib
|
||||
|
||||
# Narrowly speaking, these would work if we re-exported libsystem_c and libsystem_kernel,
|
||||
# but we also need to run the original central libsystem constructor (which initializes
|
||||
# a ton of crap for its consitutent libraries) so we link against the central library here.
|
||||
# We can't re-exported libsystem_c and libsystem_kernel directly,
|
||||
# so we link against the central library here.
|
||||
mkdir -p $out/lib/system
|
||||
ld -macosx_version_min 10.7 -arch x86_64 -dylib \
|
||||
-o $out/lib/system/libsystem_c.dylib \
|
||||
@ -70,8 +69,14 @@ appleDerivation rec {
|
||||
/usr/lib/libSystem.dylib \
|
||||
-reexported_symbols_list ${./system_kernel_symbols}
|
||||
|
||||
libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }')
|
||||
# The umbrella libSystem also exports some symbols,
|
||||
# but we don't want to pull in everything from the other libraries.
|
||||
ld -macosx_version_min 10.7 -arch x86_64 -dylib \
|
||||
-o $out/lib/libSystem_internal.dylib \
|
||||
/usr/lib/libSystem.dylib \
|
||||
-reexported_symbols_list ${./system_symbols}
|
||||
|
||||
libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }')
|
||||
|
||||
for i in $libs; do
|
||||
if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then
|
||||
@ -79,14 +84,13 @@ appleDerivation rec {
|
||||
fi
|
||||
done
|
||||
|
||||
ld -macosx_version_min 10.7 \
|
||||
-arch x86_64 \
|
||||
-dylib \
|
||||
ld -macosx_version_min 10.7 -arch x86_64 -dylib \
|
||||
-o $out/lib/libSystem.B.dylib \
|
||||
-compatibility_version 1.0 \
|
||||
-current_version 1226.10.1 \
|
||||
-reexport_library $out/lib/system/libsystem_c.dylib \
|
||||
-reexport_library $out/lib/system/libsystem_kernel.dylib \
|
||||
-reexport_library $out/lib/libSystem_internal.dylib \
|
||||
$args
|
||||
|
||||
ln -s libSystem.B.dylib $out/lib/libSystem.dylib
|
||||
|
@ -0,0 +1 @@
|
||||
_mach_init_routine
|
Loading…
Reference in New Issue
Block a user