From: Apple Date: Fri, 4 Sep 2015 17:19:29 +0000 (+0000) Subject: Libsystem-1225.1.1.tar.gz X-Git-Tag: os-x-1011^0 X-Git-Url: https://git.saurik.com/apple/libsystem.git/commitdiff_plain/9acf5127e3edce0130335ccab012d1c85c47efdd?ds=sidebyside Libsystem-1225.1.1.tar.gz --- diff --git a/Libsystem.xcconfig b/Libsystem.xcconfig index a1ddf29..e9f5bd2 100644 --- a/Libsystem.xcconfig +++ b/Libsystem.xcconfig @@ -1,12 +1,8 @@ #include "/Makefiles/CoreOS/Xcode/BSD.xcconfig" -#include "/AppleInternal/XcodeConfig/SimulatorSupport.xcconfig" - -// Set INSTALL_PATH[sdk=macosx*] when SimulatorSupport.xcconfig is unavailable -INSTALL_PATH[sdk=macosx*] = $(INSTALL_PATH_ACTUAL) BUILD_VARIANTS = normal debug -SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator iphoneosnano iphonesimulatornano -INSTALL_PATH_ACTUAL = /usr/lib +SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator +INSTALL_PATH = /usr/lib DYLIB_CURRENT_VERSION = $(CURRENT_VERSION_STRING_$(RC_XBS)) ORDER_FILE = $(SDKROOT)/$(APPLE_INTERNAL_DIR)/OrderFiles/libSystem.order ORDER_FILE[sdk=iphonesimulator*] = @@ -14,7 +10,7 @@ OTHER_CFLAGS = -include $(BUILT_PRODUCTS_DIR)/config.$(CURRENT_ARCH).$(CURRENT_V OTHER_LDFLAGS = -Wl,-search_paths_first -nodefaultlibs @$(BUILT_PRODUCTS_DIR)/linker_arguments.$(CURRENT_ARCH).$(CURRENT_VARIANT).txt LD_GENERATE_MAP_FILE = YES EXECUTABLE_PREFIX = lib -PRIVATE_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/local/include/os +PRIVATE_HEADERS_FOLDER_PATH = /usr/local/include/os LIBRARY_SEARCH_PATHS = $(SDKROOT)/usr/lib/system $(SDKROOT)/usr/local/lib/system GCC_NO_COMMON_BLOCKS = YES GCC_WARN_64_TO_32_BIT_CONVERSION = YES @@ -24,3 +20,7 @@ GCC_TREAT_WARNINGS_AS_ERRORS = YES GCC_WARN_UNUSED_VARIABLE = YES CURRENT_VERSION_STRING_ = 159 CURRENT_VERSION_STRING_YES = $(CURRENT_PROJECT_VERSION) +INFOPLIST_INSTALL_PATH = Versions/B/Resources +INFOPLIST_INSTALL_PATH[sdk=iphoneos*] = +INFOPLIST_INSTALL_PATH[sdk=*simulator*] = +INFOPLIST_INSTALL_PATH[sdk=watchos*] = diff --git a/Libsystem.xcodeproj/project.pbxproj b/Libsystem.xcodeproj/project.pbxproj index c3ba59d..ab049ea 100644 --- a/Libsystem.xcodeproj/project.pbxproj +++ b/Libsystem.xcodeproj/project.pbxproj @@ -62,7 +62,7 @@ BA2BD8FF136D27FE00FF78C0 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; - dstPath = "$(INSTALL_PATH_PREFIX)/System/Library/Frameworks/System.framework/Versions/B/Resources"; + dstPath = "$(INSTALL_PATH_PREFIX)/System/Library/Frameworks/System.framework/$(INFOPLIST_INSTALL_PATH)"; dstSubfolderSpec = 0; files = ( BA2BD900136D282200FF78C0 /* Info.plist in CopyFiles */, diff --git a/init.c b/init.c index e09c523..254815e 100644 --- a/init.c +++ b/init.c @@ -26,7 +26,7 @@ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ -#include // for TARGET_OS_EMBEDDED +#include // for TARGET_OS_* #include #include @@ -37,6 +37,8 @@ #include #include <_libkernel_init.h> // Must be after voucher_private.h +#include + // system library initialisers extern void mach_init(void); // from libsystem_kernel.dylib extern void __libplatform_init(void *future_use, const char *envp[], const char *apple[], const struct ProgramVars *vars); @@ -47,6 +49,7 @@ extern void _dyld_initializer(void); // from libdyld.dylib extern void libdispatch_init(void); // from libdispatch.dylib extern void _libxpc_initializer(void); // from libxpc.dylib extern void _libsecinit_initializer(void); // from libsecinit.dylib +extern void _libtrace_init(void); // from libsystem_trace.dylib // signal malloc stack logging that initialisation has finished @@ -66,6 +69,8 @@ extern void dispatch_atfork_prepare(void); extern void dispatch_atfork_parent(void); extern void dispatch_atfork_child(void); +extern void _libtrace_fork_child(void); + extern void _malloc_fork_prepare(void); extern void _malloc_fork_parent(void); extern void _malloc_fork_child(void); @@ -87,9 +92,8 @@ extern void _libcoreservices_fork_child(void); extern char *_dirhelper(int, char *, size_t); #endif -#if TARGET_IPHONE_SIMULATOR -// no-op _pthread_clear_qos_tsd in the simulator, as its an upcall from libsyscall -#define _pthread_clear_qos_tsd NULL +#if TARGET_OS_EMBEDDED && !TARGET_OS_WATCH && !__LP64__ +extern void _vminterpose_init(void); #endif // advance decls for below; @@ -146,21 +150,40 @@ libSystem_initializer(int argc, // TODO: Move __malloc_init before __libc_init after breaking malloc's upward link to Libc __malloc_init(apple); -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR /* */ __keymgr_initializer(); #endif _dyld_initializer(); + + libdispatch_init(); _libxpc_initializer(); -#if !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) +#if !(TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR) _libsecinit_initializer(); #endif __stack_logging_early_finished(); +#if TARGET_OS_EMBEDDED && !TARGET_OS_WATCH && !__LP64__ + _vminterpose_init(); +#endif + + _libtrace_init(); // must be initialized after dispatch + +#if !TARGET_OS_IPHONE + /* - Preserve the old behavior of apple[] for + * programs that haven't linked against newer SDK. + */ +#define APPLE0_PREFIX "executable_path=" + if (dyld_get_program_sdk_version() < DYLD_MACOSX_VERSION_10_11){ + if (strncmp(apple[0], APPLE0_PREFIX, strlen(APPLE0_PREFIX)) == 0){ + apple[0] = apple[0] + strlen(APPLE0_PREFIX); + } + } +#endif /* * C99 standard has the following in section 7.5(3): @@ -215,6 +238,7 @@ libSystem_atfork_child(void) _libSC_info_fork_child(); _pthread_fork_child_postinit(); + _libtrace_fork_child(); // no prep work required for the fork } /* diff --git a/optionallibs b/optionallibs index f7425cd..2885215 100644 --- a/optionallibs +++ b/optionallibs @@ -1,10 +1,12 @@ keymgr quarantine -system_coreservices system_sim_coreservices +system_containermanager +system_coreservices system_coretls system_network -system_secinit -system_stats -system_trace system_sim_trace system_networkextension +system_secinit +system_sim_trace +system_trace unc +vminterpose diff --git a/requiredlibs b/requiredlibs index 9fa7c33..55c06a9 100644 --- a/requiredlibs +++ b/requiredlibs @@ -1,25 +1,25 @@ -cache cache_sim +cache commonCrypto compiler_rt -copyfile copyfile_sim +copyfile corecrypto dispatch dyld -launch launch_sim -macho macho_sim -removefile removefile_sim -system_asl system_sim_asl -system_blocks system_sim_blocks -system_c system_sim_c -system_configuration system_sim_configuration -system_dnssd system_sim_dnssd -system_info system_sim_info +launch +macho +removefile +system_asl +system_blocks +system_c +system_configuration +system_dnssd +system_info system_kernel system_sim_kernel -system_m system_sim_m +system_m system_malloc -system_notify notify_sim +system_notify system_platform system_sim_platform system_pthread system_sim_pthread -system_sandbox system_sim_sandbox +system_sandbox unwind unwind_sim xpc diff --git a/xcodescripts/create_system_framework.sh b/xcodescripts/create_system_framework.sh index 968dc58..bbc17a9 100755 --- a/xcodescripts/create_system_framework.sh +++ b/xcodescripts/create_system_framework.sh @@ -13,24 +13,37 @@ VARIANTS="$5" FPATH="/System/Library/Frameworks/System.framework" +# System.framework on iOS needs to be a special snowflake. +# Other projects install headers into Versions/B/PrivateHeaders the sub-directories +# and symlinks still need to exist, even though they don't fit in flat bundles. mkdir -p "${DSTROOT}/${FPATH}" || exit 1 -ln -sf "Versions/Current/PrivateHeaders" "${DSTROOT}/${FPATH}/PrivateHeaders" || exit 1 -ln -sf "Versions/Current/Resources" "${DSTROOT}/${FPATH}/Resources" || exit 1 - mkdir -p "${DSTROOT}/${FPATH}/Versions" || exit 1 -ln -sf "B" "${DSTROOT}/${FPATH}/Versions/Current" || exit 1 mkdir -p "${DSTROOT}/${FPATH}/Versions/B" || exit 1 +ln -sf "B" "${DSTROOT}/${FPATH}/Versions/Current" || exit 1 +ln -sf "Versions/Current/PrivateHeaders" "${DSTROOT}/${FPATH}/PrivateHeaders" || exit 1 + +if [[ "${PLATFORM_NAME}" =~ macosx ]]; then + ln -sf "Versions/Current/Resources" "${DSTROOT}/${FPATH}/Resources" || exit 1 -for variant in ${VARIANTS}; do - suffix="" - if [ ${variant} != "normal" ]; then - suffix="_${variant}" - fi - ln -sf "Versions/Current/System${suffix}" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 + for variant in ${VARIANTS}; do + suffix="" + if [ ${variant} != "normal" ]; then + suffix="_${variant}" + fi + ln -sf "Versions/Current/System${suffix}" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 + ln -sf "../../../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1 + done +else + for variant in ${VARIANTS}; do + suffix="" + if [ ${variant} != "normal" ]; then + suffix="_${variant}" + fi - if [[ "${PLATFORM_NAME}" =~ simulator ]] ; then - ln -sf "../../../../../../usr/lib/libSystem${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1 - else - ln -sf "../../../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/Versions/B/System${suffix}" || exit 1 - fi -done + if [[ "${PLATFORM_NAME}" =~ simulator ]] ; then + ln -sf "../../../../usr/lib/libSystem${suffix}.dylib" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 + else + ln -sf "../../../../usr/lib/libSystem.B${suffix}.dylib" "${DSTROOT}/${FPATH}/System${suffix}" || exit 1 + fi + done +fi