Loading...
--- libmalloc/libmalloc-715.140.5/tests/Makefile
+++ libmalloc/libmalloc-646.40.3/tests/Makefile
@@ -32,12 +32,9 @@
 OTHER_CFLAGS += \
 	-DDARWINTEST \
 	-DOS_ATOMIC_CONFIG_MEMORY_ORDER_DEPENDENCY=1 \
-	-DT_META_TAG_XZONE_AND_PGM=T_META_TAG\(\"xzone_and_pgm\"\) \
-	-DT_META_TAG_NO_ALLOCATOR_OVERRIDE=T_META_TAG\(\"no_allocator_override\"\) \
 	-DT_META_TAG_XZONE=T_META_TAG\(\"xzone\"\) \
 	-DT_META_TAG_XZONE_ONLY=T_META_TAG\(\"xzone_only\"\) \
 	-DT_META_TAG_NANO_ON_XZONE=T_META_TAG\(\"nano_on_xzone\"\) \
-	-DT_META_TAG_DISABLE_SANITIZERS_TRACES=T_META_TAG\(\"disable_sanitizers_traces\"\) \
 	-I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders \
 	-I$(SRCROOT)/../private \
 	-I$(SRCROOT)/../include \
@@ -52,16 +49,9 @@
 OTHER_CFLAGS += -DL4_CONFIG_PLAT_EVP
 OTHER_CFLAGS += -isystem $(SDKROOT)/System/ExclaveKit/usr/local/standalone/cL4-future/include
 OTHER_LDFLAGS += -L $(SDKROOT)/System/ExclaveKit/usr/local/lib
-OTHER_LDFLAGS += -lc++ -lobjc
-
-# FIXME: This should be inherited from SDKSettings.json, but Xcode doesn't
-# invoke the darwintests target once for each variant in BUILD_VARIANTS
-_OTHER_CFLAGS_asan := $(shell plutil -extract DefaultProperties._OTHER_CFLAGS_asan raw -expect string $(SDKROOT)/SDKSettings.json)
-# rdar://128967612 (Don't link compiler-rt for exclavekit sanitizers)
-_OTHER_LDFLAGS_asan := \
-	-fno-sanitize-link-runtime
-
-CUSTOM_TARGETS += libmalloc-exclavekit-darwintests libmalloc-exclavekit-darwintests_asan
+OTHER_LDFLAGS += -lc++
+
+CUSTOM_TARGETS += libmalloc-exclavekit-darwintests
 CUSTOM_TARGETS += libmalloc_exclavekit.plist
 endif
 
@@ -83,15 +73,13 @@
 	-llibc \
 	-llibc_plat_cl4_standalone_malloc \
 	-lm \
-	-lmalloc
-
-# FIXME: This should be inherited from SDKSettings.json, but Xcode doesn't
-# invoke the darwintests target once for each variant in BUILD_VARIANTS
-_OTHER_CFLAGS_asan := $(shell plutil -extract DefaultProperties._OTHER_CFLAGS_asan raw -expect string $(SDKROOT)/SDKSettings.json)
-_OTHER_LDFLAGS_asan := \
-	-Wl,-image_suffix,_asan
-
-CUSTOM_TARGETS += libmalloc-exclavecore-darwintests libmalloc-exclavecore-darwintests_asan
+	-lmalloc \
+	-lpmm \
+	-lvas \
+	-lvas-core \
+	-lxrt
+
+CUSTOM_TARGETS += libmalloc-exclavecore-darwintests
 CUSTOM_TARGETS += libmalloc_exclavecore.plist
 endif
 
@@ -153,8 +141,7 @@
 	tsan.c \
 	memory_pressure.c \
 	malloc_msl.c \
-	madvise.c \
-	security_policy.c
+	madvise.c
 
 # Exclaves don't support dispatch_apply, which this perf test relies on
 EXCLUDED_SOURCES += basic_malloc_free_perf.c
@@ -224,6 +211,7 @@
 malloc_claimed_address_tests: OTHER_CFLAGS += -I../src
 scribble_tests: OTHER_CFLAGS += -I../src
 malloc_size_test: OTHER_CFLAGS += -I../src
+
 xzone: OTHER_LDFLAGS += -ldarwintest_utils
 
 # -fno-builtin also disables TMO
@@ -231,12 +219,10 @@
 # Build this test with no explicit TMO options to validate that it gets TMO
 # automatically on platforms where that's expected
 
-enablement_tests: OTHER_LDFLAGS += -lobjc -fobjc-arc -ldarwintest_utils
+printer_tests: OTHER_LDFLAGS += -lobjc -fobjc-arc -ldarwintest_utils
 
 MALLOC_TYPE_SWIFT_OBJS := $(addsuffix .o,$(addprefix malloc_type_swift_,$(ARCH_CONFIGS)))
 MALLOC_TYPE_SYM_SWIFT_OBJS := $(addprefix $(SYMROOT)/,$(MALLOC_TYPE_SWIFT_OBJS))
-
-memory_pressure: OTHER_CFLAGS := $(filter-out -fno-builtin -fno-typed-memory-operations,$(OTHER_CFLAGS))
 
 malloc_type: OTHER_CFLAGS := $(filter-out -fno-builtin -fno-typed-memory-operations,$(OTHER_CFLAGS))
 malloc_type: OTHER_CFLAGS += $(SYMROOT)/malloc_type_cpp.o $(MALLOC_TYPE_SYM_SWIFT_OBJS) $(SYMROOT)/malloc_type_objc.o
@@ -266,7 +252,6 @@
 malloc_type_callsite: $(SYMROOT)/malloc_type_callsite_cpp.o
 malloc_type_callsite: OTHER_CFLAGS += $(SYMROOT)/malloc_type_callsite_cpp.o
 malloc_type_callsite: OTHER_LDFLAGS += -lc++
-
 
 ifeq ($(MALLOC_EXCLAVES),NO)
 # BATS test plist handling
@@ -290,16 +275,8 @@
 include $(DEVELOPER_DIR)/AppleInternal/Makefiles/darwintest/Makefile.targets
 
 ifeq ($(MALLOC_EXCLAVEKIT),YES)
-# Linker arguments for ASAN must be prepended to select correct libraries
-libmalloc-exclavekit-darwintests_asan: OTHER_CFLAGS += $(_OTHER_CFLAGS_asan)
-libmalloc-exclavekit-darwintests_asan: OTHER_LDFLAGS := $(_OTHER_LDFLAGS_asan) $(OTHER_LDFLAGS)
-libmalloc-exclavekit-darwintests_asan: $(SOURCES_c) $(SYMROOT)/malloc_type_cpp.o
-	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
 libmalloc-exclavekit-darwintests: $(SOURCES_c) $(SYMROOT)/malloc_type_cpp.o
 	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
-install-libmalloc-exclavekit-darwintests_asan: libmalloc-exclavekit-darwintests_asan
-	mkdir -p $(INSTALLDIR)
-	cp $(SYMROOT)/$(patsubst install-%,%,$@) $(INSTALLDIR)/
 install-libmalloc-exclavekit-darwintests: libmalloc-exclavekit-darwintests
 	mkdir -p $(INSTALLDIR)
 	cp $(SYMROOT)/$(patsubst install-%,%,$@) $(INSTALLDIR)/
@@ -311,17 +288,9 @@
 endif
 
 ifeq ($(MALLOC_EXCLAVECORE),YES)
-# Linker arguments for ASAN must be prepended to select correct libraries
-libmalloc-exclavecore-darwintests_asan: OTHER_CFLAGS += $(_OTHER_CFLAGS_asan)
-libmalloc-exclavecore-darwintests_asan: OTHER_LDFLAGS := $(_OTHER_LDFLAGS_asan) $(OTHER_LDFLAGS)
-libmalloc-exclavecore-darwintests_asan: $(SOURCES_c) exclavecore_support.c $(SYMROOT)/malloc_type_cpp.o
-	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
 libmalloc-exclavecore-darwintests: $(SOURCES_c) exclavecore_support.c $(SYMROOT)/malloc_type_cpp.o
 	$(CC) $(DT_CFLAGS) $(OTHER_CFLAGS) $(CFLAGS) $(DT_LDFLAGS) $(OTHER_LDFLAGS) $(LDFLAGS) $^ -o $(SYMROOT)/$@
-install-libmalloc-exclavecore-darwintests_asan: libmalloc-exclavecore-darwintests_asan
-	mkdir -p $(INSTALLDIR)
-	cp $(SYMROOT)/$(patsubst install-%,%,$@) $(INSTALLDIR)/
-install-libmalloc-exclavecore-darwintests: libmalloc-exclavecore-darwintests
+install-libmalloc-exclavecore-darwintests : libmalloc-exclavecore-darwintests
 	mkdir -p $(INSTALLDIR)
 	cp $(SYMROOT)/$(patsubst install-%,%,$@) $(INSTALLDIR)/
 libmalloc_exclavecore.plist: $(PROJECT_DIR)/tests/exclave/libmalloc_exclavecore.plist