2019-09-28 00:17:56 +08:00
|
|
|
name=gcc
|
2022-04-09 08:19:46 +08:00
|
|
|
version=11.2.0
|
2020-06-12 16:42:33 +08:00
|
|
|
gmp_version=6.2.0
|
2020-11-13 13:58:01 +08:00
|
|
|
mpc_version=1.2.1
|
|
|
|
mpfr_version=4.1.0
|
2021-04-18 08:19:42 +08:00
|
|
|
source="http://ftp.gnu.org/gnu/gcc/gcc-$version/gcc-$version.tar.xz
|
2019-09-28 00:17:56 +08:00
|
|
|
http://ftp.gnu.org/gnu/gmp/gmp-$gmp_version.tar.xz
|
|
|
|
https://ftp.gnu.org/gnu/mpc/mpc-$mpc_version.tar.gz
|
2021-04-18 08:19:42 +08:00
|
|
|
http://www.mpfr.org/mpfr-$mpfr_version/mpfr-$mpfr_version.tar.xz"
|
2018-12-01 00:12:45 +08:00
|
|
|
|
2019-09-28 00:17:56 +08:00
|
|
|
build() {
|
|
|
|
cd $name-$version
|
2018-12-01 00:12:45 +08:00
|
|
|
|
2019-09-28 00:17:56 +08:00
|
|
|
mv -v ../mpfr-$mpfr_version mpfr
|
|
|
|
mv -v ../gmp-$gmp_version gmp
|
|
|
|
mv -v ../mpc-$mpc_version mpc
|
2018-12-01 00:12:45 +08:00
|
|
|
|
2021-05-04 08:20:54 +08:00
|
|
|
for file in gcc/config/linux.h gcc/config/i386/linux.h gcc/config/i386/linux64.h
|
2018-12-01 00:12:45 +08:00
|
|
|
do
|
2021-05-04 08:20:54 +08:00
|
|
|
cp -uv $file $file.orig
|
2018-12-01 00:12:45 +08:00
|
|
|
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
|
|
|
|
-e 's@/usr@/tools@g' $file.orig > $file
|
|
|
|
echo '
|
|
|
|
#undef STANDARD_STARTFILE_PREFIX_1
|
|
|
|
#undef STANDARD_STARTFILE_PREFIX_2
|
|
|
|
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
|
|
|
|
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
|
|
|
|
touch $file.orig
|
|
|
|
done
|
|
|
|
|
2020-06-28 23:38:04 +08:00
|
|
|
sed -i -e 's@/lib/ld-linux.so.2@/lib32/ld-linux.so.2@g' gcc/config/i386/linux64.h
|
|
|
|
sed -i -e '/MULTILIB_OSDIRNAMES/d' gcc/config/i386/t-linux64
|
|
|
|
echo "MULTILIB_OSDIRNAMES = m64=../lib m32=../lib32 mx32=../libx32" >> gcc/config/i386/t-linux64
|
2018-12-01 00:12:45 +08:00
|
|
|
|
|
|
|
mkdir -v build
|
|
|
|
cd build
|
|
|
|
|
2020-06-28 23:38:04 +08:00
|
|
|
../configure \
|
2018-12-01 00:12:45 +08:00
|
|
|
--target=$LFS_TGT \
|
|
|
|
--prefix=/tools \
|
|
|
|
--with-glibc-version=2.11 \
|
|
|
|
--with-sysroot=$LFS \
|
|
|
|
--with-newlib \
|
|
|
|
--without-headers \
|
|
|
|
--with-local-prefix=/tools \
|
|
|
|
--with-native-system-header-dir=/tools/include \
|
|
|
|
--disable-nls \
|
|
|
|
--disable-shared \
|
|
|
|
--disable-decimal-float \
|
|
|
|
--disable-threads \
|
|
|
|
--disable-libatomic \
|
|
|
|
--disable-libgomp \
|
|
|
|
--disable-libmpx \
|
|
|
|
--disable-libquadmath \
|
|
|
|
--disable-libssp \
|
|
|
|
--disable-libvtv \
|
|
|
|
--disable-libstdcxx \
|
2020-06-28 23:38:04 +08:00
|
|
|
--enable-languages=c,c++ \
|
|
|
|
--with-multilib-list=m32,m64
|
2018-12-01 00:12:45 +08:00
|
|
|
make
|
|
|
|
make install
|
2019-09-28 00:17:56 +08:00
|
|
|
}
|