-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildxx-arm
102 lines (89 loc) · 4.82 KB
/
buildxx-arm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
ARCH="$(uname -m)"
echo "*** Arch: $ARCH"
#ARM="arm-linux-gnueabi-gcc"
ARM="arm-linux-gnueabihf-gcc"
ARM64=
[[ "$ARCH" =~ ^.*64$ ]] && ARM64="aarch64-linux-gnu-gcc"
OPTS="-Ofast -Wall -pedantic -std=c++11 -ftree-vectorize"
OPTS32="$OPTS -mneon-for-64bits -mfloat-abi=hard -mlittle-endian -munaligned-access"
OPTS64="$OPTS -mlittle-endian"
OUT="bin"
[ -d "$OUT" ] || mkdir -p "$OUT"
exec( )
{
echo \#$*
$*
[ $? -eq 0 ] || exit $?
}
####################
# RPi3
#
echo ""
[ -n "$ARM64" ] && echo "*** RPi3 [ARMv8, cortex-a53] (64-bit)"
[ -n "$ARM64" ] && exec $ARM64 $OPTS64 -march=armv8-a -mcpu=cortex-a53 -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-a53-64.lst" -o "$OUT/bitscanxx-a53-64"
[ -n "$ARM64" ] && echo "*** RPi3 [ARMv8, cortex-a53] (ilp32 test compilation)"
[ -n "$ARM64" ] && exec $ARM64 $OPTS64 -march=armv8-a -mcpu=cortex-a53 -mabi=ilp32 -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 bitscan.cpp -c -Wa,-aln="$OUT/bitscanxx-a53-ilp32.lst"
echo "*** RPi3 [ARMv8, cortex-a53] (32-bit)"
#exec $ARM $OPTS32 -march=armv8-a -mcpu=cortex-a53 -mfpu=neon-fp-armv8 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-a53-32.lst" -o "$OUT/bitscanxx-a53-32"
exec $ARM $OPTS32 -mcpu=cortex-a53 -mfpu=neon-fp-armv8 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-a53-32.lst" -o "$OUT/bitscanxx-a53-32"
####################
# cortex-a57
#
echo ""
[ -n "$ARM64" ] && echo "*** [ARMv8, cortex-a57] (64-bit)"
[ -n "$ARM64" ] && exec $ARM64 $OPTS64 -march=armv8-a -mcpu=cortex-a57 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-a57-64.lst" -o "$OUT/bitscanxx-a57-64"
[ -n "$ARM64" ] && echo "*** [ARMv8, cortex-a57] (ilp32 test compilation)"
[ -n "$ARM64" ] && exec $ARM64 $OPTS64 -march=armv8-a -mcpu=cortex-a57 -mabi=ilp32 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-a57-ilp32.lst" -c
echo "*** [ARMv8, cortex-a57] (32-bit)"
#exec $ARM $OPTS32 -march=armv8-a -mcpu=cortex-a57 -mfpu=neon-fp-armv8 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-a57-32.lst" -o "$OUT/bitscanxx-a57-32"
exec $ARM $OPTS32 -mcpu=cortex-a57 -mfpu=neon-fp-armv8 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-a57-32.lst" -o "$OUT/bitscanxx-a57-32"
####################
# RPi2
#
echo ""
echo "*** RPi2 [ARMv7, cortex-a7]"
#exec $ARM $OPTS32 -march=armv7 -mcpu=cortex-a7 -mfpu=neon-vfpv4 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-armv7.lst" -o "$OUT/bitscanxx-armv7"
exec $ARM $OPTS32 -mcpu=cortex-a7 -mfpu=neon-vfpv4 bitscan.cpp -Wa,-aln="$OUT/bitscanxx-a7.lst" -o "$OUT/bitscanxx-a7"
####################
# RPi1
#
[ ! -n "$ARM64" ] && echo ""
[ ! -n "$ARM64" ] && echo "*** RPi1 [ARMv6, arm1176jzf-s]"
#### -mcpu=arm1176jzf-s, ARMv6, Thumb v3, no rbit at all, no movw:
#[ ! -n "$ARM64" ] && exec $ARM $OPTS32 -march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-armv6.lst" -Wl,--fix-arm1176 -o "$OUT/bitscanxx-armv6"
[ ! -n "$ARM64" ] && exec $ARM $OPTS32 -mcpu=arm1176jzf-s -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-arm1176jzf-s.lst" -Wl,--fix-arm1176 -o "$OUT/bitscanxx-arm1176jzf-s"
####################
# ARMv6
#
echo ""
echo "*** ARMv6T2"
#### -mcpu=arm1156t2-s, ARMv6, Thumb v4 (Thumb-2) and rbit is present (in Thumb mode), movw too?:
exec $ARM $OPTS32 -march=armv6t2 -mcpu=arm1156t2-s -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-arm1156t2-s.lst" -o "$OUT/bitscanxx-arm1156t2-s"
#### -march=armv6t2 (WRONG -mcpu!), ARMv6, Thumb v4 (Thumb-2) and rbit is present (in Thumb mode), no movw:
#exec $ARM $OPTS32 -march=armv6t2 -mcpu=arm1176jzf-s -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-armv6t2.lst" -Wl,--fix-arm1176 -o "$OUT/bitscanxx-armv6t2"
#### -mcpu=arm1136j-s, ARMv6, Thumb v3, no rbit at all, no movw:
[ ! -n "$ARM64" ] && exec $ARM $OPTS32 -mcpu=arm1136j-s -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-arm1136j-s.lst" -o "$OUT/bitscanxx-arm1136j-s"
####################
# ARMv7
#
echo ""
echo "*** ARMv7"
#### -march=armv7, ARMv7, Thumb v4 and rbit is present, movw is also here:
exec $ARM $OPTS32 -march=armv7 -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-armv7.lst" -o "$OUT/bitscanxx-armv7"
####################
# ARM Cortex-M
#
echo ""
echo "*** ARM Cortex-M"
#### -march=armv6-m, Thumb:
#exec $ARM $OPTS32 -march=armv6-m -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-armv6-m.lst" -o "$OUT/bitscanxx-armv6-m"
#### -march=armv7-m, Thumb-2 with rbit, etc.:
[ -n "$ARM64" ] && exec $ARM $OPTS32 -march=armv7-m -mfpu=vfp bitscan.cpp -c -Wa,-aln="$OUT/bitscanxx-armv7-m.lst"
[ ! -n "$ARM64" ] && exec $ARM $OPTS32 -march=armv7-m -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-armv7-m.lst" -o "$OUT/bitscanxx-armv7-m"
#### -march=armv8-m.base, Thumb:
#exec $ARM $OPTS32 -march=armv8-m.base -mfpu=vfp bitscan.cpp -Wa,-aln="$OUT/bitscanxx-armv8-m.base.lst" -o "$OUT/bitscanxx-armv8-m.base"
#### -march=armv8-m.main, Thumb-2 with rbit, etc.:
exec $ARM $OPTS32 -march=armv8-m.main -mfpu=vfp bitscan.cpp -c -Wa,-aln="$OUT/bitscanxx-armv8-m.main.lst"
[ $? -eq 0 ] && echo "*** All Ok! ***"
[ -e *.o ] && rm -f ./*.o