-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgcc.sh
More file actions
executable file
·53 lines (40 loc) · 1.18 KB
/
gcc.sh
File metadata and controls
executable file
·53 lines (40 loc) · 1.18 KB
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
# See LICENSE for license details.
#!/bin/bash
set -euo pipefail
unpack_src() {
tar xf gcc-10.2.0.tar.xz && \
cd gcc-10.2.0
return
}
configure() {
case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
-i.orig gcc/config/i386/t-linux64
;;
esac
mkdir -v build
cd build
../configure --prefix=/usr \
LD=ld \
--enable-languages=c,c++ \
--disable-multilib \
--disable-bootstrap \
--with-system-zlib
return
}
make_install() {
mkdir -p $TODD_FAKE_ROOT_DIR/{lib,usr/lib/bfd-plugins/}
make
ulimit -s 32768
# chown -Rv tester .
# su tester -c "PATH=$PATH make -k check"
# ../contrib/test_summary
make DESTDIR=$TODD_FAKE_ROOT_DIR install
rm -rf $TODD_FAKE_ROOT_DIR/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include-fixed/bits/
chown -v -R root:root $TODD_FAKE_ROOT_DIR/usr/lib/gcc/*linux-gnu/10.2.0/include{,-fixed}
ln -sv ../usr/bin/cpp $TODD_FAKE_ROOT_DIR/lib/cpp
ln -sfv ../../libexec/gcc/x86_64-pc-linux-gnu/10.2.0/liblto_plugin.so $TODD_FAKE_ROOT_DIR/usr/lib/bfd-plugins/
}
# TODO: test this toolchain
unpack_src && configure && make_install