-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCH08.27-gcc-modified.sh
71 lines (59 loc) · 1.75 KB
/
CH08.27-gcc-modified.sh
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
#!/bin/bash
if [ "`whoami`" == "root" ]; then
echo "Danger, Will Robinson!"
echo "Do not execute me as r00t"
exit 1
elif [ ! -f gcc-14.2.0.tar.xz ]; then
echo "The GCC source tarball gcc-14.2.0.tar.xz"
echo "must exist in same directory this script"
echo "is run from."
exit 1
fi
[ -d gcc-14.2.0 ] && rm -rf gcc-14.2.0
tar -Jxf gcc-14.2.0.tar.xz
export PATH=/opt/gcc-bootstrap/bin:${PATH}
cd gcc-14.2.0
sed -e '/m64=/s/lib64/lib/' \
-i.orig gcc/config/i386/t-linux64
mkdir build && cd build
../configure --prefix=/usr \
LD=ld \
--enable-default-pie \
--enable-default-ssp \
--disable-multilib \
--disable-fixincludes \
--with-system-zlib \
--enable-linker-build-id \
--enable-languages=c,c++,ada,d
make -j4
if [ $? -ne 0 ]; then
echo "Failed building gcc"
exit 1
fi
sed -e '/cpython/d' -i ../gcc/testsuite/gcc.dg/plugin/plugin.exp
sed -e 's/no-pic /&-no-pie /' -i ../gcc/testsuite/gcc.target/i386/pr113689-1.c
sed -e 's/300000/(1|300000)/' -i ../libgomp/testsuite/libgomp.c-c++-common/pr109062.c
sed -e 's/{ target nonpic } //' \
-e '/GOTPCREL/d' -i ../gcc/testsuite/gcc.target/i386/fentryname3.c
CWD="`pwd`"
echo
echo "Running tests. This will take a VERY long time. Watch the tests in"
echo "another console via:"
echo
echo " tail -f ${CWD}/gcc.check.log"
echo
make -k check > gcc.check.log
echo
echo
echo "To review the tests:"
echo
echo " cd ${CWD}"
echo
echo "View the file \"gcc.check.log\" and search for the term 'Summary'"
echo
echo "If all looks good, as root run:"
echo
echo " make install"
echo
echo "You probably should delete the .la libtool files installed"
echo "in /usr/lib"