blob: 1c5f3e7b8f9d8a34440aeb1583094489f08b3b61 (
plain) (
blame)
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
|
#!/bin/bash
set -xe
name=gcc
version=8.4.0
url=http://mirrors.concertpass.com/gcc/releases/${name}-${version}/${name}-${version}.tar.gz
src=${name}-${version}
bld=${src}_build
version_isl=0.20
url_isl=http://isl.gforge.inria.fr/isl-${version_isl}.tar.bz2
version_cloog=0.18.4
url_cloog="http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-${version_cloog}.tar.gz"
# Ensure 64-bit libraries go into /lib
sudo ln -sf ${TOOLCHAIN_LIB} ${TOOLCHAIN}/lib64
curl -LO ${url}
tar xf ${src}.tar.gz
mkdir -p ${bld}
pushd ${src}
unset CFLAGS
unset LDFLAGS
# Disable fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
# Use /lib, not /lib64
#sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
#sed -i 's/lib64/lib/g' gcc/config.gcc
#sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
# Download MPFR and friends
./contrib/download_prerequisites
curl -LO ${url_isl}
tar xf $(basename ${url_isl})
ln -s isl-${version_isl} isl
curl -LO ${url_cloog}
tar xf $(basename ${url_cloog})
ln -s cloog-${version_cloog} cloog
popd
pushd ${bld}
# Beware: x86_64-only toolchain (multilib disabled)
../${src}/configure \
--prefix=${TOOLCHAIN} \
--libdir=${TOOLCHAIN_LIB} \
--libexecdir=${TOOLCHAIN_LIB} \
--disable-bootstrap \
--disable-multilib \
--disable-werror \
--disable-libunwind-exceptions \
--disable-libstdcxx-pch \
--disable-libssp \
--with-system-zlib \
--with-isl \
--with-linker-hash-style=gnu \
--with-tune=generic \
--enable-languages=c,c++,fortran,lto,go \
--enable-shared \
--enable-threads=posix \
--enable-libmpx \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-gnu-unique-object \
--enable-linker-build-id \
--enable-lto \
--enable-plugin \
--enable-install-libiberty \
--enable-gnu-indirect-function \
--enable-default-pie \
--enable-default-ssp \
--enable-cet=auto \
--enable-checking=release
make -j${_maxjobs}
make install-strip
# Create compiler links
ln -sf gcc ${TOOLCHAIN_BIN}/cc
# Prevent ldconfig from picking up gdb python scripts
autoload="${TOOLCHAIN_DATA}/gdb/auto-load${TOOLCHAIN_LIB}"
mkdir -p "${autoload}"
mv -v "${TOOLCHAIN_LIB}"/*gdb.py "${autoload}"
# Binutils build cannot use this static archive
rm -f "${TOOLCHAIN_LIB}/libiberty.a"
# Enforce global linkage to toolchain
/bin/echo "${TOOLCHAIN_LIB}" > gcc.conf
sudo cp -a gcc.conf /etc/ld.so.conf.d
sudo ldconfig
popd
|