libauto: remove

This commit is contained in:
Sigmanificient 2024-05-17 21:36:53 +02:00
parent 51cf5b747f
commit 5d4c768de0
5 changed files with 1 additions and 335 deletions

View File

@ -104,7 +104,6 @@ let
};
"osx-10.9.5" = {
launchd = "842.92.1";
libauto = "185.5";
Libc = "997.90.3"; # We use this, but not from here
Libsystem = "1197.1.1";
Security = "55471.14.18";
@ -259,7 +258,6 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // {
eap8021x = applePackage "eap8021x" "osx-10.11.6" "sha256-54P3+YhVhOanoZQoqswDnr/GbR/AdEERse135nyuIQo=" {};
IOKit = applePackage "IOKit" "osx-10.11.6" "" { inherit IOKitSrcs; };
launchd = applePackage "launchd" "osx-10.9.5" "sha256-dmV0UK7hG9wvTr+F4Z47nCFXcVZCV+cQ46WbE0DBtJs=" {};
libauto = applePackage "libauto" "osx-10.9.5" "sha256-GnRcKq8jRbEsI/PSDphwUjWtpEIEcnLlQL9yxYLgSsU=" {};
Libc = applePackage "Libc" "osx-10.12.6" "sha256-LSsL7S3KFgGU9qjK4atu/4wBh8ftgfsk6JOvg+ZTZOY=" {
Libc_10-9 = fetchFromGitHub {
owner = "apple-oss-distributions";

View File

@ -1,129 +0,0 @@
/*
* Generated by dtrace(1M).
*/
#ifndef _AUTO_DTRACE_H
#define _AUTO_DTRACE_H
#include <unistd.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GARBAGE_COLLECTION_STABILITY "___dtrace_stability$garbage_collection$v1$1_1_0_1_1_0_1_1_0_1_1_0_1_1_0"
#define GARBAGE_COLLECTION_TYPEDEFS "___dtrace_typedefs$garbage_collection$v2$6175746f5f636f6c6c656374696f6e5f70686173655f74$6175746f5f636f6c6c656374696f6e5f747970655f74$6d616c6c6f635f7a6f6e655f74"
#if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED
#define GARBAGE_COLLECTION_AUTO_BLOCK_LOST_THREAD_LOCALITY(arg0, arg1) \
do { \
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
__dtrace_probe$garbage_collection$auto_block_lost_thread_locality$v1$766f6964202a$75696e7436345f74(arg0, arg1); \
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
} while (0)
#define GARBAGE_COLLECTION_AUTO_BLOCK_LOST_THREAD_LOCALITY_ENABLED() \
({ int _r = __dtrace_isenabled$garbage_collection$auto_block_lost_thread_locality$v1(); \
__asm__ volatile(""); \
_r; })
#define GARBAGE_COLLECTION_AUTO_REFCOUNT_ONE_ALLOCATION(arg0) \
do { \
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
__dtrace_probe$garbage_collection$auto_refcount_one_allocation$v1$75696e7436345f74(arg0); \
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
} while (0)
#define GARBAGE_COLLECTION_AUTO_REFCOUNT_ONE_ALLOCATION_ENABLED() \
({ int _r = __dtrace_isenabled$garbage_collection$auto_refcount_one_allocation$v1(); \
__asm__ volatile(""); \
_r; })
#define GARBAGE_COLLECTION_COLLECTION_BEGIN(arg0, arg1) \
do { \
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
__dtrace_probe$garbage_collection$collection_begin$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f747970655f74(arg0, arg1); \
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
} while (0)
#define GARBAGE_COLLECTION_COLLECTION_BEGIN_ENABLED() \
({ int _r = __dtrace_isenabled$garbage_collection$collection_begin$v1(); \
__asm__ volatile(""); \
_r; })
#define GARBAGE_COLLECTION_COLLECTION_END(arg0, arg1, arg2, arg3, arg4) \
do { \
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
__dtrace_probe$garbage_collection$collection_end$v1$6d616c6c6f635f7a6f6e655f74202a$75696e7436345f74$75696e7436345f74$75696e7436345f74$75696e7436345f74(arg0, arg1, arg2, arg3, arg4); \
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
} while (0)
#define GARBAGE_COLLECTION_COLLECTION_END_ENABLED() \
({ int _r = __dtrace_isenabled$garbage_collection$collection_end$v1(); \
__asm__ volatile(""); \
_r; })
#define GARBAGE_COLLECTION_COLLECTION_PHASE_BEGIN(arg0, arg1) \
do { \
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
__dtrace_probe$garbage_collection$collection_phase_begin$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f70686173655f74(arg0, arg1); \
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
} while (0)
#define GARBAGE_COLLECTION_COLLECTION_PHASE_BEGIN_ENABLED() \
({ int _r = __dtrace_isenabled$garbage_collection$collection_phase_begin$v1(); \
__asm__ volatile(""); \
_r; })
#define GARBAGE_COLLECTION_COLLECTION_PHASE_END(arg0, arg1, arg2, arg3) \
do { \
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
__dtrace_probe$garbage_collection$collection_phase_end$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f70686173655f74$75696e7436345f74$75696e7436345f74(arg0, arg1, arg2, arg3); \
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
} while (0)
#define GARBAGE_COLLECTION_COLLECTION_PHASE_END_ENABLED() \
({ int _r = __dtrace_isenabled$garbage_collection$collection_phase_end$v1(); \
__asm__ volatile(""); \
_r; })
extern void __dtrace_probe$garbage_collection$auto_block_lost_thread_locality$v1$766f6964202a$75696e7436345f74(const void *, uint64_t);
extern int __dtrace_isenabled$garbage_collection$auto_block_lost_thread_locality$v1(void);
extern void __dtrace_probe$garbage_collection$auto_refcount_one_allocation$v1$75696e7436345f74(uint64_t);
extern int __dtrace_isenabled$garbage_collection$auto_refcount_one_allocation$v1(void);
extern void __dtrace_probe$garbage_collection$collection_begin$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f747970655f74(const malloc_zone_t *, auto_collection_type_t);
extern int __dtrace_isenabled$garbage_collection$collection_begin$v1(void);
extern void __dtrace_probe$garbage_collection$collection_end$v1$6d616c6c6f635f7a6f6e655f74202a$75696e7436345f74$75696e7436345f74$75696e7436345f74$75696e7436345f74(const malloc_zone_t *, uint64_t, uint64_t, uint64_t, uint64_t);
extern int __dtrace_isenabled$garbage_collection$collection_end$v1(void);
extern void __dtrace_probe$garbage_collection$collection_phase_begin$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f70686173655f74(const malloc_zone_t *, auto_collection_phase_t);
extern int __dtrace_isenabled$garbage_collection$collection_phase_begin$v1(void);
extern void __dtrace_probe$garbage_collection$collection_phase_end$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f70686173655f74$75696e7436345f74$75696e7436345f74(const malloc_zone_t *, auto_collection_phase_t, uint64_t, uint64_t);
extern int __dtrace_isenabled$garbage_collection$collection_phase_end$v1(void);
#else
#define GARBAGE_COLLECTION_AUTO_BLOCK_LOST_THREAD_LOCALITY(arg0, arg1) \
do { \
} while (0)
#define GARBAGE_COLLECTION_AUTO_BLOCK_LOST_THREAD_LOCALITY_ENABLED() (0)
#define GARBAGE_COLLECTION_AUTO_REFCOUNT_ONE_ALLOCATION(arg0) \
do { \
} while (0)
#define GARBAGE_COLLECTION_AUTO_REFCOUNT_ONE_ALLOCATION_ENABLED() (0)
#define GARBAGE_COLLECTION_COLLECTION_BEGIN(arg0, arg1) \
do { \
} while (0)
#define GARBAGE_COLLECTION_COLLECTION_BEGIN_ENABLED() (0)
#define GARBAGE_COLLECTION_COLLECTION_END(arg0, arg1, arg2, arg3, arg4) \
do { \
} while (0)
#define GARBAGE_COLLECTION_COLLECTION_END_ENABLED() (0)
#define GARBAGE_COLLECTION_COLLECTION_PHASE_BEGIN(arg0, arg1) \
do { \
} while (0)
#define GARBAGE_COLLECTION_COLLECTION_PHASE_BEGIN_ENABLED() (0)
#define GARBAGE_COLLECTION_COLLECTION_PHASE_END(arg0, arg1, arg2, arg3) \
do { \
} while (0)
#define GARBAGE_COLLECTION_COLLECTION_PHASE_END_ENABLED() (0)
#endif /* !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED */
#ifdef __cplusplus
}
#endif
#endif /* _AUTO_DTRACE_H */

View File

@ -1,86 +0,0 @@
{ lib, stdenv, appleDerivation, libdispatch, Libsystem }:
appleDerivation {
# these are included in the pure libc
buildInputs = lib.optionals stdenv.cc.nativeLibc [ libdispatch Libsystem ];
buildPhase = ''
cp ${./auto_dtrace.h} ./auto_dtrace.h
substituteInPlace ThreadLocalCollector.h --replace SubZone.h Subzone.h
substituteInPlace auto_zone.cpp \
--replace "#include <msgtracer_client.h>" ''$'#include <asl.h>\nstatic void msgtracer_log_with_keys(...) { };'
substituteInPlace Definitions.h \
--replace "#include <System/pthread_machdep.h>" "" \
--replace 'void * const, void * const' 'void * const, void *'
# getspecific_direct is more efficient, but this should be equivalent...
substituteInPlace Zone.h \
--replace "_pthread_getspecific_direct" "pthread_getspecific" \
--replace "_pthread_has_direct_tsd()" "0" \
--replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
--replace "__PTK_FRAMEWORK_GC_KEY1" "111" \
--replace "__PTK_FRAMEWORK_GC_KEY2" "112" \
--replace "__PTK_FRAMEWORK_GC_KEY3" "113" \
--replace "__PTK_FRAMEWORK_GC_KEY4" "114" \
--replace "__PTK_FRAMEWORK_GC_KEY5" "115" \
--replace "__PTK_FRAMEWORK_GC_KEY6" "116" \
--replace "__PTK_FRAMEWORK_GC_KEY7" "117" \
--replace "__PTK_FRAMEWORK_GC_KEY8" "118" \
--replace "__PTK_FRAMEWORK_GC_KEY9" "119"
substituteInPlace auto_zone.cpp \
--replace "__PTK_FRAMEWORK_GC_KEY9" "119" \
--replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
substituteInPlace Zone.cpp \
--replace "_pthread_getspecific_direct" "pthread_getspecific" \
--replace "__PTK_FRAMEWORK_GC_KEY9" "119" \
--replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
--replace "__PTK_LIBDISPATCH_KEY0" "20" \
--replace "struct auto_zone_cursor {" ''$'extern "C" int pthread_key_init_np(int, void (*)(void *));\nstruct auto_zone_cursor {'
substituteInPlace auto_impl_utilities.c \
--replace "# include <CrashReporterClient.h>" "void CRSetCrashLogMessage(void *msg) { };"
c++ -I. -O3 -c -Wno-c++11-extensions auto_zone.cpp
cc -I. -O3 -Iauto_tester -c auto_impl_utilities.c
c++ -I. -O3 -c auto_weak.cpp
c++ -I. -O3 -c Admin.cpp
c++ -I. -O3 -c Bitmap.cpp
c++ -I. -O3 -c Definitions.cpp
c++ -I. -O3 -c Environment.cpp
c++ -I. -O3 -c Large.cpp
c++ -I. -O3 -c Region.cpp
c++ -I. -O3 -c Subzone.cpp
c++ -I. -O3 -c WriteBarrier.cpp
c++ -I. -O3 -c Zone.cpp
c++ -I. -O3 -c Thread.cpp
c++ -I. -O3 -c InUseEnumerator.cpp
c++ -I. -O3 -c auto_gdb_interface.cpp
c++ -I. -O3 -c PointerHash.cpp
c++ -I. -O3 -c ThreadLocalCollector.cpp
c++ -I. -O3 -c ZoneDump.cpp
c++ -I. -O3 -c ZoneCollectors.cpp
c++ -I. -O3 -c SubzonePartition.cpp
c++ -I. -O3 -c ZoneCollectionChecking.cpp
c++ -I. -O3 -c ZoneCompaction.cpp
c++ -I. -O3 -c BlockRef.cpp
c++ -Wl,-no_dtrace_dof --stdlib=libc++ -dynamiclib -install_name $out/lib/libauto.dylib -o libauto.dylib *.o
'';
installPhase = ''
mkdir -p $out/lib $out/include
cp auto_zone.h auto_weak.h auto_tester/auto_tester.h auto_gdb_interface.h $out/include
cp libauto.dylib $out/lib
'';
meta = {
# libauto is only used by objc4/pure.nix , but objc4 is now using the impure approach, so we don't bother to fix this.
broken = true;
platforms = lib.platforms.darwin;
};
}

View File

@ -1,118 +0,0 @@
{ stdenv, fetchapplesource, libauto, launchd, libc_old, libunwind }:
stdenv.mkDerivation rec {
version = "551.1";
pname = "objc4";
src = fetchapplesource {
inherit version;
name = "objc4";
sha256 = "1jrdb6yyb5jwwj27c1r0nr2y2ihqjln8ynj61mpkvp144c1cm5bg";
};
patches = [ ./spinlocks.patch ];
buildInputs = [ libauto launchd libc_old libunwind ];
buildPhase = ''
cp ${./objc-probes.h} runtime/objc-probes.h
mkdir -p build/include/objc
cp runtime/hashtable.h build/include/objc/hashtable.h
cp runtime/OldClasses.subproj/List.h build/include/objc/List.h
cp runtime/hashtable2.h build/include/objc/hashtable2.h
cp runtime/message.h build/include/objc/message.h
cp runtime/objc-api.h build/include/objc/objc-api.h
cp runtime/objc-auto.h build/include/objc/objc-auto.h
cp runtime/objc-class.h build/include/objc/objc-class.h
cp runtime/objc-exception.h build/include/objc/objc-exception.h
cp runtime/objc-load.h build/include/objc/objc-load.h
cp runtime/objc-sync.h build/include/objc/objc-sync.h
cp runtime/objc.h build/include/objc/objc.h
cp runtime/objc-runtime.h build/include/objc/objc-runtime.h
cp runtime/Object.h build/include/objc/Object.h
cp runtime/Protocol.h build/include/objc/Protocol.h
cp runtime/runtime.h build/include/objc/runtime.h
cp runtime/NSObject.h build/include/objc/NSObject.h
cp runtime/NSObjCRuntime.h build/include/objc/NSObjCRuntime.h
# These would normally be in local/include but we don't do local, so they're
# going in with the others
cp runtime/maptable.h build/include/objc/maptable.h
cp runtime/objc-abi.h build/include/objc/objc-abi.h
cp runtime/objc-auto-dump.h build/include/objc/objc-auto-dump.h
cp runtime/objc-gdb.h build/include/objc/objc-gdb.h
cp runtime/objc-internal.h build/include/objc/objc-internal.h
cc -o markgc markgc.c
FLAGS="-Wno-deprecated-register -Wno-unknown-pragmas -Wno-deprecated-objc-isa-usage -Wno-invalid-offsetof -Wno-inline-new-delete -Wno-cast-of-sel-type -Iruntime -Ibuild/include -Iruntime/Accessors.subproj -D_LIBCPP_VISIBLE= -DOS_OBJECT_USE_OBJC=0 -DNDEBUG=1"
cc -std=gnu++11 $FLAGS -c runtime/hashtable2.mm
cc -std=gnu++11 $FLAGS -c runtime/maptable.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-auto.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-cache.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-class-old.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-class.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-errors.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-exception.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-file.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-initialize.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-layout.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-load.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-loadmethod.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-lockdebug.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-runtime-new.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-runtime-old.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-runtime.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-sel-set.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-sel.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-sync.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-typeencoding.mm
cc -std=gnu++11 $FLAGS -c runtime/Object.mm
cc -std=gnu++11 $FLAGS -c runtime/Protocol.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-references.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-os.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-auto-dump.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-file-old.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-block-trampolines.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-externalref.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-weak.mm
cc -std=gnu++11 $FLAGS -c runtime/NSObject.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-opt.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-cache-old.mm
cc -std=gnu++11 $FLAGS -c runtime/objc-sel-old.mm
cc -std=gnu++11 $FLAGS -c runtime/Accessors.subproj/objc-accessors.mm
cc $FLAGS -c runtime/objc-sel-table.s
cc $FLAGS -c runtime/OldClasses.subproj/List.m
cc $FLAGS -c runtime/Messengers.subproj/objc-msg-arm.s
cc $FLAGS -c runtime/Messengers.subproj/objc-msg-i386.s
cc $FLAGS -c runtime/Messengers.subproj/objc-msg-x86_64.s
cc $FLAGS -c runtime/Messengers.subproj/objc-msg-simulator-i386.s
cc $FLAGS -c runtime/a1a2-blocktramps-i386.s
cc $FLAGS -c runtime/a2a3-blocktramps-i386.s
cc $FLAGS -c runtime/a1a2-blocktramps-x86_64.s
cc $FLAGS -c runtime/a2a3-blocktramps-x86_64.s
cc $FLAGS -c runtime/a1a2-blocktramps-arm.s
cc $FLAGS -c runtime/a2a3-blocktramps-arm.s
c++ -Wl,-no_dtrace_dof --stdlib=libc++ -dynamiclib -lauto -install_name $out/lib/libobjc.dylib -o libobjc.dylib *.o
./markgc -p libobjc.dylib
'';
installPhase = ''
mkdir -p $out/include $out/lib
mv build/include/objc $out/include
mv libobjc.dylib $out/lib
'';
}

View File

@ -57,6 +57,7 @@ mapAliases ({
### L ###
libauto = throw "'darwin.libauto' has been removed, as it was broken and unmaintained"; # added 2024-05-10
libiconv = pkgs.libiconv; # 2024-03-27
### O ###