#include "/Makefiles/CoreOS/Xcode/BSD.xcconfig" // NO means only libSystem.B_asan.dylib will be ASanified. // YES means even the normal variant, libSystem.B.dylib, will be ASanified. // // XBS sets RC_SUPPORT_ADDRESS_SANITIZATION=1 to trigger the ASanified normal variant. ASAN_IN_NORMAL_VARIANT_DK_ = YES ASAN_IN_NORMAL_VARIANT_DK_1 = NO ASAN_IN_NORMAL_VARIANT_RC_1 = $(ASAN_IN_NORMAL_VARIANT_DK_$(DRIVERKIT)) ASAN_IN_NORMAL_VARIANT_RC_ = NO ASAN_IN_NORMAL_VARIANT = $(ASAN_IN_NORMAL_VARIANT_RC_$(RC_SUPPORT_ADDRESS_SANITIZATION)) ASAN_CFLAGS_ = ASAN_CFLAGS_YES = -DCURRENT_VARIANT_asan=1 ASAN_LDFLAGS_ = SHARED_ASAN_LDFLAGS = -L $(SDKROOT)/usr/local/lib/sanitizers -Xlinker -not_for_dyld_shared_cache -rpath /usr/local/lib/sanitizers/ ASAN_LDFLAGS_YES[sdk=macosx*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_osx_dynamic ASAN_LDFLAGS_YES[sdk=iphoneos*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_ios_dynamic ASAN_LDFLAGS_YES[sdk=watchos*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_watchos_dynamic ASAN_LDFLAGS_YES[sdk=appletvos*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_tvos_dynamic ASAN_LDFLAGS_YES[sdk=bridgeos*] = $(SHARED_ASAN_LDFLAGS) -Xlinker -upward-lclang_rt.asan_bridgeos_dynamic ASAN_IN_NORMAL_VARIANT_CFLAGS = $(ASAN_CFLAGS_$(ASAN_IN_NORMAL_VARIANT)) ASAN_IN_NORMAL_VARIANT_LDFLAGS = $(ASAN_LDFLAGS_$(ASAN_IN_NORMAL_VARIANT)) SDK_INSTALL_VARIANT = $(SDK_INSTALL_VARIANT_$(DRIVERKIT)) SDK_INSTALL_VARIANT_1 = driverkit SDK_INSTALL_VARIANT_ = default SDK_INSTALL_ROOT = $(SDK_INSTALL_ROOT_$(SDK_INSTALL_VARIANT)) SDK_INSTALL_ROOT_driverkit = $(DRIVERKITROOT) SDK_INSTALL_HEADERS_ROOT = $(SDK_INSTALL_HEADERS_ROOT_$(SDK_INSTALL_VARIANT)) SDK_INSTALL_HEADERS_ROOT_driverkit = $(SDK_INSTALL_ROOT)/$(SDK_RUNTIME_HEADERS_PREFIX) SDK_RUNTIME_HEADERS_PREFIX = Runtime BUILD_VARIANTS = $(BUILD_VARIANTS_$(SDK_INSTALL_VARIANT)) BUILD_VARIANTS_default = normal debug asan BUILD_VARIANTS_driverkit = normal debug SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator INSTALL_PATH = $(SDK_INSTALL_ROOT)/usr/lib INSTALL_PATH_PREFIX = $(SDK_INSTALL_ROOT) INSTALL_PATH_FRAMEWORK_PREFIX = $(SDK_INSTALL_HEADERS_ROOT) DYLIB_CURRENT_VERSION = $(CURRENT_VERSION_STRING_$(RC_XBS)) // used in PRODUCT_NAME of dylib target DYLIB_NAME_VERSION_SUFFIX = .B DYLIB_NAME_VERSION_SUFFIX[sdk=driverkit*] = ORDER_FILE = $(SDKROOT)/$(APPLE_INTERNAL_DIR)/OrderFiles/libSystem.order ORDER_FILE[sdk=iphonesimulator*] = ORDER_FILE[sdk=driverkit*] = 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 SYSTEM_FRAMEWORK_SEARCH_PATHS = $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/System/Library/PrivateFrameworks $(SDKROOT)/$(SDK_INSTALL_HEADERS_ROOT)/System/Library/Frameworks OTHER_CFLAGS = -include $(BUILT_PRODUCTS_DIR)/config.$(CURRENT_ARCH).$(CURRENT_VARIANT).h -DCURRENT_VARIANT_$(CURRENT_VARIANT)=1 $(ASAN_IN_NORMAL_VARIANT_CFLAGS) OTHER_LDFLAGS = -Wl,-search_paths_first -nodefaultlibs @$(BUILT_PRODUCTS_DIR)/linker_arguments.$(CURRENT_ARCH).$(CURRENT_VARIANT).txt $(ASAN_IN_NORMAL_VARIANT_LDFLAGS) $(DRIVERKIT_LDFLAGS) OTHER_LDFLAGS_asan = $(ASAN_LDFLAGS_YES) // whitelist of libraries in DriverKit SDK allowed to link directly against libSystem.dylib (outside of the umbrella) DRIVERKIT_LDFLAGS[sdk=driverkit*] = -Wl,-allowable_client,c++ -Wl,-allowable_client,c++abi -Wl,-allowable_client,DriverKit LD_GENERATE_MAP_FILE = YES EXECUTABLE_PREFIX = lib PRIVATE_HEADERS_FOLDER_PATH = $(SDK_INSTALL_HEADERS_ROOT)/usr/local/include/os LIBRARY_SEARCH_PATHS = $(SDKROOT)/$(SDK_INSTALL_ROOT)/usr/lib/system $(SDKROOT)/$(SDK_INSTALL_ROOT)/usr/local/lib/system GCC_NO_COMMON_BLOCKS = YES GCC_WARN_64_TO_32_BIT_CONVERSION = YES GCC_WARN_ABOUT_RETURN_TYPE = YES GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES GCC_TREAT_WARNINGS_AS_ERRORS = 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*] = INFOPLIST_OUTPUT_FORMAT = binary INFOPLIST_OUTPUT_FORMAT[sdk=macosx*] = xml APPLY_RULES_IN_COPY_FILES = YES PLIST_FILE_OUTPUT_FORMAT = binary PLIST_FILE_OUTPUT_FORMAT[sdk=macosx*] = xml EXCLUDED_SOURCE_FILE_NAMES[sdk=driverkit*] = Info.plist // override presence of $(EXECUTABLE_VARIANT_SUFFIX) in the default EXECUTABLE_NAME rdar://26234727 DYLIB_INSTALL_NAME_EXECUTABLE_NAME = $(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_SUFFIX) DYLIB_INSTALL_NAME_EXECUTABLE_PATH = $(DYLIB_INSTALL_NAME_EXECUTABLE_NAME) LD_DYLIB_INSTALL_NAME = $(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(DYLIB_INSTALL_NAME_EXECUTABLE_PATH) IS_ZIPPERED = YES