aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.rules15
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile.rules b/Makefile.rules
index af2b459bc0..52a61109d6 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -278,8 +278,19 @@ ifdef ENABLE_EXPENSIVE_CHECKS
endif
ifeq ($(ENABLE_PIC),1)
- CXX.Flags += -fPIC
- C.Flags += -fPIC
+ ifeq ($(LLVM_ON_WIN32),1)
+ # Nothing. Win32 defaults to PIC and warns when given -fPIC
+ else
+ ifeq ($(OS),Darwin)
+ # common is forbidden in dylib files
+ CXX.Flags += -fno-common
+ C.Flags += -fno-common
+ else
+ # Linux and others; pass -fPIC
+ CXX.Flags += -fPIC
+ C.Flags += -fPIC
+ endif
+ endif
endif
CXX.Flags += $(CXXFLAGS) -Woverloaded-virtual