darwin.Libc: stop vendoring headers from other packages

A number of headers in Libc are being vendored from other packages.
Instead of copying them from an earlier Libc, Libsystem now sources them
from their respective packages (see below). This allows Libc_old to be
dropped and avoids any potential clashes when building Libsystem.

libmalloc:
* malloc/malloc.h

libplatform:
* setjmp.h
* ucontext.h
* libkern/OSAtomic.h
* libkern/OSCacheControl.h

libpthread:
* pthread*.h
* sched.h
* spawn.h

syslog (vendored because only one file is needed):
* asl.h

xnu:
* spawn.h (a different one from libpthread)
* libproc.h
This commit is contained in:
Randy Eckenrode 2023-06-12 09:13:47 -04:00
parent a255182f56
commit 23cb6c155b
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9
4 changed files with 1 additions and 43 deletions

View File

@ -1,13 +0,0 @@
{ appleDerivation', stdenvNoCC, ed, unifdef }:
appleDerivation' stdenvNoCC {
nativeBuildInputs = [ ed unifdef ];
installPhase = ''
export SRCROOT=$PWD
export DSTROOT=$out
export PUBLIC_HEADERS_FOLDER_PATH=include
export PRIVATE_HEADERS_FOLDER_PATH=include
bash xcodescripts/headers.sh
'';
}

View File

@ -1,4 +1,4 @@
{ appleDerivation', stdenvNoCC, ed, unifdef, Libc_old, Libc_10-9 }:
{ appleDerivation', stdenvNoCC, ed, unifdef, Libc_10-9 }:
appleDerivation' stdenvNoCC {
nativeBuildInputs = [ ed unifdef ];
@ -7,7 +7,6 @@ appleDerivation' stdenvNoCC {
./0001-Define-TARGET_OS_EMBEDDED-in-std-lib-io-if-not-defin.patch
];
# TODO: asl.h actually comes from syslog project now
installPhase = ''
export SRCROOT=$PWD
export DSTROOT=$out
@ -18,20 +17,6 @@ appleDerivation' stdenvNoCC {
cp ${./CrashReporterClient.h} $out/include/CrashReporterClient.h
cp ${Libc_10-9}/include/NSSystemDirectories.h $out/include
# Ugh Apple stopped releasing this stuff so we need an older one...
cp ${Libc_old}/include/spawn.h $out/include
cp ${Libc_old}/include/setjmp.h $out/include
cp ${Libc_old}/include/ucontext.h $out/include
cp ${Libc_old}/include/pthread*.h $out/include
cp ${Libc_old}/include/sched.h $out/include
cp -R ${Libc_old}/include/malloc $out/include
mkdir -p $out/include/libkern
cp ${Libc_old}/include/asl.h $out/include
cp ${Libc_old}/include/libproc.h $out/include
cp ${Libc_old}/include/libkern/OSAtomic.h $out/include/libkern
cp ${Libc_old}/include/libkern/OSCacheControl.h $out/include/libkern
'';
appleHeaders = builtins.readFile ./headers.txt;

View File

@ -21,7 +21,6 @@ arpa/inet.h
arpa/nameser_compat.h
arpa/telnet.h
arpa/tftp.h
asl.h
assert.h
bitstring.h
cpio.h
@ -49,12 +48,8 @@ langinfo.h
libc.h
libc_private.h
libgen.h
libkern/OSAtomic.h
libkern/OSCacheControl.h
libproc.h
limits.h
locale.h
malloc/malloc.h
memory.h
monetary.h
monitor.h
@ -72,24 +67,17 @@ protocols/routed.h
protocols/rwhod.h
protocols/talkd.h
protocols/timed.h
pthread.h
pthread_impl.h
pthread_spis.h
pthread_workqueue.h
ranlib.h
readpassphrase.h
regex.h
runetype.h
sched.h
search.h
secure/_common.h
secure/_stdio.h
secure/_string.h
semaphore.h
setjmp.h
sgtty.h
signal.h
spawn.h
stab.h
standards.h
stddef.h
@ -112,7 +100,6 @@ time.h
timeconv.h
ttyent.h
tzfile.h
ucontext.h
ulimit.h
unistd.h
util.h

View File

@ -266,7 +266,6 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // {
rev = "Libc-997.90.3";
hash = "sha256-B18RNO+Rai5XE52TKdJV7eknosTZ+bRERkiU12d/kPU=";
};
Libc_old = applePackage "Libc/825_40_1.nix" "osx-10.8.5" "sha256-JvPSY7FzraGpqF/jYLfhU2o/2195NuKrXsryYfVtx3s=" {};
};
libclosure = applePackage "libclosure" "osx-10.11.6" "sha256-L5rQ+UBpf3B+W1U+gZKk7fXulslHsc8lxnCsplV+nr0=" {};
libdispatch = applePackage "libdispatch" "osx-10.10.5" "sha256-jfAEk0OLrJa9AIZVikIoHomd+l+4rCfc320Xh50qK5M=" {};