]> git.saurik.com Git - apple/libc.git/blame - xcodescripts/libc.xcconfig
Libc-1044.40.1.tar.gz
[apple/libc.git] / xcodescripts / libc.xcconfig
CommitLineData
ad3c9f2a 1#include "<DEVELOPER_DIR>/Makefiles/CoreOS/Xcode/BSD.xcconfig"
23e20b00 2#include "<DEVELOPER_DIR>/AppleInternal/XcodeConfig/SimulatorSupport.xcconfig"
ad3c9f2a
A
3
4// Standard settings
23e20b00
A
5SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator iphoneosnano iphonesimulatornano
6SRCROOT_SEARCH_PATHS = $(SRCROOT) $(SRCROOT)/include $(SRCROOT)/gen $(SRCROOT)/locale $(SRCROOT)/locale/FreeBSD $(SRCROOT)/stdtime/FreeBSD $(SRCROOT)/darwin
ad3c9f2a 7SYSTEM_FRAMEWORK_HEADERS = $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
6465356a 8HEADER_SEARCH_PATHS = $($(TARGET_NAME)_SEARCH_PATHS) $(DERIVED_FILES_DIR)/dtrace $(SRCROOT_SEARCH_PATHS) $(SYSTEM_FRAMEWORK_HEADERS) $(SDKROOT)/usr/local/include $(inherited)
ad3c9f2a
A
9ALWAYS_SEARCH_USER_PATHS = YES
10USE_HEADERMAP = NO
11BUILD_VARIANTS = normal
12GCC_OPTIMIZATION_LEVEL = s
13GCC_C_LANGUAGE_STANDARD = gnu99
14GCC_ENABLE_OBJC_EXCEPTIONS = YES
15GCC_SYMBOLS_PRIVATE_EXTERN = NO
16GCC_DYNAMIC_NO_PIC = NO
17GCC_THUMB_SUPPORT = YES
6465356a
A
18GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
19GCC_WARN_UNINITIALIZED_AUTOS = YES;
20GCC_WARN_UNUSED_VARIABLE = YES;
21GCC_WARN_ABOUT_RETURN_TYPE = YES;
22WARNING_CFLAGS = "-Wall";
23
ad3c9f2a
A
24COPY_PHASE_STRIP = NO
25SKIP_INSTALL = YES
26INSTALLHDRS_SCRIPT_PHASE = YES
27VERSIONING_SYSTEM =
28COPY_PHASE_STRIP = NO
29STRIP_INSTALLED_PRODUCT = NO
30LD_DYLIB_INSTALL_NAME = /usr/lib/system/$(EXECUTABLE_NAME)
31
32BUILD_VARIANTS = normal debug
6465356a 33BUILD_ARCHIVES = Platform Base FreeBSD NetBSD TRE vCancelable vDarwinExtsn vDarwinExtsnCancelable vPre1050 vLegacy vInode32 FortifySource
ad3c9f2a 34
6465356a 35// clang is desired over llvm-gcc for OSAtomics. However, it isn't capable of building armv6 correctly.
ad3c9f2a
A
36GCC_VERSION = com.apple.compilers.llvm.clang.1_0
37GCC_VERSION[arch=armv6] = com.apple.compilers.llvmgcc42
38
39EXECUTABLE_PREFIX = libsystem_
23e20b00
A
40INSTALL_PATH_ACTUAL = /usr/lib/system
41INSTALL_PATH[sdk=macos*]=$(INSTALL_PATH_ACTUAL)
42PUBLIC_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/include
43PRIVATE_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/local/include
ad3c9f2a
A
44
45// Simulator
23e20b00 46EXECUTABLE_PREFIX[sdk=*simulator*] = libsystem_sim_
ad3c9f2a
A
47
48BASE_PREPROCESSOR_MACROS = __LIBC__ __DARWIN_UNIX03=1 __DARWIN_64_BIT_INO_T=1 __DARWIN_NON_CANCELABLE=1 __DARWIN_VERS_1050=1 _FORTIFY_SOURCE=0
6465356a 49OTHER_CFLAGS = -fdollars-in-identifiers -fno-common -fverbose-asm $($(TARGET_NAME)_CFLAGS) $(VARIANT_PREPROCESSOR_MACROS)
ad3c9f2a
A
50OTHER_CFLAGS_debug = -fstack-protector -fno-inline -O0 -DDEBUG=1
51
52GCC_PREPROCESSOR_DEFINITIONS = $(BASE_PREPROCESSOR_MACROS)
6465356a 53GCC_PREPROCESSOR_DEFINITIONS[sdk=iphone*] = $(BASE_PREPROCESSOR_MACROS) LIBC_NO_LIBCRASHREPORTERCLIENT=1
ad3c9f2a
A
54
55// libsystem_c.dylib linking
23e20b00 56CR_LDFLAGS = -lCrashReporterClient
ad3c9f2a 57LIBCOMPILER_RT_LDFLAGS = -lcompiler_rt
6465356a 58LIBMALLOC_LDFLAGS = -lsystem_malloc
6465356a 59LIBPLATFORM_LDFLAGS = -lsystem_platform
23e20b00 60LIBPLATFORM_LDFLAGS[sdk=*simulator*] = -lsystem_sim_platform
6465356a 61LIBPTHREAD_LDFLAGS = -lsystem_pthread
23e20b00 62LIBPTHREAD_LDFLAGS[sdk=*simulator*] = -lsystem_sim_pthread
6465356a 63LIBSYSCALL_LDFLAGS = -lsystem_kernel
23e20b00 64LIBSYSCALL_LDFLAGS[sdk=*simulator*] = -lsystem_sim_kernel
6465356a 65LIBM_LDFLAGS = -lsystem_m
23e20b00 66LIBM_LDFLAGS[sdk=*simulator*] = -lsystem_sim_m
6465356a 67LIBDYLD_LDFLAGS = -ldyld
23e20b00 68LIBSYSTEM_C_LDFLAGS = -all_load -nostdlib -L/usr/lib/system -umbrella System $(CR_LDFLAGS) $(LIBCOMPILER_RT_LDFLAGS) $(LIBDYLD_LDFLAGS) $(LIBSYSCALL_LDFLAGS) $(LIBM_LDFLAGS) $(LIBMALLOC_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBPTHREAD_LDFLAGS) $(UPWARD_LDFLAGS) -Wl,-interposable_list,$(DERIVED_FILES_DIR)/interposable.list -Wl,-unexported_symbols_list,$(DERIVED_FILES_DIR)/unexport.list -Wl,-alias_list,$(SRCROOT)/string/alias.list -Wl,-order_file,$(SRCROOT)/xcodescripts/Libc.order -Wl,-sectalign,__DATA,__data,1000 @$(BUILT_PRODUCTS_DIR)/$(CURRENT_VARIANT).linklist
6465356a
A
69
70// TODO: Remove upward links - mostly <rdar://problem/13183469>, macho is for assumes.c
71UPWARD_LDFLAGS = -Wl,-upward-ldispatch -Wl,-upward-llaunch -Wl,-upward-lmacho -Wl,-upward-lsystem_asl -Wl,-upward-lsystem_blocks -Wl,-upward-lsystem_info -Wl,-upward-lsystem_notify -Wl,-upward-lxpc
23e20b00 72UPWARD_LDFLAGS[sdk=*simulator*] = -Wl,-upward-ldispatch -Wl,-upward-lmacho_sim -Wl,-upward-lsystem_sim_asl -Wl,-upward-lsystem_sim_blocks -Wl,-upward-lsystem_sim_info -Wl,-upward-lnotify_sim -Wl,-upward-lxpc
ad3c9f2a
A
73
74// libPlatform.a architectures
75ARCH_FAMILY = $(ARCH_FAMILY_$(CURRENT_ARCH))
76ARCH_FAMILY_x86_64 = x86_64
77ARCH_FAMILY_i386 = i386
78ARCH_FAMILY_armv6 = arm
79ARCH_FAMILY_armv7 = arm
065eae9f 80ARCH_FAMILY_armv7s = arm
ad3c9f2a
A
81ARCH_FAMILY_armv7f = arm
82ARCH_FAMILY_armv7k = arm
83
6465356a
A
84// Platform target
85Platform_INCLUDED_SOURCE_FILE_NAMES = $(Platform_INCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME))
86Platform_INCLUDED_SOURCE_FILE_NAMES_macosx = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string) $(Platform_INCLUDED_SOURCE_FILE_NAMES_sys)
87Platform_INCLUDED_SOURCE_FILE_NAMES_iphoneos = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string) $(Platform_INCLUDED_SOURCE_FILE_NAMES_sys)
88Platform_INCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string)
23e20b00
A
89Platform_INCLUDED_SOURCE_FILE_NAMES_iphoneosnano = $(Platform_INCLUDED_SOURCE_FILE_NAMES_iphoneos)
90Platform_INCLUDED_SOURCE_FILE_NAMES_iphonesimulatornano = $(Platform_INCLUDED_SOURCE_FILE_NAMES_iphonesimulatornano)
6465356a
A
91
92Platform_INCLUDED_SOURCE_FILE_NAMES_gen = $(ARCH_FAMILY)/gen/*.c $(ARCH_FAMILY)/gen/*.s $(ARCH_FAMILY)/gen/*.S
93Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib = $(ARCH_FAMILY)/stdlib/*.c $(ARCH_FAMILY)/stdlib/*.s $(ARCH_FAMILY)/stdlib/*.S
94Platform_INCLUDED_SOURCE_FILE_NAMES_string = $(ARCH_FAMILY)/string/*.c $(ARCH_FAMILY)/string/*.s $(ARCH_FAMILY)/string/*.S
95Platform_INCLUDED_SOURCE_FILE_NAMES_sys = $(ARCH_FAMILY)/sys/*.c $(ARCH_FAMILY)/sys/*.s $(ARCH_FAMILY)/sys/*.S
96
ad3c9f2a
A
97// FreeBSD target
98FreeBSD_CFLAGS = -include $(SRCROOT)/fbsdcompat/_fbsd_compat_.h
99FreeBSD_SEARCH_PATHS = $(SRCROOT)/fbsdcompat $(SRCROOT)/gdtoa $(SRCROOT)/gdtoa/FreeBSD
100FreeBSD_EXCLUDED_SOURCE_GDTOA = gdtoa/FreeBSD/machdep* gdtoa-strtopx.c
101// Include the correct parts of gdtoa per-arch
102FreeBSD_INCLUDED_SOURCE_FILE_NAMES_x86_64 = gdtoa-strtopx.c machdep_ldisx.c
103FreeBSD_INCLUDED_SOURCE_FILE_NAMES_i386 = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_x86_64)
104FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7 = machdep_ldisd.c
065eae9f 105FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7s = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7)
ad3c9f2a
A
106FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7k = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7)
107FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7f = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7)
108FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv6 = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7)
109
ad3c9f2a
A
110// NetBSD target
111NetBSD_CFLAGS = -include $(SRCROOT)/nbsdcompat/_nbsd_compat_.h
112NetBSD_SEARCH_PATHS = $(SRCROOT)/nbsdcompat
113
114// TRE target
115TRE_CFLAGS = -DHAVE_CONFIG_H
116TRE_SEARCH_PATHS = $(SRCROOT)/regex/TRE $(SRCROOT)/regex/FreeBSD
117
118// Files per architecture to exclude from the non-platform builds (because optimised versions exist in Platform)
119BASE_EXCLUDED_SOURCE_FILE_NAMES = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_$(CURRENT_ARCH)) $(BASE_EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME))
6465356a
A
120BASE_EXCLUDED_SOURCE_FILE_NAMES_x86_64 = kvm.c nlist.c strcpy.c strlen.c strncpy.c strnlen.c
121BASE_EXCLUDED_SOURCE_FILE_NAMES_i386 = strcpy.c strlcat.c strlcpy.c strlen.c strncpy.c
122BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7 = strlen.c strnlen.c strstr.c
065eae9f 123BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7s = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7)
ad3c9f2a
A
124BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7k = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7)
125BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7f = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7)
126BASE_EXCLUDED_SOURCE_FILE_NAMES_armv6 = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7)
127
128// Rune support isn't included on iOS but there's no better way to exclude their complication
23e20b00 129BASE_EXCLUDED_SOURCE_FILE_NAMES_macosx = OSMemoryNotification.c
ad3c9f2a 130BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos = frune.c login.c logout.c mbrune.c runedepreciated.c setinvalidrune.c getmntinfo64.c
23e20b00
A
131BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos)
132BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneosnano = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos)
133BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulatornano = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator)
ad3c9f2a
A
134
135// <rdar://problem/9513665> - collate.c crashes llvm-gcc on armv6 with -Os + -gdwarf-2
136COLLATE_C_CFLAGS_macosx_armv6 = -O1
137
138// ARMv6 thumb doesn't support all the instructions needed for OSAtomics
139OSATOMIC_C_CFLAGS_macosx_armv6 = -mno-thumb
140OSATOMIC_C_CFLAGS_iphoneos_armv6 = -mno-thumb
6465356a
A
141
142// Make sure that OSAtomic isn't build unoptimised, otherwise the inlines
143// don't do what they are designed to do.
144OSATOMIC_C_CFLAGS = -Os -momit-leaf-frame-pointer $(OSATOMIC_C_CFLAGS_$(PLATFORM_NAME)_$(CURRENT_ARCH))