Skip to content

Commit 31f41d4

Browse files
author
Jason Mobarak
committed
Finalize cross compiler config for wrapper scripts
+ Add support for the Linaro toolchain in our current version of buildroot + Fix the support for the "built-in" toolchain that comes from Ubuntu 16.04
1 parent d064513 commit 31f41d4

File tree

3 files changed

+87
-18
lines changed

3 files changed

+87
-18
lines changed

bin/arm-linux-gnueabihf-clang

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
11
#!/bin/bash
22

3-
D=$( (cd `dirname $0`/../.. >/dev/null; pwd -P) )
4-
R=$D/sysroot
3+
if [[ "${LLVM_OBF_USE_BR_TOOLCHAIN}" ]]; then
4+
5+
T=${HOST_DIR}/opt/ext-toolchain
6+
export LD_LIBRARY_PATH="${T}/lib/gcc/arm-linux-gnueabihf/6.2.1"
7+
8+
TOOLCHAIN_OPTS="\
9+
--sysroot=${T}/arm-linux-gnueabihf/libc \
10+
\
11+
-fuse-ld=${T}/arm-linux-gnueabihf/bin/ld \
12+
\
13+
-B ${T}/lib/gcc/arm-linux-gnueabihf/6.2.1/ \
14+
\
15+
-L ${T}/lib/gcc/arm-linux-gnueabihf/6.2.1/ \
16+
-L /piksi_buildroot/buildroot/host_output/host/opt/ext-toolchain/lib/gcc/i686-pc-linux-gnu/4.7.2"
17+
18+
else
19+
20+
D=$( (cd `dirname $0`/../.. >/dev/null; pwd -P) )
21+
R=$D/sysroot
22+
23+
export LD_LIBRARY_PATH="${R}/usr/lib/x86_64-linux-gnu"
24+
25+
TOOLCHAIN_OPTS="\
26+
\
27+
-fuse-ld=${R}/usr/arm-linux-gnueabihf/bin/ld \
28+
--sysroot=${R} \
29+
\
30+
-B ${R}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8 \
31+
\
32+
-I ${R}/usr/arm-linux-gnueabihf/include \
33+
\
34+
-L ${R}/usr/arm-linux-gnueabi/libhf \
35+
-L ${R}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8 \
36+
-L ${R}/usr/lib/x86_64-linux-gnu"
37+
fi
538

639
${D}/bin/clang \
7-
-I ${R}/usr/arm-linux-gnueabihf/include \
8-
-L ${R}/usr/arm-linux-gnueabi/libhf \
9-
-fuse-ld=${R}/usr/arm-linux-gnueabihf/bin/ld \
40+
${TOOLCHAIN_OPTS} \
1041
-ccc-gcc-name arm-linux-gnueabihf-gcc \
1142
--target=arm-linux-gnueabihf \
1243
-mfloat-abi=hard \

bin/arm-linux-gnueabihf-clang++

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
11
#!/bin/bash
22

3-
D=$( (cd `dirname $0`/../.. >/dev/null; pwd -P) )
4-
R=$D/sysroot
3+
if [[ "${LLVM_OBF_USE_BR_TOOLCHAIN}" ]]; then
4+
5+
T=${HOST_DIR}/opt/ext-toolchain
6+
export LD_LIBRARY_PATH="${T}/lib/gcc/arm-linux-gnueabihf/6.2.1"
7+
8+
TOOLCHAIN_OPTS="\
9+
--sysroot=${T}/arm-linux-gnueabihf/libc \
10+
\
11+
-fuse-ld=${T}/arm-linux-gnueabihf/bin/ld \
12+
\
13+
-B ${T}/lib/gcc/arm-linux-gnueabihf/6.2.1/ \
14+
\
15+
-I ${T}/arm-linux-gnueabihf/include/c++/6.2.1/ \
16+
-I ${T}/arm-linux-gnueabihf/include/c++/6.2.1/arm-linux-gnueabihf/ \
17+
\
18+
-L ${T}/lib/gcc/arm-linux-gnueabihf/6.2.1/ \
19+
-L /piksi_buildroot/buildroot/host_output/host/opt/ext-toolchain/lib/gcc/i686-pc-linux-gnu/4.7.2"
20+
21+
else
22+
23+
D=$( (cd `dirname $0`/../.. >/dev/null; pwd -P) )
24+
R=$D/sysroot
25+
26+
export LD_LIBRARY_PATH="${R}/usr/lib/x86_64-linux-gnu"
27+
28+
TOOLCHAIN_OPTS="\
29+
\
30+
-fuse-ld=${R}/usr/arm-linux-gnueabihf/bin/ld \
31+
--sysroot=${R} \
32+
\
33+
-B ${R}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8 \
34+
\
35+
-I ${R}/usr/arm-linux-gnueabihf/include \
36+
-I ${R}/usr/arm-linux-gnueabihf/include/c++/4.8.5 \
37+
-I ${R}/usr/arm-linux-gnueabihf/include/c++/4.8.5/arm-linux-gnueabihf \
38+
\
39+
-L ${R}/usr/arm-linux-gnueabi/libhf \
40+
-L ${R}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8 \
41+
-L ${R}/usr/lib/x86_64-linux-gnu"
42+
fi
543

644
${D}/bin/clang++ \
7-
-I ${R}/usr/arm-linux-gnueabihf/include \
8-
-L ${R}/usr/arm-linux-gnueabi/libhf \
9-
-I ${R}/usr/arm-linux-gnueabihf/include/c++/4.8.5/ \
10-
-L ${R}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/ \
11-
-I ${R}/usr/arm-linux-gnueabihf/include/c++/4.8.5/arm-linux-gnueabihf \
12-
-fuse-ld=${R}/usr/arm-linux-gnueabihf/bin/ld \
45+
${TOOLCHAIN_OPTS} \
1346
-ccc-gcc-name arm-linux-gnueabihf-gcc \
1447
--target=arm-linux-gnueabihf \
1548
-mfloat-abi=hard \

stage_sysroot.bash

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@ stage_sysroot() {
1010
mkdir -p "$OUT"
1111

1212
SYSROOT_DIRS=(
13-
"/usr/arm-linux-gnueabihf/include"
14-
"/usr/arm-linux-gnueabi/libhf"
15-
"/usr/arm-linux-gnueabihf/include/c++/4.8.5"
13+
"/usr/arm-linux-gnueabihf"
14+
"/usr/arm-linux-gnueabi"
1615
"/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8"
17-
"/usr/arm-linux-gnueabihf/include/c++/4.8.5/arm-linux-gnueabihf"
18-
"/usr/arm-linux-gnueabihf/bin"
1916
)
2017

2118
for SYSROOT_DIR in ${SYSROOT_DIRS[@]}; do
@@ -47,6 +44,14 @@ stage_sysroot() {
4744
for BINTOOL in ${BINTOOLS[@]}; do
4845
cp -v ${BINTOOL} "${OUT}/usr/bin/"
4946
done
47+
48+
D="${OUT}/usr/lib/x86_64-linux-gnu/"
49+
50+
mkdir -p "$D"
51+
52+
for ARMHF in /usr/lib/x86_64-linux-gnu/*armhf*; do
53+
cp -v "${ARMHF}" "$D/"
54+
done
5055
}
5156

5257
run() {

0 commit comments

Comments
 (0)