Skip to content

Commit 26274da

Browse files
author
Nick Kledzik
committed
improve arm build support on darwin
llvm-svn: 102032
1 parent 8d4de67 commit 26274da

File tree

2 files changed

+53
-7
lines changed

2 files changed

+53
-7
lines changed

compiler-rt/make/AppleBI.mk

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ else
1212
ProjObjRoot := $(ProjSrcRoot)
1313
endif
1414

15+
ifeq (,$(SDKROOT))
16+
INSTALL_TARGET = install-MacOSX
17+
else
18+
INSTALL_TARGET = install-iPhoneOS
19+
endif
20+
21+
1522
# Log full compile lines in B&I logs and omit summary lines.
1623
Verb :=
1724
Summary := @true
@@ -27,8 +34,10 @@ installsrc:
2734
cp -r . $(SRCROOT)
2835

2936

37+
install: $(INSTALL_TARGET)
38+
3039
# Copy results to DSTROOT.
31-
install: $(SYMROOT)/libcompiler_rt.dylib
40+
install-MacOSX : $(SYMROOT)/libcompiler_rt.dylib
3241
mkdir -p $(DSTROOT)/usr/lib/system
3342
strip -S $(SYMROOT)/libcompiler_rt.dylib \
3443
-o $(DSTROOT)/usr/lib/system/libcompiler_rt.dylib
@@ -47,6 +56,29 @@ $(OBJROOT)/libcompiler_rt-%.dylib : $(OBJROOT)/darwin_bni/Release/%/libcompiler_
4756

4857
# Rule to make fat dylib
4958
$(SYMROOT)/libcompiler_rt.dylib: $(foreach arch,$(RC_ARCHS), \
50-
$(OBJROOT)/libcompiler_rt-$(arch).dylib)
59+
$(OBJROOT)/libcompiler_rt-$(arch).dylib)
60+
lipo -create $^ -o $@
61+
62+
63+
64+
65+
# Copy results to DSTROOT.
66+
install-iPhoneOS: $(SYMROOT)/libcompiler_rt.a $(SYMROOT)/libcompiler_rt-static.a
67+
mkdir -p $(DSTROOT)/$(SDKROOT)/usr/local/lib/libgcc
68+
cp $(SYMROOT)/libcompiler_rt.a \
69+
$(DSTROOT)/$(SDKROOT)/usr/local/lib/libgcc/libcompiler_rt.a
70+
mkdir -p $(DSTROOT)/$(SDKROOT)/usr/local/
71+
cp $(SYMROOT)/libcompiler_rt-static.a \
72+
$(DSTROOT)/$(SDKROOT)/usr/local/lib/libcompiler_rt-static.a
73+
74+
75+
# Rule to make fat archive
76+
$(SYMROOT)/libcompiler_rt.a : $(foreach arch,$(RC_ARCHS), \
77+
$(OBJROOT)/darwin_bni/Release/$(arch)/libcompiler_rt.a)
78+
lipo -create $^ -o $@
79+
80+
# Rule to make fat archive
81+
$(SYMROOT)/libcompiler_rt-static.a : $(foreach arch,$(RC_ARCHS), \
82+
$(OBJROOT)/darwin_bni/Static/$(arch)/libcompiler_rt.a)
5183
lipo -create $^ -o $@
5284

compiler-rt/make/platform/darwin_bni.mk

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Description := Target for Darwin using an Apple-style build.
33

4-
Configs := Debug Release Profile
4+
Configs := Debug Release Profile Static
55

66
# We override this with RC_ARCHS because B&I may want to build on an ARCH we
77
# haven't explicitly defined support for. If all goes well, this will just work
@@ -10,6 +10,10 @@ UniversalArchs := $(RC_ARCHS)
1010

1111

1212
CFLAGS := -Wall -Os -fomit-frame-pointer -g
13+
CFLAGS.Static := $(CFLAGS) -static
14+
15+
VISIBILITY_HIDDEN := 0
16+
VISIBILITY_HIDDEN.Static := 1
1317

1418

1519
FUNCTIONS := absvdi2 absvsi2 addvdi3 addvsi3 ashldi3 ashrdi3 \
@@ -53,8 +57,18 @@ FUNCTIONS.armv6 := $(FUNCTIONS) \
5357
nedf2vfp negdf2vfp negsf2vfp nesf2vfp \
5458
subdf3vfp subsf3vfp truncdfsf2vfp unorddf2vfp unordsf2vfp \
5559
modsi3 umodsi3 udivsi3 divsi3 \
56-
switch8 switchu8 switch16 switch32 \
57-
restore_vfp_d8_d15_regs save_vfp_d8_d15_regs \
58-
sync_synchronize
60+
switch8 switchu8 switch16 switch32 \
61+
restore_vfp_d8_d15_regs save_vfp_d8_d15_regs \
62+
sync_synchronize
63+
FUNCTIONS.armv7 := $(FUNCTIONS) \
64+
adddf3vfp addsf3vfp bswapdi2 bswapsi2 divdf3vfp \
65+
divsf3vfp eqdf2vfp eqsf2vfp extendsfdf2vfp \
66+
fixdfsivfp fixsfsivfp fixunsdfsivfp fixunssfsivfp \
67+
floatsidfvfp floatsisfvfp floatunssidfvfp floatunssisfvfp \
68+
gedf2vfp gesf2vfp gtdf2vfp gtsf2vfp \
69+
ledf2vfp lesf2vfp ltdf2vfp ltsf2vfp \
70+
muldf3vfp mulsf3vfp \
71+
nedf2vfp negdf2vfp negsf2vfp nesf2vfp \
72+
subdf3vfp subsf3vfp truncdfsf2vfp unorddf2vfp unordsf2vfp \
73+
modsi3 umodsi3 udivsi3 divsi3
5974

60-
VISIBILITY_HIDDEN := 0

0 commit comments

Comments
 (0)