*************************************************************** *************************************************************** # # # build temp-system mit GNU LibC 2.15 # # gcc, gc++, gcj, gcobjc -> 4.8.5 # # 2017-09-17 # angefangen mit gcc-4.8.5 exit 1 http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/x86_64-64/index.html multilib check System ############## cat > version-check.sh << "EOF" #!/bin/bash # Simple script to list version numbers of critical development tools bash --version | head -n1 | cut -d" " -f2-4 echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- bison --version | head -n1 bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 diff --version | head -n1 find --version | head -n1 gawk --version | head -n1 gcc --version | head -n1 g++ --version | head -n1 ldd $(which ${SHELL}) | grep libc.so | cut -d ' ' -f 3 | ${SHELL} | head -n 1 | cut -d ' ' -f 1-7 grep --version | head -n1 gzip --version | head -n1 make --version | head -n1 tic -V patch --version | head -n1 sed --version | head -n1 tar --version | head -n1 makeinfo --version | head -n1 xz --version | head -n1 echo 'main(){}' | gcc -v -o /dev/null -x c - > dummy.log 2>&1 if ! grep -q ' error' dummy.log; then echo "Compilation successful" && rm dummy.log else echo 1>&2 "Compilation FAILED - more development packages may need to be \ installed. If you like, you can also view dummy.log for more details." fi EOF bash version-check.sh 2>errors.log && [ -s errors.log ] && echo -e "\nThe following packages could not be found:\n$(cat errors.log)" bash, version 4.2.53(1)-release Binutils: (GNU Binutils) 2.23.2 bison (GNU Bison) 2.7.12-4996 bzip2, Version 1.0.6, 6-Sept-2010. Coreutils: 8.25 diff (GNU diffutils) 3.3 find (GNU findutils) 4.6.0 GNU Awk 4.1.1, API: 1.1 gcc (eisfair Linux) 4.8.5 g++ (eisfair Linux) 4.8.5 GNU C Library stable release version 2.15, /usr/bin/in.grep (GNU grep) 2.25 gzip 1.6 GNU Make 3.82 ncurses 5.9.20150214 GNU patch 2.7.1 sed (GNU sed) 4.2.2 tar (GNU tar) 1.29 makeinfo (GNU texinfo) 4.13 xz (XZ Utils) 5.2.2 Compilation successful ########################### weiter mit User lfs su lfs cat > ~/.bash_profile << "EOF" exec env -i HOME=${HOME} TERM=${TERM} PS1='\u:\w\$ ' /bin/bash EOF # .bashrc set +h umask 022 CLFS=/data/clfs LC_ALL=POSIX PATH=/cross-tools/bin:/bin:/usr/bin export CLFS LC_ALL PATH unset CFLAGS CXXFLAGS mkdir -v ${CLFS}/sources chmod -v a+wt ${CLFS}/sources install -dv ${CLFS}/tools ln -sv ${CLFS}/tools / install -dv ${CLFS}/cross-tools ln -sv ${CLFS}/croos-tools / lfs:/data$ export CLFS_HOST=$(echo ${MACHTYPE} | sed -e 's/-[^-]*/-cross/') lfs:/data$ export CLFS_TARGET="x86_64-unknown-linux-gnu" lfs:/data$ export CLFS_TARGET32="i686-pc-linux-gnu" lfs:/data$ export BUILD32="-m32" lfs:/data$ export BUILD64="-m64" cat >> ~/.bashrc << EOF export CLFS_HOST="${CLFS_HOST}" export CLFS_TARGET="${CLFS_TARGET}" export CLFS_TARGET32="${CLFS_TARGET32}" export BUILD32="${BUILD32}" export BUILD64="${BUILD64}" EOF ####### Stage 1 ------ # file-5.31 Installing "/build/packages/SRPMS/file-5.31-2.4.src.rpm" rpmbuild -bp --rmsource SPECS/file.spec --nodeps cp -R /build/packages/BUILD/file-5.31 . ./configure --prefix=/cross-tools --disable-static make make install ------ # kernel 3.16.47 header cd /usr/src/linux-3.16.47-eisfair-1-SMP make mrproper make ARCH=x86_64 headers_check make ARCH=x86_64 INSTALL_HDR_PATH=dest headers_install find dest/include \( -name .install -o -name ..install.cmd \) -delete ------ # m4 1.4.16 Installing "/build/packages/SRPMS/m4-1.4.16-4.5.src.rpm" rpmbuild -bp --rmsource SPECS/m4.spec cp -R /build/packages/BUILD/m4-1.4.16 . ./configure --prefix=/cross-tools make make install ------ # ncurses 5.9 tar xf ncurses-5.9.tar.bz2 ./configure --prefix=/cross-tools \ --without-debug --without-shared make -C include make -C progs tic install -v -m755 progs/tic /cross-tools/bin ------ # pkg-config 0.28 Installing "/build/packages/SRPMS/pkg-config-0.28-9.54.src.rpm" rpmbuild -bp --rmsource SPECS/pkg-config.spec cp -R /build/packages/BUILD/pkg-config-0.28 . ./configure --prefix=/cross-tools --host=${CLFS_TARGET} \ --with-pc-path=/tools/lib64/pkgconfig:/tools/share/pkgconfig \ --with-internal-glib make make install ------ # gmp 5.1.3 Installing "/build/packages/SRPMS/gmp-5.1.3-5.46.src.rpm" rpmbuild -bp --rmsource SPECS/gmp.spec cp -R /build/packages/BUILD/gmp-5.1.3/ . ./configure --prefix=/cross-tools --enable-cxx \ --disable-static make make install ------ # mpfr 3.1.2 Installing "/build/packages/SRPMS/mpfr-3.1.2-11.53.src.rpm" rpmbuild -bp --rmsource SPECS/mpfr.spec --nodeps cp -R /build/packages/BUILD/mpfr-3.1.2/ . LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ ./configure --prefix=/cross-tools \ --disable-static --with-gmp=/cross-tools make make install ------ # mpc 1.0.2 Installing "/build/packages/SRPMS/mpc-1.0.2-4.55.src.rpm" rpmbuild -bp --rmsource SPECS/mpc.spec --nodeps cp -R /build/packages/BUILD/mpc-1.0.2/ . LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ ./configure --prefix=/cross-tools --disable-static \ --with-gmp=/cross-tools --with-mpfr=/cross-tools make make install ------ # isl 0.12.2 tar xf isl-0.12.2.tar.bz2 LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ ./configure --prefix=/cross-tools --disable-static \ --with-gmp-prefix=/cross-tools make make install ------ # binutils 2.26.1 Installing "/build/packages/SRPMS/binutils-2.26.1-9.3.1.src.rpm" rpmbuild -bp --rmsource SPECS/binutils.spec --nodeps cp -R /build/packages/BUILD/binutils-2.26.1/ . mkdir -v binutils-build cd binutils-build AR=ar AS=as ../binutils-2.26.1/configure \ --prefix=/cross-tools --host=${CLFS_HOST} --target=${CLFS_TARGET} \ --with-sysroot=${CLFS} --with-lib-path=/tools/lib:/tools/lib64 \ --disable-nls --disable-static --enable-64-bit-bfd --disable-werror make make install ------ # gcc 5.3.1 static tar xf gcc-5.3.1-r233831.tar.bz2 echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h touch /tools/include/limits.h mkdir gcc-build cd gcc-build AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ ../gcc-5.3.1-r233831/configure --prefix=/cross-tools \ --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \ --with-sysroot=${CLFS} --with-local-prefix=/tools \ --with-native-system-header-dir=/tools/include --disable-nls \ --disable-shared --with-mpfr=/cross-tools --with-gmp=/cross-tools \ --with-mpc=/cross-tools --without-headers --with-newlib \ --disable-decimal-float --disable-libgomp --disable-libmudflap \ --disable-libssp --disable-libatomic --disable-libitm \ --disable-libsanitizer --disable-libquadmath --disable-threads \ --disable-target-zlib --with-system-zlib --with-isl=/cross-tools \ --enable-languages=c --enable-checking=release make all-gcc all-target-libgcc make install-gcc install-target-libgcc ------ # glibc 2.22 32bit tar xf glibc-2.22.tar.xz cp -v timezone/Makefile{,.orig} sed 's/\\$$(pwd)/`pwd`/' timezone/Makefile.orig > timezone/Makefile mkdir -v ../glibc-build cd ../glibc-build echo "libc_cv_ssp=no" > config.cache BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc ${BUILD32}" \ AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \ ../glibc-2.22/configure --prefix=/tools \ --host=${CLFS_TARGET32} --build=${CLFS_HOST} \ --disable-profile --enable-kernel=3.0 \ --with-binutils=/cross-tools/bin --with-headers=/tools/include \ --enable-obsolete-rpc --cache-file=config.cache make make install ------ # glibc 2.22 64bit tar xf glibc-2.22.tar.xz cp -v timezone/Makefile{,.orig} sed 's/\\$$(pwd)/`pwd`/' timezone/Makefile.orig > timezone/Makefile mkdir -v ../glibc-build cd ../glibc-build echo "libc_cv_ssp=no" > config.cache echo "slibdir=/tools/lib64" >> configparms BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc ${BUILD64}" \ AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \ ../glibc-2.22/configure --prefix=/tools \ --host=${CLFS_TARGET} --build=${CLFS_HOST} --libdir=/tools/lib64 \ --disable-profile --enable-kernel=3.0 \ --with-binutils=/cross-tools/bin --with-headers=/tools/include \ --enable-obsolete-rpc --cache-file=config.cache make make install ------ # gcc 5.3.1 final tar xf gcc-5.3.1-r233831.tar.bz2 echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h mkdir -v ../gcc-build cd ../gcc-build AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ ../gcc-5.3.1-r233831/configure --prefix=/cross-tools \ --build=${CLFS_HOST} --target=${CLFS_TARGET} --host=${CLFS_HOST} \ --with-sysroot=${CLFS} --with-local-prefix=/tools \ --with-native-system-header-dir=/tools/include \ --disable-nls --disable-static --enable-languages=c,c++ \ --enable-__cxa_atexit --enable-threads=posix --with-mpc=/cross-tools \ --with-mpfr=/cross-tools --with-gmp=/cross-tools \ --with-isl=/cross-tools --with-system-zlib --enable-checking=release \ --enable-libstdcxx-time make AS_FOR_TARGET="${CLFS_TARGET}-as" \ LD_FOR_TARGET="${CLFS_TARGET}-ld" make install ######################################### #### Stage 2 ######################################### export CC="${CLFS_TARGET}-gcc ${BUILD64}" export CXX="${CLFS_TARGET}-g++ ${BUILD64}" export AR="${CLFS_TARGET}-ar" export AS="${CLFS_TARGET}-as" export RANLIB="${CLFS_TARGET}-ranlib" export LD="${CLFS_TARGET}-ld" export STRIP="${CLFS_TARGET}-strip" echo export CC=\""${CC}\"" >> ~/.bashrc echo export CXX=\""${CXX}\"" >> ~/.bashrc echo export AR=\""${AR}\"" >> ~/.bashrc echo export AS=\""${AS}\"" >> ~/.bashrc echo export RANLIB=\""${RANLIB}\"" >> ~/.bashrc echo export LD=\""${LD}\"" >> ~/.bashrc echo export STRIP=\""${STRIP}\"" >> ~/.bashrc ------ # gmp 5.1.3 rm -rf gmp-5.1.3/ cp -R /build/packages/BUILD/gmp-5.1.3/ . CC_FOR_BUILD=gcc ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --libdir=/tools/lib64 --enable-cxx make make install ------ # mpfr 5.1.3 rm -rf mpfr-3.1.2/ cp -R /build/packages/BUILD/mpfr-3.1.2/ . ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --libdir=/tools/lib64 make make install ------ # mpc 1.0.2 rm -rf mpc-1.0.2/ cp -R /build/packages/BUILD/mpc-1.0.2/ . ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --libdir=/tools/lib64 make make install ------ # isl 0.12.2 tar xf isl-0.12.2.tar.bz2 ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --libdir=/tools/lib64 make make install ------ # zlib 1.2.8 Installing "/build/packages/SRPMS/zlib-1.2.8-10.1.src.rpm" rpmbuild -bp --rmsource SPECS/zlib.spec cp -R /build/packages/BUILD/zlib-1.2.8/ . ./configure --prefix=/tools --libdir=/tools/lib64 make make install ------ # binutils 2.26.1 rm -rf binutils-* cp -R /build/packages/BUILD/binutils-2.26.1/ . mkdir -v ../binutils-build cd ../binutils-build ../binutils-2.26.1/configure \ --prefix=/tools --libdir=/tools/lib64 --with-lib-path=/tools/lib64:/tools/lib \ --build=${CLFS_HOST} --host=${CLFS_TARGET} --target=${CLFS_TARGET} \ --disable-nls --enable-shared --enable-64-bit-bfd make make install ------ # gcc 5.3.1 rm -rf gcc-5.3.1-r233831 rm -rf gcc-build/ tar xf gcc-5.3.1-r233831.tar.bz2 echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h cp -v gcc/Makefile.in{,.orig} sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in mkdir -v ../gcc-build cd ../gcc-build ../gcc-5.3.1-r233831/configure --prefix=/tools \ --libdir=/tools/lib64 --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --target=${CLFS_TARGET} --with-local-prefix=/tools --disable-nls \ --enable-languages=c,c++ --disable-libstdcxx-pch \ --with-system-zlib --with-native-system-header-dir=/tools/include \ --disable-libssp --enable-libstdcxx-time --enable-checking=release make AS_FOR_TARGET="${AS}" \ LD_FOR_TARGET="${LD}" make install cp -v ../gcc-5.3.1-r233831/include/libiberty.h /tools/include ------ # ncurses 5.9 rm -rf ncurses-5.9/ tar xf ncurses-5.9.tar.bz2 # errorhandling by hbfl # https://stackoverflow.com/questions/37475222/ncurses-6-0-compilation-error-error-expected-before-int export CPPFLAGS="-P" ./configure --prefix=/tools --with-shared \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --without-debug --without-ada \ --enable-overwrite --with-build-cc=gcc \ --libdir=/tools/lib64 make make install ------ # bash 4.3 Installing "/build/packages/SRPMS/bash-4.3-82.6.src.rpm" rpmbuild -bp --rmsource SPECS/bash.spec --nodeps cp -R /build/packages/BUILD/bash-4.3 . cat > config.cache << "EOF" ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_strcoll_works=yes ac_cv_func_working_mktime=yes bash_cv_func_sigsetjmp=present bash_cv_getcwd_malloc=yes bash_cv_job_control_missing=present bash_cv_printf_a_format=yes bash_cv_sys_named_pipes=present bash_cv_ulimit_maxfds=yes bash_cv_under_sys_siglist=yes bash_cv_unusable_rtsigs=no gt_cv_int_divbyzero_sigfpe=yes EOF ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --without-bash-malloc --cache-file=config.cache make make install ------ # bzip2 1.0.6 Installing "/build/packages/SRPMS/bzip2-1.0.6-32.53.src.rpm" rpmbuild -bp --rmsource SPECS/bzip2.spec cp -R /build/packages/BUILD/bzip2-1.0.6/ . cp -v Makefile{,.orig} sed -e 's@^\(all:.*\) test@\1@g' \ -e 's@/lib\(/\| \|$\)@/lib64\1@g' Makefile.orig > Makefile make CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" make PREFIX=/tools install ------ # check 0.10.0 Installing "/build/packages/SRPMS/check-0.10.0-1.4.src.rpm" rpmbuild -bp --rmsource SPECS/check.spec cp -R /build/packages/BUILD/check-0.10.0/ . ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} --libdir=/tools/lib64 make make install ------ # coreutils 8.25 tar xf coreutils-8.25.tar.xz cat > config.cache << EOF fu_cv_sys_stat_statfs2_bsize=yes gl_cv_func_working_mkstemp=yes EOF ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --enable-install-program=hostname --cache-file=config.cache ###https://www.linuxquestions.org/questions/linux-from-scratch-13/coreutils-trouble-what-to-do-4175489486/page2.html add option "--no-discard-stderr" in Makefile of coreutil #cd /sources/coreutils-8.23 #cp Makefile Makefile.ori #vi Makefile run_help2man = $(PERL) -- $(srcdir)/man/help2man --no-discard-stderr make make install ------ # diffutils 3.3 tar xf diffutils-3.3.tar.xz ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} make make install ------ # file rm -rf file-5.31/ cp -R /build/packages/BUILD/file-5.31/ . ./configure --prefix=/tools \ --libdir=/tools/lib64 --build=${CLFS_HOST} --host=${CLFS_TARGET} make make install ------ # findutils 4.6.0 Installing "/build/packages/SRPMS/findutils-4.6.0-2.28.src.rpm" rpmbuild -bp --rmsource SPECS/findutils.spec --nodeps cp -R /build/packages/BUILD/findutils-4.6.0/ . echo "gl_cv_func_wcwidth_works=yes" > config.cache echo "ac_cv_func_fnmatch_gnu=yes" >> config.cache ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --cache-file=config.cache make make install ------ # gawk 4.1.3 tar xf gawk-4.1.3.tar.xz ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} make make install ------ # gettext 0.19.8 tar xf gettext-0.19.8.1.tar.xz cd gettext-tools/ echo "gl_cv_func_wcwidth_works=yes" > config.cache ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --disable-shared --cache-file=config.cache make cp -v src/msgfmt /tools/bin ------ # grep 2.25 tar xf grep-2.25.tar.xz ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --without-included-regex make make install ------ # gzip 1.8 tar xf gzip-1.8.tar xz ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} make make install ------ # make 4.0 Installing "/build/packages/SRPMS/make-4.0-5.54.src.rpm" rpmbuild -bp --rmsource SPECS/make.spec cp -R /build/packages/BUILD/make-4.0/ . ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} make make install ------ # patch 2.7.5 tar xf patch-2.7.5.tar.xz ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} make make install ------ # sed 4.2.2 Installing "/build/packages/SRPMS/sed-4.2.2-8.3.1.src.rpm" rpmbuild -bp --rmsource SPECS/sed.spec --nodeps cp -R /build/packages/BUILD/sed-4.2.2/ . ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} make make install ------ # tar 1.29 tar xf tarx-1.29.tar.xz cat > config.cache << EOF gl_cv_func_wcwidth_works=yes gl_cv_func_btowc_eof=yes ac_cv_func_malloc_0_nonnull=yes gl_cv_func_mbrtowc_incomplete_state=yes gl_cv_func_mbrtowc_nul_retval=yes gl_cv_func_mbrtowc_null_arg1=yes gl_cv_func_mbrtowc_null_arg2=yes gl_cv_func_mbrtowc_retval=yes gl_cv_func_wcrtomb_retval=yes EOF ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --cache-file=config.cache make make install ------ # texinfo 5.2 tar xf texinfo-5.2.tar.xz PERL=/usr/bin/perl ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} make make install ------ # util-linux 26.2 tar xf util-linux-2.26.2.tar.xz ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --libdir='${prefix}'/lib64 --disable-makeinstall-chown \ --disable-makeinstall-setuid make make install ------ # vim 7.4 tar xf vim-7.4.tar.bz2 cat > src/auto/config.cache << "EOF" vim_cv_getcwd_broken=no vim_cv_memmove_handles_overlap=yes vim_cv_stat_ignores_slash=no vim_cv_terminfo=yes vim_cv_toupper_broken=no vim_cv_tty_group=world EOF echo '#define SYS_VIMRC_FILE "/tools/etc/vimrc"' >> src/feature.h ./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --prefix=/tools --enable-gui=no --disable-gtktest --disable-xim \ --disable-gpm --without-x --disable-netbeans --with-tlib=ncurses make make install ------ # xz 1.2.3 tar xf xz-5.2.3.tar.gz ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --libdir=/tools/lib64 make make install ############################# # check for boot method /tools/lib/libc.so.6 /tools/lib64/libc.so.6 /tools/bin/gcc -v lfs:/data/sources$ /tools/lib/libc.so.6 GNU C Library (GNU libc) stable release version 2.22, by Roland McGrath et al. Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 5.3.1 20160301 [gcc-5-branch revision 233849]. Available extensions: crypt add-on version 2.1 by Michael Glad and others GNU Libidn by Simon Josefsson Native POSIX Threads Library by Ulrich Drepper et al BIND-8.2.3-T5B libc ABIs: UNIQUE IFUNC For bug reporting instructions, please see: . lfs:/data/sources$ /tools/lib64/libc.so.6 bash: /tools/lib64/libc.so.6: cannot execute binary file lfs:/data/sources$ /tools/bin/gcc -v bash: /tools/bin/gcc: cannot execute binary file :-( prepare for boot ------ # bc 1.06.95 tar xf bc-1.06.tar.gz CC=gcc ./configure --prefix=/cross-tools make make install ------ # e2fsprogs 1.42.13 tar xf e2fsprogs-1.42.13.tar.xz cp -v configure{,.orig} sed -e "/libdir=.*\/lib/s@/lib@/lib64@g" configure.orig > configure mkdir -v build cd build ../configure --prefix=/tools --enable-elf-shlibs \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --disable-libblkid --disable-libuuid --disable-fsck \ --disable-uuidd make make install make install-libs ------ # kmod 23 tar xf kmod-23.tar.xz cp -v libkmod/libkmod.c{,.orig} sed '/dirname_default_prefix /s@/lib/modules@/tools&@' \ libkmod/libkmod.c.orig > libkmod/libkmod.c ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} \ --libdir=/tools/lib64 --with-xz --with-zlib make make install ln -sfv kmod /tools/bin/lsmod for tool in depmod insmod modprobe modinfo rmmod; do ln -sv ../bin/kmod /tools/sbin/${tool} done ------ # shadow 4.1.5 tar xf shadow-4.1.5.1.tar.bz2 cp -v src/Makefile.in{,.orig} sed -e 's/groups$(EXEEXT) //' \ -e 's/= nologin$(EXEEXT)/= /' \ -e 's/\(^suidu*bins = \).*/\1/' \ src/Makefile.in.orig > src/Makefile.in cat > config.cache << "EOF" shadow_cv_passwd_dir=/tools/bin EOF ./configure --prefix=/tools \ --build=${CLFS_HOST} --host=${CLFS_TARGET} --cache-file=config.cache \ --enable-subordinate-ids=no echo "#define ENABLE_SUBUIDS 1" >> config.h make make install ------ # ysyvinit 2.88dsf tar xf sysvinit-2.88+dsf.tar.bz2 https://ftp.osuosl.org/pub/clfs/clfs-packages/sysvinit/sysvinit-2.88dsf-tools_updates-1.patch patch -Np1 -i ../sysvinit-2.88dsf-tools_updates-1.patch make -C src clobber make -C src CC="${CC}" make -C src ROOT=/tools install cat > /tools/etc/inittab << "EOF" # Begin /tools/etc/inittab id:3:initdefault: si::sysinit:/tools/etc/rc.d/init.d/rc sysinit l0:0:wait:/tools/etc/rc.d/init.d/rc 0 l1:S1:wait:/tools/etc/rc.d/init.d/rc 1 l2:2:wait:/tools/etc/rc.d/init.d/rc 2 l3:3:wait:/tools/etc/rc.d/init.d/rc 3 l4:4:wait:/tools/etc/rc.d/init.d/rc 4 l5:5:wait:/tools/etc/rc.d/init.d/rc 5 l6:6:wait:/tools/etc/rc.d/init.d/rc 6 ca:12345:ctrlaltdel:/tools/sbin/shutdown -t1 -a -r now su:S016:once:/tools/sbin/sulogin EOF cat >> /tools/etc/inittab << "EOF" 1:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty1 9600 2:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty2 9600 3:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty3 9600 4:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty4 9600 5:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty5 9600 6:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty6 9600 EOF cat >> /tools/etc/inittab << "EOF" c0:12345:respawn:/tools/sbin/agetty --noclear 115200 ttyS0 vt100 EOF cat >> /tools/etc/inittab << "EOF" # End /tools/etc/inittab EOF ------ # eudev 3.1.5 tar xf eudev-3.1.5.tar.gz ./configure --prefix=/tools --build=${CLFS_HOST} \ --host=${CLFS_TARGET} --libdir=/tools/lib64 --with-rootlibdir=/tools/lib64 \ --disable-introspection --disable-gtk-doc-html --disable-gudev \ --disable-keymap --with-firmware-path=/lib/firmware --enable-libkmod make make install ------ # kernel 3.16.47 cp -R /usr/src/linux-3.16.47-eisfair-1/ . make mrproper make ARCH=x86_64 CROSS_COMPILE=${CLFS_TARGET}- menuconfig make ARCH=x86_64 CROSS_COMPILE=${CLFS_TARGET}- make ARCH=x86_64 CROSS_COMPILE=${CLFS_TARGET}- \ INSTALL_MOD_PATH=/tools modules_install make ARCH=x86_64 CROSS_COMPILE=${CLFS_TARGET}- \ INSTALL_MOD_PATH=/tools firmware_install kernel-3.16.47-64-2-SMP mkdir -pv /tools/boot cp -v arch/x86_64/boot/bzImage /boot/kernel-3.16.47-64-2-SMP cp -v System.map /tools/System.map-3.16.47-eisfair-64-SMP alles zusammenpacken und auf die target Maschine :-( #################################### # stage 3 cp /tools/lib64 /lib64 ;-) dann findet die bash auch ihre libc ------ # tcl 8.6.4 tar xf tcl8.6.4-src.tar.gz sed -i s/500/5000/ generic/regc_nfa.c cd unix CC="gcc ${BUILD64}" ./configure --prefix=/tools --libdir=/tools/lib64 make make install make install-private-headers ln -sv tclsh8.6 /tools/bin/tclsh ------ # expect 5.45 tar xf expect5.45.tar.gz CC="gcc ${BUILD64}" ./configure --prefix=/tools \ --with-tcl=/tools/lib64 --with-tclinclude=/tools/include \ --libdir=/tools/lib64 make make install ------ # dejagnu 1.5.1 tar xf dejagnu-1.5.1.tar.gz ./configure --prefix=/tools make install ------ # perl 5.20.3 tar xf perl-5.20.3.tar.gz sed -i 's@/usr/include@/tools/include@g' ext/Errno/Errno_pm.PL ./configure.gnu --prefix=/tools -Dcc="gcc ${BUILD32}" make make install ln -sfv /tools/bin/perl /usr/bin los gehts ------ # kernelheader 3.16.47 make mrproper make headers_check make INSTALL_HDR_PATH=/usr headers_install find /usr/include -name .install -or -name ..install.cmd | xargs rm -fv ------ # glibc 2.2 32 bit tar xf glibc-2.22.tar.xz LINKER=$(readelf -l /tools/bin/bash | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p') sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=${LINKER} -o|" \ scripts/test-installation.pl unset LINKER sed -i 's/\\$$(pwd)/`pwd`/' timezone/Makefile mkdir -v ../glibc-build cd ../glibc-build CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \ ../glibc-2.22/configure --prefix=/usr \ --disable-profile --enable-kernel=3.0 \ --libexecdir=/usr/lib/glibc --host=${CLFS_TARGET32} \ --enable-obsolete-rpc make sed -i '/cross-compiling/s@ifeq@ifneq@g' ../glibc-2.22/localedata/Makefile make -k check 2>&1 | tee glibc-check-log; grep Error glibc-check-log make[2]: *** [/tools/sources/glibc-build/elf/tst-unique3lib.os] Error 1 make[2]: *** [/tools/sources/glibc-build/elf/tst-unique3lib2.os] Error 1 make[2]: *** [/tools/sources/glibc-build/elf/tst-unique3.o] Error 1 make[2]: *** [/tools/sources/glibc-build/elf/tst-unique4.o] Error 1 make DESTDIR=/public install rm -v /usr/include/rpcsvc/*.x ------ # glibc 2.2 64 bit tar xf glibc-2.22.tar.xz LINKER=$(readelf -l /tools/bin/bash | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p') sed -i "s|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=${LINKER} -o|" \ scripts/test-installation.pl unset LINKER sed -i 's/\\$$(pwd)/`pwd`/' timezone/Makefile mkdir -v ../glibc-build cd ../glibc-build echo "slibdir=/lib64" >> configparms CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" \ ../glibc-2.22/configure --prefix=/usr \ --disable-profile --enable-kernel=3.0 \ --libexecdir=/usr/lib64/glibc --libdir=/usr/lib64 \ --enable-obsolete-rpc make make -k check 2>&1 | tee glibc-check-log; grep Error glibc-check-log Summary of test results: 2311 PASS 88 XFAIL 3 XPASS make DESTDIR=/public install rm -v /usr/include/rpcsvc/*.x cp -v ../glibc-2.22/nscd/nscd.conf /public/etc/nscd.conf tarball von /public mit dem mc glibc-2.22 dann mit tar --no-overwrite-dir --strip-components=1 -x -f /public/glibc-2.22.tar.xz installiert root:/# /lib/libc.so.6 GNU C Library (GNU libc) stable release version 2.22, by Roland McGrath et al. root:/# /lib64/libc.so.6 GNU C Library (GNU libc) stable release version 2.22, by Roland McGrath et al. ------ # timezone data http://www.iana.org/time-zones/repository/releases/tzdata2017b.tar.gz tar -xf ../tzdata2014d.tar.gz ZONEINFO=/usr/share/zoneinfo mkdir -pv $ZONEINFO/{posix,right} for tz in etcetera southamerica northamerica europe africa antarctica \ asia australasia backward pacificnew \ 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 cp -v /usr/share/zoneinfo/[xxx] \ /etc/localtime lib64 hinzufuegen cat > /etc/ld.so.conf << "EOF" # Begin /etc/ld.so.conf /usr/local/lib /usr/local/lib64 /opt/lib /opt/lib64 # End /etc/ld.so.conf EOF ############################### gcc -dumpspecs | \ perl -p -e 's@/tools/lib/ld@/lib/ld@g;' \ -e 's@/tools/lib64/ld@/lib64/ld@g;' \ -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \ $(dirname $(gcc --print-libgcc-file-name))/specs test fuer 32 bit echo 'main(){}' > dummy.c gcc ${BUILD32} dummy.c readelf -l a.out | grep ': /lib' [Requesting program interpreter: /lib/ld-linux.so.2] test fuer 64 bit echo 'main(){}' > dummy.c gcc ${BUILD64} dummy.c readelf -l a.out | grep ': /lib' [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] alles OK ;-)