Skip to content

Commit ebed703

Browse files
committed
Use xcrun - armv7
Also dropped armv7 support. As armv7 and arm64 should be sufficient now.
1 parent c9a04e8 commit ebed703

5 files changed

+20
-133
lines changed

arm-apple-darwin10-ar

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
#!/bin/sh
2-
exec ar $@
2+
3+
SDK=iphoneos
4+
ARCH=armv7
5+
6+
exec xcrun --sdk ${SDK} ar "$@"

arm-apple-darwin10-clang

+3-95
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,6 @@
11
#!/bin/sh
22

3-
TARGET_PLATFORM=`xcrun --show-sdk-path --sdk iphoneos`
4-
TARGET_GCC=`xcrun -f clang`
5-
TARGET_CFLAGS="-isysroot $TARGET_PLATFORM -miphoneos-version-min=7.0"
3+
SDK=iphoneos
4+
ARCH=armv7
65

7-
args=$@
8-
9-
# When we see a .s output file:
10-
# -o ABC.s
11-
12-
# replace with two calls:
13-
# -o ABC-armv7.s -arch armv7
14-
# -o ABC-armv7s.s -arch armv7s
15-
16-
# When we see a .s input file and a .o output file:
17-
# -c ABC.s -o DEF.o
18-
19-
# replace with two calls:
20-
# -c ABC-armv7.s -o DEF-armv7.o -arch armv7
21-
# -c ABC-armv7s.s -o DEF-armv7s.o -arch armv7s
22-
# and then:
23-
# lipo DEF-armv7.o DEF-armv7s.o to DEF.o
24-
25-
# When we see
26-
# -o ABC.o
27-
# replace with two calls:
28-
# -o ABC-armv7.o -arch armv7
29-
# -o ABC-armv7s.o -arch armv7s
30-
# and then:
31-
# lipo ABC-armv7.o ABC-armv7s.o to ABC.o
32-
33-
# Check if we're building an object file by looking for "-o file.o", and find its filename
34-
# we use s|_|\1|p where _ is the match, \1 replaces it with the group in the match
35-
# sed's -E allows extended regexes (cleaner syntax), -n suppresses non-matching input, the |p flag prints matches.
36-
37-
# Support for profiling libraries used by ghc
38-
# Only need lipo when we're outputting object files
39-
40-
#generate -armv7 and -armv7s variants of any .s and .o (and ghc's variants of .o)
41-
argsArmv7=${args/.s/-armv7.s}
42-
argsArmv7s=${args/.s/-armv7s.s}
43-
44-
for ext in o p_o l_o debug_o thr_o thr_debug_o thr_l_o thr_p_o
45-
do
46-
argsArmv7=${argsArmv7/.$ext/-armv7.$ext}
47-
argsArmv7s=${argsArmv7s/.$ext/-armv7s.$ext}
48-
done
49-
50-
for ext in o p_o l_o debug_o thr_o thr_debug_o thr_l_o thr_p_o
51-
do
52-
match="s|.*-o ([^.]*)\.$ext.*|\1|p"
53-
outFileName=$(echo "$args" | sed -En "$match")
54-
if [[ -n $outFileName ]]; then
55-
objectExt=$ext
56-
needLipo=true
57-
needFatCall=true
58-
break
59-
fi
60-
done
61-
62-
outFileNameS=$(echo "$args" | sed -En 's|.*-o ([^.]*)\.s.*|\1|p')
63-
64-
# A silly hack:
65-
# If the .s file is generated by llc rather than us, llc won't generate the -armv7 and -armv7s variants
66-
# (we could write a arm-apple-darwin10-llc to do that, and then we could correctly pass '-mattr=+v7,+vfp3' to armv7 and '-mattr=+v7,+vfp4' to armv7s)
67-
# So we just copy its output here.
68-
inFileNameS=$(echo "$args" | sed -En 's|.*-c ([^.]*)\.s.*|\1|p')
69-
if [[ -f $inFileNameS.s ]]; then
70-
cp $inFileNameS.s $inFileNameS-armv7.s
71-
cp $inFileNameS.s $inFileNameS-armv7s.s
72-
fi
73-
74-
# Need fat calls for generating either .s or .o files
75-
if [[ -n $outFileNameS ]]; then
76-
needFatCall=true
77-
fi
78-
79-
if [[ $needFatCall == true ]]; then
80-
# Call clang twice, once for each architecture, outputting to our filename variants
81-
$TARGET_GCC $TARGET_CFLAGS -arch armv7 $argsArmv7
82-
$TARGET_GCC $TARGET_CFLAGS -arch armv7s $argsArmv7s
83-
else
84-
# echo "Non-object-generating compile command: $TARGET_GCC $TARGET_CFLAGS -arch armv7s $@"
85-
# If not building object files, call regularly. Still need to include an arch to configure clang for arm mode.
86-
exec $TARGET_GCC $TARGET_CFLAGS -arch armv7s "$@"
87-
fi
88-
89-
if [[ $needLipo == true ]]; then
90-
outFileNameOArmv7=$outFileName-armv7.$objectExt
91-
outFileNameOArmv7s=$outFileName-armv7s.$objectExt
92-
93-
# Lipo the two filename variants together
94-
lipo $outFileNameOArmv7 $outFileNameOArmv7s -create -output $outFileName.$objectExt
95-
96-
# Clean up
97-
rm $outFileNameOArmv7 $outFileNameOArmv7s
98-
fi
6+
exec xcrun --sdk ${SDK} clang -arch ${ARCH} -miphoneos-version-min=7.0 "$@"

