aboutsummaryrefslogtreecommitdiffstats
path: root/arm-stmos/create-toolchain.sh
blob: 1df12ee127d70547439fdabd78bdbeda57a9479a (plain)
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
#!/bin/bash
#
# Based on:
# binutils 2.31.1
# gcc 8.2.0
#
# Need:
# build-essential
# bison
# flex
# libgmp3-dev
# libmpc-dev
# libmpfr-dev

# Get sources
wget https://ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.xz
wget https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.xz
tar xfv ./binutils-2.31.1.tar.xz
tar xfv ./gcc-8.2.0.tar.xz

# Apply binutils changes
for file in $(find ./binutils-files -name '*.*'); do
	cp -v $file $(echo $file | sed s/binutils-files/binutils-2.31.1/)
done

# Apply gcc changes
for file in $(find ./gcc-files -name '*.*'); do
	cp -v $file $(echo $file | sed s/gcc-files/gcc-8.2.0/)
done

# Prepare
export TARGET=arm-stmos
mkdir -p $HOME/$TARGET
export PATH="$HOME/$TARGET/bin:$PATH"

# Build binutils
cd ./binutils-2.31.1/ld
automake

mkdir ../build
cd ../build
echo "Configure binutils... (../configure)"
bash
echo "Building binutils..."
make -j8
make install

# Build gcc
cd ../../gcc-8.2.0/libstdc++-v3/
autoconf

mkdir ../build
cd ../build
echo "Configure gcc... (../configure)"
bash
echo "Building gcc..."
make -j8
make install