summaryrefslogtreecommitdiffstats
path: root/compiler-rt/make
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2010-03-31 20:38:57 +0000
committerNick Kledzik <kledzik@apple.com>2010-03-31 20:38:57 +0000
commit516f36d133800163d32a8781ff386de0f291dcfb (patch)
tree929d619dc63ce125418aee4f5e29589ff60584d5 /compiler-rt/make
parentb67a6e662040c9dac7e2c2676ab1487991784fa5 (diff)
downloadbcm5719-llvm-516f36d133800163d32a8781ff386de0f291dcfb.tar.gz
bcm5719-llvm-516f36d133800163d32a8781ff386de0f291dcfb.zip
<rdar://problem/7733536> Move libcompiler_rt over to a dylib target for Libsystem
llvm-svn: 100045
Diffstat (limited to 'compiler-rt/make')
-rw-r--r--compiler-rt/make/AppleBI.mk42
-rw-r--r--compiler-rt/make/platform/darwin_bni.mk2
2 files changed, 21 insertions, 23 deletions
diff --git a/compiler-rt/make/AppleBI.mk b/compiler-rt/make/AppleBI.mk
index 0817fd945ef..66a9036e0cf 100644
--- a/compiler-rt/make/AppleBI.mk
+++ b/compiler-rt/make/AppleBI.mk
@@ -28,27 +28,25 @@ installsrc:
# Copy results to DSTROOT.
-install: $(SYMROOT)/usr/local/lib/system/libcompiler_rt.a
- mkdir -p $(DSTROOT)/usr/local/lib/system
- cp $(SYMROOT)/usr/local/lib/system/libcompiler_rt.a \
- $(DSTROOT)/usr/local/lib/system/libcompiler_rt.a
- cd $(DSTROOT)/usr/local/lib/system; \
- ln -s libcompiler_rt.a libcompiler_rt_profile.a; \
- ln -s libcompiler_rt.a libcompiler_rt_debug.a
-
-
-# Rule to make fat libcompiler_rt.a.
-$(SYMROOT)/usr/local/lib/system/libcompiler_rt.a : $(foreach arch,$(RC_ARCHS), \
- $(OBJROOT)/$(arch)-pruned.a)
- mkdir -p $(SYMROOT)/usr/local/lib/system
+install: $(SYMROOT)/libcompiler_rt.dylib
+ mkdir -p $(DSTROOT)/usr/lib/system
+ strip -S $(SYMROOT)/libcompiler_rt.dylib \
+ -o $(DSTROOT)/usr/lib/system/libcompiler_rt.dylib
+ cd $(DSTROOT)/usr/lib/system; \
+ ln -s libcompiler_rt.dylib libcompiler_rt_profile.dylib; \
+ ln -s libcompiler_rt.dylib libcompiler_rt_debug.dylib
+
+# Rule to make each dylib slice
+$(OBJROOT)/libcompiler_rt-%.dylib : $(OBJROOT)/darwin_bni/Release/%/libcompiler_rt.a
+ echo "const char vers[] = \"@(#) $(RC_ProjectName)-$(RC_ProjectSourceVersion)\"; " > $(OBJROOT)/version.c
+ cc $(OBJROOT)/version.c -arch $* -dynamiclib \
+ -install_name /usr/lib/system/libcompiler_rt.dylib \
+ -compatibility_version 1 -current_version $(RC_ProjectSourceVersion) \
+ -nodefaultlibs -lSystem -umbrella System -dead_strip \
+ -Wl,-force_load,$^ -o $@
+
+# Rule to make fat dylib
+$(SYMROOT)/libcompiler_rt.dylib: $(foreach arch,$(RC_ARCHS), \
+ $(OBJROOT)/libcompiler_rt-$(arch).dylib)
lipo -create $^ -o $@
-
-# Rule to add project info so that "what /usr/lib/libSystem.B.dylib" will work.
-$(OBJROOT)/%-pruned.a : $(OBJROOT)/darwin_bni/Release/%/libcompiler_rt.a
- mkdir -p $(OBJROOT)/$*.tmp
- cd $(OBJROOT)/$*.tmp; \
- /Developer/Makefiles/bin/version.pl $(RC_ProjectName) > $(OBJROOT)/version.c; \
- gcc -arch $* -c ${OBJROOT}/version.c -o version.o; \
- ar -x $<; \
- libtool -static *.o -o $@
diff --git a/compiler-rt/make/platform/darwin_bni.mk b/compiler-rt/make/platform/darwin_bni.mk
index a7d8989800c..74698a194e9 100644
--- a/compiler-rt/make/platform/darwin_bni.mk
+++ b/compiler-rt/make/platform/darwin_bni.mk
@@ -9,7 +9,7 @@ Configs := Debug Release Profile
UniversalArchs := $(RC_ARCHS)
-CFLAGS := -Wall -O3 -fomit-frame-pointer
+CFLAGS := -Wall -Os -fomit-frame-pointer -g
FUNCTIONS := absvdi2 absvsi2 addvdi3 addvsi3 ashldi3 ashrdi3 \
OpenPOWER on IntegriCloud