milis/talimatname/onsistem/0gcc_pass2/talimat

69 lines
1.9 KiB
Plaintext
Raw Normal View History

2016-02-24 01:27:23 +01:00
version=5.3.0
source=(\
http://ftp.gnu.org/gnu/gmp/gmp-6.1.0.tar.xz \
http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.xz \
http://www.multiprecision.org/mpc/download/mpc-1.0.3.tar.gz \
http://ftp.gnu.org/gnu/gcc/gcc-$version/gcc-$version.tar.bz2 )
2017-10-27 23:59:41 +02:00
derle()
2016-02-24 01:27:23 +01:00
{
cd gcc-$version
cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/include-fixed/limits.h
for file in \
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
cp -uv $file{,.orig}
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
mv -v ../mpfr-3.1.3 mpfr
mv -v ../gmp-6.1.0 gmp
mv -v ../mpc-1.0.3 mpc
mkdir -v build
cd build
CC=$LFS_TGT-gcc \
CXX=$LFS_TGT-g++ \
AR=$LFS_TGT-ar \
RANLIB=$LFS_TGT-ranlib \
../configure \
--prefix=/tools \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--enable-languages=c,c++ \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-bootstrap \
--disable-libgomp
make
make install
ln -sv gcc /tools/bin/cc
echo 'main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'
rm -v dummy.c a.out
mkdir -p $LFS/usr/lib
ln -sv /tools/lib/libgcc_s.so{,.1} $LFS/usr/lib
ln -sv /tools/lib/libstdc++.so{,.6} $LFS/usr/lib
sed 's/tools/usr/' /tools/lib/libstdc++.la > $LFS/usr/lib/libstdc++.la
}