diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -428,6 +428,16 @@ endif endif +ifeq (1, $(USE_SYSTEM_STDLIB)) + ifeq "$(OS)" "Darwin" + ifeq "$(SDKROOT)" "" + $(error "SDKROOT must be set on Darwin to use the system libcxx") + endif + CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(SDKROOT)/usr/include/c++/v1 + LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++ + endif +endif + # If no explicit request was made, but we have paths to a custom libcxx, use # them. ifeq ($(or $(USE_LIBSTDCPP), $(USE_LIBCPP), $(USE_SYSTEM_STDLIB)),)