*************************************************************** *************************************************************** # # # build temp-system mit GNU LibC 2.11.3 # # gcc, gc++, gcj, gcobjc -> 4.7.4 # # 2015-02-18 # svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch # ergibt dann einen 4.7.4 # 'gcc (GCC) 4.7.4' # angefangen mit gcc-4.5.4 exit 1 # http://www.linuxfromscratch.org/lfs/view/6.6/index.html # http://www.linuxfromscratch.org/lfs/view/7.2 # http://www.linuxfromscratch.org/patches/downloads/ # http://oss.erdfunkstelle.de/lfs-de/6.4/online/chapter05/gcc-pass1.html Basis LFS 7.2 und SuSE-12.2/3 gmp-dev mpfr-dev mp-dev ------------------------------- weiter mit User lfs su - lfs #.bashrc set +h umask 022 LFS=/data/2_15 LC_ALL=POSIX #LFS_TGT=$(uname -m)-lfs-linux-gnu LFS_TGT=i486-lfs-linux-gnu PATH=/tools/bin:/bin:/usr/bin export LFS LC_ALL LFS_TGT PATH #env TERM=xterm LC_ALL=POSIX LFS=/data/2_15 PATH=/tools/bin:/bin:/usr/bin PWD=/data/2_15/source LFS_TGT=i486-lfs-linux-gnu PS1=\u:\w\$ SHLVL=1 HOME=/home/lfs # binutils 2.23.2 # patches from SuSE-12.3 with rpm tar xf binutils-2.23.2.tar.xz && mkdir -v binutils-pass1 && cd binutils-pass1 ../binutils-2.23.2/configure \ --prefix=/tools \ --with-sysroot=$LFS \ --with-lib-path=/tools/lib \ --target=$LFS_TGT \ --disable-nls \ --disable-werror make make install # gcc-4.7.4 # gcc-4_7-branch # with patches form SuSE 12.3 # gcc-4.7.2-20130108 with rpm tar xf gcc-4_7-branch.tar.xz tar xf gcc-4.7.4-20140108.tar.xz 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 sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure cp gcc/BASE-VER gcc/FULL-VER mkdir -v gcc-pass1 && cd gcc-pass1 ../gcc-4.7.4-20140108/configure \ --target=$LFS_TGT \ --prefix=/tools \ --with-sysroot=$LFS \ --with-newlib \ --without-headers \ --with-local-prefix=/tools \ --with-native-system-header-dir=/tools/include \ --disable-nls \ --disable-shared \ --disable-multilib \ --disable-decimal-float \ --disable-threads \ --disable-libmudflap \ --disable-libssp \ --disable-libgomp \ --disable-libquadmath \ --enable-languages=c make make install ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'` # Installation von Linux-API-Header 3.2.54-eisfair-1 exit cd /usr/src/linux make mrproper make headers_check make INSTALL_HDR_PATH=dest headers_install su -lfs cp -rv dest/include/* /tools/include # glibc-2.15 tar xf glibc-2.15.tar.xz patches from SuSE-12.2 with rpm patch fuer sed, texinfo, cpuid.h fix for cpuid.h http://lists.linuxfromscratch.org/pipermail/lfs-dev/attachments/20110604/75703526/attachment.ksh sed -i 's/ -lgcc_s//' Makeconfig mkdir -v glibc-pass1 && cd glibc-pass1 ../glibc-2.15/configure \ --prefix=/tools \ --host=$LFS_TGT \ --build=$(../glibc-2.15/scripts/config.guess) \ --disable-profile \ --enable-add-ons \ --enable-kernel=2.6.0 \ --with-headers=/tools/include \ libc_cv_forced_unwind=yes \ libc_cv_ctors_header=yes \ libc_cv_c_cleanup=yes configure: running configure fragment for add-on libidn configure: running configure fragment for add-on noversion configure: running configure fragment for add-on nptl make make install echo 'main(){}' > dummy.c $LFS_TGT-gcc dummy.c readelf -l a.out | grep ': /tools' [Requesting program interpreter: /tools/lib/ld-linux.so.2] rm -v dummy.c a.out ========================================================= 2. Durchlauf # binutils 2.23.2 mkdir -v binutils-pass2 && cd binutils-pass2 CC=$LFS_TGT-gcc \ AR=$LFS_TGT-ar \ RANLIB=$LFS_TGT-ranlib \ ../binutils-2.23.2/configure \ --prefix=/tools \ --disable-nls \ --with-lib-path=/tools/lib \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install make -C ld clean make -C ld LIB_PATH=/usr/lib:/lib cp -v ld/ld-new /tools/bin # gcc-4.7.4 tar xf gcc-4.7.4-20140108.tar.xz cd gcc-4.7.4-20140108 cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \ `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/include-fixed/limits.h cp -v gcc/Makefile.in{,.tmp} sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \ > gcc/Makefile.in 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 cp gcc/BASE-VER gcc/FULL-VER gmp-5.1.3 mpfr-3.1.2 mpc-1.0.2 tar -Jxf ../mpfr-3.1.2.tar.xz mv -v mpfr-3.1.2 mpfr tar -Jxf ../gmp-5.1.3.tar.xz mv -v gmp-5.1.3 gmp tar -zxf ../mpc-1.0.2.tar.gz mv -v mpc-1.0.2cd .. mpc mkdir -v ../gcc-pass2 cd ../gcc-pass2 CC=$LFS_TGT-gcc \ AR=$LFS_TGT-ar \ RANLIB=$LFS_TGT-ranlib \ ../gcc-4.7.4-20140108/configure \ --prefix=/tools \ --with-local-prefix=/tools \ --with-native-system-header-dir=/tools/include \ --enable-clocale=gnu \ --enable-shared \ --enable-threads=posix \ --enable-__cxa_atexit \ --enable-languages=c,c++ \ --disable-libstdcxx-pch \ --disable-multilib \ --disable-bootstrap \ --disable-libgomp \ --with-mpfr-include=$(pwd)/../gcc-4.7.4-20140108/mpfr/src \ --with-mpfr-lib=$(pwd)/mpfr/src/.libs \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install ln -vs gcc /tools/bin/cc echo 'main(){}' > dummy.c cc dummy.c readelf -l a.out | grep ': /tools' [Requesting program interpreter: /tools/lib/ld-linux.so.2] rm -v dummy.c a.out # tcl-8.5.12 # patches from Suse with rpm tar xf tcl8.5.12.tar.xz cd tcl8.5.12/unix/ ./configure --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make TZ=UTC make test make install chmod -v u+w /tools/lib/libtcl8.5.so make install-private-headers ln -sv tclsh8.5 /tools/bin/tclsh # expect-5.45 # patches from Suse with rpm tar xf expect5.45.tar.xz cd expect5.45 cp -v configure{,.orig} sed 's:/usr/local/bin:/bin:' configure.orig > configure ./configure \ --prefix=/tools \ --with-tcl=/tools/lib \ --with-tclinclude=/tools/include \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make SCRIPTS="" install # dejagnu-1.5.1 tar xf dejagnu-1.5.1.tar.gz cd dejagnu-1.5.1 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # check-0.9.14 tar xf check-0.9.14.tar.gz cd check-0.9.14 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # ncurses-5.9-20150214 tar xf ncurses-5.9-20150214.tgz cd ncurses-5.9-20150214 ./configure \ --prefix=/tools \ --with-shared \ --without-debug \ --without-ada \ --enable-overwrite \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # bash-4.2-75.3.1 patches from Suse with rpm tar xf bash-4.2.tar.xz cd bash-4.2 ./configure \ --prefix=/tools \ --without-bash-malloc \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install ln -vs bash /tools/bin/sh # bzip2-1.0.6 # patches from Suse with rpm tar xf bzip2-1.0.6.tar.xz cd bzip2-1.0.6 make make PREFIX=/tools install # coreutils-8.17 patches from Suse tar xf coreutils-8.17.tar.xz cd coreutils-8.17 ./configure \ --prefix=/tools \ --enable-install-program=hostname \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # diffutils-3.3 tar xf diffutils-3.3.tar.xz cd diffutils-3.3 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # file-5.22 patches from Suse tar xf file-5.11.tar.xz file-5.11 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # findutils-4.5.14 patches from Suse tar xf findutils-4.5.14.tar.xz cd findutils-4.5.14 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # gawk-1.1.1 patches from Suse tar xf gawk-4.1.1.tar.xz cd gawk-4.1.1 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # gettext-0.19-2 patches from Suse tar xf gettext-0.19.2.tar.xz cd gettext-0.19.2 cd gettext-tools ./configure \ --prefix=/tools \ --disable-shared \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make -C gnulib-lib make -C src msgfmt cp -v src/msgfmt /tools/bin # grep-2.21 tar xf grep-2.21.tar.xz cd grep-2.21 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # gzip-1.6 patches from Suse tar xf gzip-1.6.tar.xz cd gzip-1.6 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # m4-1.4.16 patches from Suse tar xf m4-1.4.16.tar.xz cd m4-1.4.16 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # make-3.82 patches from Suse tar xf make-3.82.tar.xz cd make-3.82 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # patch-2.7.1 tar xf patch-2.7.1.tar.bz2 cd patch-2.7.1 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # perl-5.18.1 patches from Suse tar xf perl-5.18.1.tar.xz cd perl-5.18.1 sh Configure -des -Dprefix=/tools cp -v perl cpan/podlators/pod2man /tools/bin mkdir -pv /tools/lib/perl5/5.18.1 cp -Rv lib/* /tools/lib/perl5/5.18.1 # sed-4.2.2 patches from Suse tar xf sed-4.2.2.tar.xz cd sed-4.2.2 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # tar-1.28 patches from Suse tar xf tar-1.28.tar.xz cd tar-1.28 # automake-1.14 is missing autoreconf -fi ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # texinfo-4.13 patches from Suse 4.13 required from glibc-2.15 tar xf texinfo-4.13.tar.xz cd texinfo-4.13 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install # xz-5.0.7 tar xf xz-5.0.7.tar.gz cd xz-5.0.7 ./configure \ --prefix=/tools \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make make install ================================================================ # Basissystem aufbauen als root mkdir -pv $LFS/{dev,proc,sys} mknod -m 600 $LFS/dev/console c 5 1 mknod -m 666 $LFS/dev/null c 1 3 # Platten einhaengen mount -v --bind /dev $LFS/dev mount -vt devpts devpts $LFS/dev/pts mount -vt tmpfs shm $LFS/dev/shm mount -vt proc proc $LFS/proc mount -vt sysfs sysfs $LFS/sys # Chrooten chroot "$LFS" /tools/bin/env -i \ HOME=/root \ TERM="$TERM" \ PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ /tools/bin/bash --login +h # Ordnerstruktur erstellen mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib,mnt,opt,run} mkdir -pv /{media/{floppy,cdrom},sbin,srv,var} install -dv -m 0750 /root install -dv -m 1777 /tmp /var/tmp mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src} mkdir -pv /usr/{,local/}share/{doc,info,locale,man} mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo} mkdir -pv /usr/{,local/}share/man/man{1..8} for dir in /usr /usr/local; do ln -sv share/{man,doc,info} $dir done case i486 in x86_64) ln -sv lib /lib64 && ln -sv lib /usr/lib64 ;; esac mkdir -v /var/{log,mail,spool} ln -sv /run /var/run ln -sv /run/lock /var/lock mkdir -pv /var/{opt,cache,lib/{misc,locate},local} # Dateien erstellen ln -sv /tools/bin/{bash,cat,echo,pwd,stty} /bin ln -sv /tools/bin/perl /usr/bin ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib ln -sv /tools/lib/libstdc++.so{,.6} /usr/lib sed 's/tools/usr/' /tools/lib/libstdc++.la > /usr/lib/libstdc++.la ln -sv bash /bin/sh touch /etc/mtab cat > /etc/passwd << "EOF" root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/dev/null:/bin/false nobody:x:99:99:Unprivileged User:/dev/null:/bin/false EOF cat > /etc/group << "EOF" root:x:0: bin:x:1: sys:x:2: kmem:x:3: tape:x:4: tty:x:5: daemon:x:6: floppy:x:7: disk:x:8: lp:x:9: dialout:x:10: audio:x:11: video:x:12: utmp:x:13: usb:x:14: cdrom:x:15: mail:x:34: nogroup:x:99: EOF exec /tools/bin/bash --login +h touch /var/log/{btmp,lastlog,wtmp} chgrp -v utmp /var/log/lastlog chmod -v 664 /var/log/lastlog chmod -v 600 /var/log/btmp # loss gehts ;-) # Linux Header 3.2.54 # eiskernel: 2.8.0 (3.2.54-eisfair-1-SMP) su - holbru make mrproper make headers_check make INSTALL_HDR_PATH=dest headers_install find dest/include \( -name .install -o -name ..install.cmd \) -delete cp -rv dest/include/* /data/2_15/usr/include # chroot # Man-pages 3.69 # weill es in lfs steht ;-) patches from Suse tar xf man-pages-3.69.tar.xz cd man-pages-3.69 make install # glibc-2.15 patches from Suse rm -rf glibc-2.15 tar xf glibc-2.15.tar.xz cd glibc-2.15 # 2016-02-19 # security patches #glibc-CVE-2015-7547-patch_1of3_dns_host.c.diff #glibc-CVE-2015-7547-patch_2of3_res_query.c.diff #glibc-CVE-2015-7547-patch_3of3_res_send.c.diff sed -i 's##"rpc/types.h"#' sunrpc/rpc_clntout.c sed -i '/test-installation.pl/d' Makefile sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in mkdir -v ../glibc-build cd ../glibc-build mkdir -v ../glibc-build-20160219 cd ../glibc-build-20160219 ../glibc-2.15/configure \ --prefix=/usr \ --disable-profile \ --enable-add-ons \ --enable-kernel=2.6.0 \ --libexecdir=/usr/lib/glibc \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu configure: running configure fragment for add-on libidn configure: running configure fragment for add-on noversion configure: running configure fragment for add-on nptl make make -k check 2>&1 | tee glibc-check-log TIMEOUTFACTOR=32 make -k check 2>&1 | tee glibc-check-log grep Error glibc-check-log root:/source/glibc-build# grep Error glibc-check-log make[2]: [/source/glibc-build/posix/annexc.out] Error 1 (ignored) root:/source/glibc-build# build-2016-02-19 root:/source/glibc-build-20160219# grep Error glibc-check-log make[2]: [/source/glibc-build-20160219/posix/annexc.out] Error 1 (ignored) root:/source/glibc-build-20160219# touch /etc/ld.so.conf make install cp -v ../glibc-2.15/sunrpc/rpc/*.h /usr/include/rpc cp -v ../glibc-2.15/sunrpc/rpcsvc/*.h /usr/include/rpcsvc cp -v ../glibc-2.15/nis/rpcsvc/*.h /usr/include/rpcsvc # localedata/SUPPORTED bereinigt make localedata/install-locales ###################### # libc extrahieren make install_root=/public/glibc-2.15-stripped install make install_root=/public/glibc-2.15-stripped localedata/install-locales cp -v ../glibc-2.15/sunrpc/rpc/*.h /public/glibc-2.15-stripped/usr/include/rpc cp -v ../glibc-2.15/sunrpc/rpcsvc/*.h /public/glibc-2.15-stripped/usr/include/rpcsvc cp -v ../glibc-2.15/nis/rpcsvc/*.h /public/glibc-2.15-stripped/usr/include/rpcsvc build-2016-02-19 make install_root=/public/glibc-2.15-2-stripped install cp -v ../glibc-2.15/sunrpc/rpc/*.h /public/glibc-2.15-2-stripped/usr/include/rpc cp -v ../glibc-2.15/sunrpc/rpcsvc/*.h /public/glibc-2.15-2-stripped/usr/include/rpcsvc cp -v ../glibc-2.15/nis/rpcsvc/*.h /public/glibc-2.15-2-stripped/usr/include/rpcsvc # kernel header hinzufuegen # aus dem installierten System nehmen, da Changes durch GLibC moeglich /usr/src/linux/dest -> kernel-header.tar.xz for filename in `find /public/glibc-2.15-2-stripped -type f` do echo "stripping $filename with -S" strip -S "$filename" done ###################### cat > /etc/nsswitch.conf << "EOF" # Begin /etc/nsswitch.conf passwd: files group: files shadow: files hosts: files dns networks: files protocols: files services: files ethers: files rpc: files # End /etc/nsswitch.conf EOF # timezonedata http://www.iana.org/time-zones/repository/releases/tzdata2015a.tar.gz tar -xf ../tzdata2012e.tar.gz #ZONEINFO=/public/glibc-2.15-stripped/usr/share/zoneinfo ZONEINFO=/usr/share/zoneinfo mkdir -pv $ZONEINFO/{posix,right} for tz in etcetera southamerica northamerica europe africa antarctica \ asia australasia backward pacificnew solar87 solar88 solar89 \ systemv; do zic -L /dev/null -d $ZONEINFO -y "sh yearistype.sh" ${tz} zic -L /dev/null -d $ZONEINFO/posix -y "sh yearistype.sh" ${tz} zic -L leapseconds -d $ZONEINFO/right -y "sh yearistype.sh" ${tz} done cp -v zone.tab iso3166.tab $ZONEINFO zic -d $ZONEINFO -p America/New_York unset ZONEINFO tzselect # Replace with the name of the time zone selected (e.g., Canada/Eastern). cp -v --remove-destination /usr/share/zoneinfo/ \ /etc/localtime cat > /etc/ld.so.conf << "EOF" # Begin /etc/ld.so.conf /usr/local/lib /opt/lib EOF cat >> /etc/ld.so.conf << "EOF" # Add an include directory include /etc/ld.so.conf.d/*.conf EOF mkdir /etc/ld.so.conf.d