build compiler-rt with -fPIC, otherwise the run-time libs will not link with -pie, at least on linux
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@146499 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Makefile b/Makefile
index ef8ee5c..642b654 100644
--- a/Makefile
+++ b/Makefile
@@ -227,7 +227,7 @@
$(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c -o $$@ $$<
$(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.c $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir
$(Summary) " COMPILE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<"
- $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c -o $$@ $$<
+ $(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c $(COMMON_CFLAGS) -o $$@ $$<
$(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.cc $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir
$(Summary) " COMPILE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<"
$(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c $(COMMON_CXXFLAGS) -o $$@ $$<
diff --git a/make/config.mk b/make/config.mk
index 5656ad6..df7c1cc 100644
--- a/make/config.mk
+++ b/make/config.mk
@@ -42,4 +42,5 @@
###
# Common compiler options
-COMMON_CXXFLAGS=-fno-exceptions
+COMMON_CXXFLAGS=-fno-exceptions -fPIC
+COMMON_CFLAGS=-fPIC