|
| 1 | +# Tool Chain: GCC-8.2.0 PASS 2 of 2 |
| 2 | +# Build and install as mlfs |
| 3 | + |
| 4 | +export CC="${MLFS_TARGET}-gcc" |
| 5 | +export CXX="${MLFS_TARGET}-g++" |
| 6 | +export AR="${MLFS_TARGET}-ar" |
| 7 | +export AS="${MLFS_TARGET}-as" |
| 8 | +export RANLIB="${MLFS_TARGET}-ranlib" |
| 9 | +export LD="${MLFS_TARGET}-ld" |
| 10 | +export STRIP="${MLFS_TARGET}-strip" |
| 11 | + |
| 12 | +tar -xf ../mpfr-4.0.1.tar.xz |
| 13 | +mv -v mpfr-4.0.1 mpfr |
| 14 | +tar -xf ../gmp-6.1.2.tar.xz |
| 15 | +mv -v gmp-6.1.2 gmp |
| 16 | +tar -xf ../mpc-1.1.0.tar.gz |
| 17 | +mv -v mpc-1.1.0 mpc |
| 18 | + |
| 19 | +# Apply patches from Void-Linux |
| 20 | +patch -Np0 -i ../gcc-8.2.0-void-0016-invalid_tls_model.diff |
| 21 | +patch -Np0 -i ../gcc-8.2.0-void-fix-cxxflags-passing.patch |
| 22 | +patch -Np0 -i ../gcc-8.2.0-void-fix-musl-execinfo.patch |
| 23 | +patch -Np0 -i ../gcc-8.2.0-void-no-stack_chk_fail_local.patch |
| 24 | + |
| 25 | +cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \ |
| 26 | + `dirname $($MLFS_TARGET-gcc -print-libgcc-file-name)`/include-fixed/limits.h |
| 27 | +for file in gcc/config/{linux,i386/linux{,64}}.h |
| 28 | +do |
| 29 | + cp -uv $file{,.orig} |
| 30 | + sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ |
| 31 | + -e 's@/usr@/tools@g' $file.orig > $file |
| 32 | + echo ' |
| 33 | +#undef STANDARD_STARTFILE_PREFIX_1 |
| 34 | +#undef STANDARD_STARTFILE_PREFIX_2 |
| 35 | +#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" |
| 36 | +#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file |
| 37 | + touch $file.orig |
| 38 | +done |
| 39 | + |
| 40 | +case $(uname -m) in |
| 41 | + x86_64) |
| 42 | + sed -e '/m64=/s/lib64/lib/' \ |
| 43 | + -i.orig gcc/config/i386/t-linux64 |
| 44 | + ;; |
| 45 | +esac |
| 46 | + |
| 47 | +mkdir -v build && cd build |
| 48 | +../configure \ |
| 49 | + --target=${MLFS_TARGET} \ |
| 50 | + --build=${MLFS_HOST} \ |
| 51 | + --host=${MLFS_TARGET} \ |
| 52 | + --prefix=/tools \ |
| 53 | + --with-local-prefix=/tools \ |
| 54 | + --with-native-system-header-dir=/tools/include \ |
| 55 | + --enable-languages=c,c++ \ |
| 56 | + --disable-libstdcxx-pch \ |
| 57 | + --disable-multilib \ |
| 58 | + --disable-bootstrap \ |
| 59 | + --disable-libgomp \ |
| 60 | + --disable-libmpx \ |
| 61 | + --disable-libquadmath \ |
| 62 | + --disable-libssp \ |
| 63 | + --disable-libvtv \ |
| 64 | + --disable-symvers \ |
| 65 | + --disable-libitm \ |
| 66 | + --disable-gnu-indirect-function \ |
| 67 | + --disable-libmudflap \ |
| 68 | + --disable-libsanitizer \ |
| 69 | + --disable-libcilkrts |
| 70 | + |
| 71 | +PATH=/bin:/usr/bin:/cross-tools/bin:/tools/bin make |
| 72 | + |
| 73 | +make install |
| 74 | +ln -sv gcc /tools/bin/cc |
0 commit comments