arm-apple-darwin10-ld

+3-34
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,6 @@
11
#!/bin/sh
22

3-
TARGET_PLATFORM=`xcrun --show-sdk-platform-path --sdk iphoneos`
4-
TARGET_BIN=`xcrun --show-sdk-platform-path --sdk iphoneos`/Developer/usr/bin
3+
SDK=iphoneos
4+
ARCH=armv7
55

6-
TARGET_LD=`xcrun --sdk iphoneos -f ld`
7-
TARGET_LDFLAGS="-L$TARGET_PLATFORM/usr/lib/ -ios_version_min 7.0"
8-
9-
# echo "LINKING WITH: $@"
10-
11-
args=$@
12-
13-
# Check if we're building an object file by looking for "-o file.o", and find its filename
14-
# sed's -E allows extended regexes (cleaner syntax), -n suppresses non-matching input, the |p flag prints matches.
15-
outFileName=$(echo "$args" | sed -En 's|.*-o ([^.]*)\.o.*|\1|p')
16-
17-
# Only need lipo when we're building object files
18-
if [ -n "$outFileName" ]
19-
then
20-
# Create filename variants for armV7 and armV7s
21-
fileNameForArmv7=$outFileName-armv7
22-
fileNameForArmv7s=$outFileName-armv7s
23-
24-
# Call gcc twice, once for each architecture, outputting to our filename variants
25-
$TARGET_LD $TARGET_LDFLAGS -arch armv7 ${args//$outFileName.o/$fileNameForArmv7.o}
26-
$TARGET_LD $TARGET_LDFLAGS -arch armv7s ${args//$outFileName.o/$fileNameForArmv7s.o}
27-
28-
# Lipo the two filename variants together
29-
lipo $fileNameForArmv7.o $fileNameForArmv7s.o -create -output $outFileName.o
30-
31-
# Clean up
32-
rm $fileNameForArmv7.o $fileNameForArmv7s.o
33-
else
34-
# echo "Non-object-generating link command: $TARGET_LD $TARGET_LDFLAGS -arch armv7s $@"
35-
# If not building object files, call regularly. Still need to include an arch to configure ld for arm mode.
36-
exec $TARGET_LD $TARGET_LDFLAGS -arch armv7s "$@"
37-
fi
6+
exec xcrun --sdk ${SDK} ld -arch ${ARCH} "$@"

arm-apple-darwin10-nm

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
22

3-
TARGET_NM=`xcrun -f nm`
4-
exec $TARGET_NM "$@"
3+
SDK=iphoneos
4+
ARCH=armv7
5+
6+
exec xcrun --sdk ${SDK} nm-classic "$@"

arm-apple-darwin10-ranlib

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
#!/bin/sh
2-
exec ranlib $@
2+
3+
SDK=iphoneos
4+
ARCH=armv7
5+
6+
exec xcrun --sdk ${SDK} ranlib $@

0 commit comments

Comments
 (0)