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