Author: Adrian Prantl Date: 2025-10-31T09:53:47-07:00 New Revision: 527e0ec71e52f7541d1e9045478cac4547fcfc81
URL: https://github.com/llvm/llvm-project/commit/527e0ec71e52f7541d1e9045478cac4547fcfc81 DIFF: https://github.com/llvm/llvm-project/commit/527e0ec71e52f7541d1e9045478cac4547fcfc81.diff LOG: [LLDB] Fix ASAN tests on newer versions of macOS (#165883) macOS forbids injecting the ASAN runtime into system processes when SIP is enabled. That includes the just-built libLTO that the just-built clang injects into the system linker. Since we don't test the compiler here, just use the system (non-asanified) LTO library to make ASAN tests work for most users, including the bots. Added: Modified: lldb/packages/Python/lldbsuite/test/make/Makefile.rules Removed: ################################################################################ diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 09939e29e5b75..28cae54776ac8 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -322,6 +322,17 @@ ifeq (,$(filter $(OS), Windows_NT Android Darwin)) LDFLAGS += -pthread endif endif + +# macOS forbids injecting the ASAN runtime into system processes when +# SIP is enabled. That includes the just-built libLTO that the +# just-built clang injects into the system linker. Since we don't +# test the compiler here, just use the system (non-asanified) LTO +# library to make ASAN tests work for most users, including the bots. +ifeq "$(OS)" "Darwin" +ifneq "$(ASAN_OPTIONS)" "" +LD_FLAGS += -Wl,-lto_library -Wl,$(shell dirname $(shell xcrun -find clang))/../lib/libLTO.dylib +endif +endif OBJECTS = EXE ?= a.out _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
