#include "<DEVELOPER_DIR>/Makefiles/CoreOS/Xcode/BSD.xcconfig"
-#include "<DEVELOPER_DIR>/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*] =
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
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*] =
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 */,
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
-#include <TargetConditionals.h> // for TARGET_OS_EMBEDDED
+#include <TargetConditionals.h> // for TARGET_OS_*
#include <stddef.h>
#include <stdlib.h>
#include <errno.h>
#include <_libkernel_init.h> // Must be after voucher_private.h
+#include <mach-o/dyld_priv.h>
+
// 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);
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
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);
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;
// 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
/* <rdar://problem/9664631> */
__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
+ /* <rdar://problem/22139800> - 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
/* <rdar://problem/11588042>
* C99 standard has the following in section 7.5(3):
_libSC_info_fork_child();
_pthread_fork_child_postinit();
+ _libtrace_fork_child(); // no prep work required for the fork
}
/*
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
-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
FPATH="/System/Library/Frameworks/System.framework"
+# <rdar://problem/21815807> 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