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 @@ -657,9 +657,14 @@ $(DYLIB_OBJECTS) : CFLAGS += -DCOMPILING_LLDB_TEST_DLL ifneq "$(OS)" "Windows_NT" +ifeq "$(DYLIB_ONLY)" "" +CFLAGS += -fPIC +CXXFLAGS += -fPIC +else $(DYLIB_OBJECTS) : CFLAGS += -fPIC $(DYLIB_OBJECTS) : CXXFLAGS += -fPIC endif +endif $(DYLIB_FILENAME) : $(DYLIB_OBJECTS) ifeq "$(OS)" "Darwin"