]>
Commit | Line | Data |
---|---|---|
afef526e | 1 | #include "<DEVELOPER_DIR>/Makefiles/CoreOS/Xcode/BSD.xcconfig" |
2fbbb8fa | 2 | |
c06d156a A |
3 | // NO means only libSystem.B_asan.dylib will be ASanified. |
4 | // YES means even the normal variant, libSystem.B.dylib, will be ASanified. | |
421cd580 A |
5 | // |
6 | // XBS sets RC_SUPPORT_ADDRESS_SANITIZATION=1 to trigger the ASanified normal variant. | |
b8ce8438 A |
7 | ASAN_IN_NORMAL_VARIANT_DK_ = YES |
8 | ASAN_IN_NORMAL_VARIANT_DK_1 = NO | |
9 | ASAN_IN_NORMAL_VARIANT_RC_1 = $(ASAN_IN_NORMAL_VARIANT_DK_$(DRIVERKIT)) | |
10 | ASAN_IN_NORMAL_VARIANT_RC_ = NO | |
11 | ASAN_IN_NORMAL_VARIANT = $(ASAN_IN_NORMAL_VARIANT_RC_$(RC_SUPPORT_ADDRESS_SANITIZATION)) | |
c06d156a | 12 | |
3186893e A |
13 | // Apple Internal Sanitizer dylib path |
14 | SANITIZER_DYLIB_DIR = /usr/appleinternal/lib/sanitizers | |
15 | ||
a08f8358 A |
16 | ASAN_CFLAGS_NO = |
17 | ASAN_CFLAGS_YES = -DSUPPORT_ASAN=1 | |
18 | ASAN_LDFLAGS_NO = | |
3186893e | 19 | SHARED_ASAN_LDFLAGS = -L $(SDKROOT)$(SANITIZER_DYLIB_DIR) -Xlinker -not_for_dyld_shared_cache -rpath $(SANITIZER_DYLIB_DIR)/ |
c06d156a A |
20 | ASAN_LDFLAGS_YES[sdk=macosx*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_osx_dynamic |
21 | ASAN_LDFLAGS_YES[sdk=iphoneos*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_ios_dynamic | |
22 | ASAN_LDFLAGS_YES[sdk=watchos*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_watchos_dynamic | |
23 | ASAN_LDFLAGS_YES[sdk=appletvos*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_tvos_dynamic | |
24 | ASAN_LDFLAGS_YES[sdk=bridgeos*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_bridgeos_dynamic | |
a08f8358 A |
25 | |
26 | // "no_asan" variant | |
27 | // | |
28 | // The "no_asan" variant is only built when ASAN_IN_NORMAL_VARIANT=YES. | |
29 | // The variant exists to provide a way to opt-out processes from the | |
30 | // "Whole OS ASan" mode. It should be identical to the "normal" variant | |
31 | // except it does **not** upward link the ASan runtime. Despite the name, | |
32 | // this does not enforce that ASan is not used. This is because an ASan | |
33 | // instrumented binary could also cause the ASan runtime to be loaded. | |
34 | NOASAN_CFLAGS_YES = $(ASAN_CFLAGS_YES) | |
35 | NOASAN_LDFLAGS_YES = | |
36 | EXTRA_BUILD_VARIANTS_ASAN_IN_NORMAL_VARIANT_NO = | |
37 | EXTRA_BUILD_VARIANTS_ASAN_IN_NORMAL_VARIANT_YES = no_asan | |
38 | EXTRA_BUILD_VARIANTS_ASAN_IN_NORMAL_VARIANT = $(EXTRA_BUILD_VARIANTS_ASAN_IN_NORMAL_VARIANT_$(ASAN_IN_NORMAL_VARIANT)) | |
c06d156a | 39 | |
b8ce8438 A |
40 | SDK_INSTALL_VARIANT = $(SDK_INSTALL_VARIANT_$(DRIVERKIT)) |
41 | SDK_INSTALL_VARIANT_1 = driverkit | |
42 | SDK_INSTALL_VARIANT_ = default | |
43 | SDK_INSTALL_ROOT = $(SDK_INSTALL_ROOT_$(SDK_INSTALL_VARIANT)) | |
44 | SDK_INSTALL_ROOT_driverkit = $(DRIVERKITROOT) | |
45 | SDK_INSTALL_HEADERS_ROOT = $(SDK_INSTALL_HEADERS_ROOT_$(SDK_INSTALL_VARIANT)) | |
46 | SDK_INSTALL_HEADERS_ROOT_driverkit = $(SDK_INSTALL_ROOT)/$(SDK_RUNTIME_HEADERS_PREFIX) | |
47 | SDK_RUNTIME_HEADERS_PREFIX = Runtime | |
48 | ||
49 | BUILD_VARIANTS = $(BUILD_VARIANTS_$(SDK_INSTALL_VARIANT)) | |
a08f8358 | 50 | BUILD_VARIANTS_default = normal debug asan $(EXTRA_BUILD_VARIANTS_ASAN_IN_NORMAL_VARIANT) |
b8ce8438 | 51 | BUILD_VARIANTS_driverkit = normal debug |
9acf5127 | 52 | SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator |
b8ce8438 A |
53 | INSTALL_PATH = $(SDK_INSTALL_ROOT)/usr/lib |
54 | INSTALL_PATH_PREFIX = $(SDK_INSTALL_ROOT) | |
55 | INSTALL_PATH_FRAMEWORK_PREFIX = $(SDK_INSTALL_HEADERS_ROOT) | |
afef526e | 56 | DYLIB_CURRENT_VERSION = $(CURRENT_VERSION_STRING_$(RC_XBS)) |
b8ce8438 A |
57 | // used in PRODUCT_NAME of dylib target |
58 | DYLIB_NAME_VERSION_SUFFIX = .B | |
59 | DYLIB_NAME_VERSION_SUFFIX[sdk=driverkit*] = | |
afef526e A |
60 | ORDER_FILE = $(SDKROOT)/$(APPLE_INTERNAL_DIR)/OrderFiles/libSystem.order |
61 | ORDER_FILE[sdk=iphonesimulator*] = | |
b8ce8438 A |
62 | ORDER_FILE[sdk=driverkit*] = |
63 | SYSTEM_HEADER_SEARCH_PATHS = $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/System/Library/Frameworks/System.framework/PrivateHeaders $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/usr/local/include $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/usr/include | |
64 | SYSTEM_FRAMEWORK_SEARCH_PATHS = $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/System/Library/PrivateFrameworks $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/System/Library/Frameworks | |
a08f8358 A |
65 | |
66 | OTHER_CFLAGS = -include $(BUILT_PRODUCTS_DIR)/config.$(CURRENT_ARCH).$(CURRENT_VARIANT).h -DCURRENT_VARIANT_$(CURRENT_VARIANT)=1 | |
67 | OTHER_CFLAGS_normal = $(ASAN_CFLAGS_$(ASAN_IN_NORMAL_VARIANT:default=NO)) | |
68 | // Preserve existing behaviour of modifying debug variant. | |
69 | OTHER_CFLAGS_debug = $(ASAN_CFLAGS_$(ASAN_IN_NORMAL_VARIANT:default=NO)) | |
70 | OTHER_CFLAGS_asan = $(ASAN_CFLAGS_YES) | |
71 | OTHER_CFLAGS_no_asan = $(NOASAN_CFLAGS_YES) | |
72 | ||
73 | OTHER_LDFLAGS = -Wl,-search_paths_first -nodefaultlibs @$(BUILT_PRODUCTS_DIR)/linker_arguments.$(CURRENT_ARCH).$(CURRENT_VARIANT).txt $(DRIVERKIT_LDFLAGS) | |
74 | OTHER_LDFLAGS_normal = $(ASAN_LDFLAGS_$(ASAN_IN_NORMAL_VARIANT:default=NO)) | |
75 | // Preserve existing behaviour of modifying debug variant. | |
76 | OTHER_LDFLAGS_debug = $(ASAN_LDFLAGS_$(ASAN_IN_NORMAL_VARIANT:default=NO)) | |
c06d156a | 77 | OTHER_LDFLAGS_asan = $(ASAN_LDFLAGS_YES) |
a08f8358 A |
78 | OTHER_LDFLAGS_no_asan = $(NOASAN_LDFLAGS_YES) |
79 | ||
80 | ||
b8ce8438 A |
81 | // whitelist of libraries in DriverKit SDK allowed to link directly against libSystem.dylib (outside of the umbrella) |
82 | DRIVERKIT_LDFLAGS[sdk=driverkit*] = -Wl,-allowable_client,c++ -Wl,-allowable_client,c++abi -Wl,-allowable_client,DriverKit | |
afef526e A |
83 | LD_GENERATE_MAP_FILE = YES |
84 | EXECUTABLE_PREFIX = lib | |
b8ce8438 A |
85 | PRIVATE_HEADERS_FOLDER_PATH = $(SDK_INSTALL_HEADERS_ROOT)/usr/local/include/os |
86 | LIBRARY_SEARCH_PATHS = $(SDKROOT)/$(SDK_INSTALL_ROOT)/usr/lib/system $(SDKROOT)/$(SDK_INSTALL_ROOT)/usr/local/lib/system | |
afef526e A |
87 | GCC_NO_COMMON_BLOCKS = YES |
88 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES | |
89 | GCC_WARN_ABOUT_RETURN_TYPE = YES | |
90 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES | |
91 | GCC_TREAT_WARNINGS_AS_ERRORS = YES | |
92 | GCC_WARN_UNUSED_VARIABLE = YES | |
93 | CURRENT_VERSION_STRING_ = 159 | |
94 | CURRENT_VERSION_STRING_YES = $(CURRENT_PROJECT_VERSION) | |
9acf5127 A |
95 | INFOPLIST_INSTALL_PATH = Versions/B/Resources |
96 | INFOPLIST_INSTALL_PATH[sdk=iphoneos*] = | |
97 | INFOPLIST_INSTALL_PATH[sdk=*simulator*] = | |
98 | INFOPLIST_INSTALL_PATH[sdk=watchos*] = | |
a8f6861e A |
99 | INFOPLIST_OUTPUT_FORMAT = binary |
100 | INFOPLIST_OUTPUT_FORMAT[sdk=macosx*] = xml | |
101 | APPLY_RULES_IN_COPY_FILES = YES | |
102 | PLIST_FILE_OUTPUT_FORMAT = binary | |
103 | PLIST_FILE_OUTPUT_FORMAT[sdk=macosx*] = xml | |
b8ce8438 | 104 | EXCLUDED_SOURCE_FILE_NAMES[sdk=driverkit*] = Info.plist |
a8f6861e | 105 | |
3186893e A |
106 | EXCLUDED_SOURCE_FILE_NAMES = $(inherited) i386.c |
107 | INCLUDED_SOURCE_FILE_NAMES[sdk=macos*][arch=i386] = $(inherited) i386.c | |
108 | EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*][arch=i386] = $(inherited) init.c CompatibilityHacks.c | |
109 | ||
a8f6861e A |
110 | // override presence of $(EXECUTABLE_VARIANT_SUFFIX) in the default EXECUTABLE_NAME rdar://26234727 |
111 | DYLIB_INSTALL_NAME_EXECUTABLE_NAME = $(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_SUFFIX) | |
112 | DYLIB_INSTALL_NAME_EXECUTABLE_PATH = $(DYLIB_INSTALL_NAME_EXECUTABLE_NAME) | |
113 | LD_DYLIB_INSTALL_NAME = $(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(DYLIB_INSTALL_NAME_EXECUTABLE_PATH) | |
a85a94cf A |
114 | |
115 | IS_ZIPPERED = YES |