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