diff --git a/Makefile b/Makefile index 057e83465..70675e9bb 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,12 @@ ifndef ARCH ARCH = default endif ifneq ($(ARCH), default) - ifneq ($(ARCH), multilib) - $(error ARCH must be either 'default' (default if unset) or 'multilib'.) + ifneq ($(ARCH), ml_32) + ifneq ($(ARCH), ml_x32) + ifneq ($(ARCH), ml_all) + $(error ARCH must be either 'default' (default if unset), 'ml_32', 'ml_x32' or 'ml_all'.) + endif + endif endif endif diff --git a/chapter01/askforhelp.xml b/chapter01/askforhelp.xml index 9de08fbc6..79df30db5 100644 --- a/chapter01/askforhelp.xml +++ b/chapter01/askforhelp.xml @@ -39,10 +39,10 @@ The version of the book being used (in this case - &version; - &version;-multilib + &version; + &version;-multilib &versiond; - &versiond;-multilib) + &versiond;-multilib) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index bf57c5aca..9228a1d83 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -12,9 +12,9 @@ This is version &version; - &version;-multilib + &version;-multilib &versiond; - &versiond;-multilib + &versiond;-multilib of the Linux From Scratch book, dated &releasedate;. If this book is more than six months old, a newer and better version is probably already available. To find out, please check one of the diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml index e0247df03..bad719156 100644 --- a/chapter04/settingenviron.xml +++ b/chapter04/settingenviron.xml @@ -47,7 +47,7 @@ PATH=/tools/bin:/bin:/usr/bin export LFS LC_ALL LFS_TGT PATH EOF -cat > ~/.bashrc << "EOF" +cat > ~/.bashrc << "EOF" set +h umask 022 LFS=/mnt/lfs diff --git a/chapter05/binutils-pass1.xml b/chapter05/binutils-pass1.xml index 666046643..8458745a2 100644 --- a/chapter05/binutils-pass1.xml +++ b/chapter05/binutils-pass1.xml @@ -79,9 +79,12 @@ cd build --disable-nls \ --disable-werror - ../configure --prefix=/tools \ + lpath=/tools/lib +lpath="$lpath:/tools/lib32" +lpath="$lpath:/tools/libx32" +../configure --prefix=/tools \ --with-sysroot=$LFS \ - --with-lib-path=/tools/lib:/tools/lib32:/tools/libx32 \ + --with-lib-path=$lpath \ --target=$LFS_TGT \ --disable-nls \ --disable-werror \ @@ -158,14 +161,14 @@ cd build If building on x86_64, create a symlink to ensure the sanity of the toolchain: - Create a symlink to ensure the sanity of + Create a symlink to ensure the sanity of the toolchain: case $(uname -m) in x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;; esac -mkdir -v /tools/lib && +mkdir -v /tools/lib && ln -sv lib /tools/lib64 Install the package: diff --git a/chapter05/binutils-pass2.xml b/chapter05/binutils-pass2.xml index 535c0771d..82b3b52d0 100644 --- a/chapter05/binutils-pass2.xml +++ b/chapter05/binutils-pass2.xml @@ -60,14 +60,17 @@ RANLIB=$LFS_TGT-ranlib \ --with-lib-path=/tools/lib \ --with-sysroot -CC=$LFS_TGT-gcc \ +lpath=/tools/lib +lpath="$lpath:/tools/lib32" +lpath="$lpath:/tools/libx32" +CC=$LFS_TGT-gcc \ AR=$LFS_TGT-ar \ RANLIB=$LFS_TGT-ranlib \ ../configure \ --prefix=/tools \ --disable-nls \ --disable-werror \ - --with-lib-path=/tools/lib:/tools/lib32:/tools/libx32 \ + --with-lib-path=$lpath \ --with-sysroot \ --enable-64-bit-bfd \ --enable-multilib @@ -95,7 +98,7 @@ RANLIB=$LFS_TGT-ranlib \ - + --with-lib-path=/tools/lib:... This tells the configure script to specify the library @@ -118,14 +121,14 @@ RANLIB=$LFS_TGT-ranlib \ - + --enable-64-bit-bfd TODO - + --enable-multilib TODO @@ -149,8 +152,14 @@ RANLIB=$LFS_TGT-ranlib \ make -C ld LIB_PATH=/usr/lib:/lib cp -v ld/ld-new /tools/bin -make -C ld clean +make -C ld clean make -C ld LIB_PATH=/usr/lib:/lib:/usr/lib32:/lib32:/usr/libx32:/libx32 +cp -v ld/ld-new /tools/bin +make -C ld clean +make -C ld LIB_PATH=/usr/lib:/lib:/usr/lib32:/lib32 +cp -v ld/ld-new /tools/bin +make -C ld clean +make -C ld LIB_PATH=/usr/lib:/lib:/usr/libx32:/libx32 cp -v ld/ld-new /tools/bin diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml index 2cd76bc57..7e40582f9 100644 --- a/chapter05/gcc-pass1.xml +++ b/chapter05/gcc-pass1.xml @@ -49,7 +49,7 @@ rename the resulting directories so the GCC build procedures will automatically use them: - GCC now requires the GMP, ISL, MPFR, and MPC packages. + GCC now requires the GMP, ISL, MPFR, and MPC packages. As these packages may not be included in your host distribution, they will be built with GCC. Unpack each package into the GCC source directory and rename the resulting directories so the GCC build procedures will @@ -67,7 +67,7 @@ tar -xf ../gmp-&gmp-version;.tar.xz mv -v gmp-&gmp-version; gmp tar -xf ../mpc-&mpc-version;.tar.gz mv -v mpc-&mpc-version; mpc -tar -xf ../mpfr-&mpfr-version;.tar.xz +tar -xf ../mpfr-&mpfr-version;.tar.xz mv -v mpfr-&mpfr-version; mpfr tar -xf ../gmp-&gmp-version;.tar.xz mv -v gmp-&gmp-version; gmp @@ -121,7 +121,7 @@ done ;; esac -sed -e '/m64=/s/lib64/lib/' \ +sed -e '/m64=/s/lib64/lib/' \ -i.orig gcc/config/i386/t-linux64 cat > gcc/config/i386/t-linux64 <<"EOF" comma=, @@ -149,9 +149,9 @@ EOF - Fix an issue with isl-&isl-version;: + Fix an issue with isl-&isl-version;: -sed -e "/#include <isl\/schedule_node.h>/ a#include <isl/id.h>\n#include <isl/space.h>" \ +sed -e "/#include <isl\/schedule_node.h>/ a#include <isl/id.h>\n#include <isl/space.h>" \ -i gcc/graphite.h The GCC documentation recommends building GCC @@ -185,7 +185,10 @@ cd build --disable-libstdcxx \ --enable-languages=c,c++ -../configure \ +mlist="m64" +mlist="$mlist,m32" +mlist="$mlist,mx32" +../configure \ --target=$LFS_TGT \ --prefix=/tools \ --with-glibc-version=2.11 \ @@ -197,7 +200,7 @@ cd build --disable-nls \ --disable-shared \ --enable-multilib \ - --with-multilib-list=m32,m64,mx32 \ + --with-multilib-list=$mlist \ --disable-decimal-float \ --disable-threads \ --disable-libatomic \ @@ -286,7 +289,7 @@ cd build - + --enable-multilib, --with-multilib-list=m32,m64,mx32 diff --git a/chapter05/gcc-pass2.xml b/chapter05/gcc-pass2.xml index 8fe0874bc..647616a54 100644 --- a/chapter05/gcc-pass2.xml +++ b/chapter05/gcc-pass2.xml @@ -93,10 +93,10 @@ done ;; esac - Change the default directory name for 64-bit + Change the default directory name for 64-bit libraries to lib: -sed -e '/m64=/s/lib64/lib/' \ +sed -e '/m64=/s/lib64/lib/' \ -i.orig gcc/config/i386/t-linux64 cat > gcc/config/i386/t-linux64 <<"EOF" comma=, @@ -111,7 +111,7 @@ EOF MPFR, and MPC packages. Unpack the tarballs and move them into the required directory names: - As in the first build of GCC it requires the GMP, + As in the first build of GCC it requires the GMP, ISL, MPFR, and MPC packages. Unpack the tarballs and move them into the required directory names: @@ -121,7 +121,7 @@ tar -xf ../gmp-&gmp-version;.tar.xz mv -v gmp-&gmp-version; gmp tar -xf ../mpc-&mpc-version;.tar.gz mv -v mpc-&mpc-version; mpc -tar -xf ../mpfr-&mpfr-version;.tar.xz +tar -xf ../mpfr-&mpfr-version;.tar.xz mv -v mpfr-&mpfr-version; mpfr tar -xf ../gmp-&gmp-version;.tar.xz mv -v gmp-&gmp-version; gmp @@ -131,9 +131,9 @@ tar -xf ../isl-&isl-version;.tar.xz mv -v isl-&isl-version; isl - Fix an issue with isl-&isl-version;: + Fix an issue with isl-&isl-version;: -sed -e "/#include <isl\/schedule_node.h>/ a#include <isl/id.h>\n#include <isl/space.h>" \ +sed -e "/#include <isl\/schedule_node.h>/ a#include <isl/id.h>\n#include <isl/space.h>" \ -i gcc/graphite.h Create a separate build directory again: @@ -160,7 +160,10 @@ RANLIB=$LFS_TGT-ranlib \ --disable-bootstrap \ --disable-libgomp -CC=$LFS_TGT-gcc \ +mlist="m64" +mlist="$mlist,m32" +mlist="$mlist,mx32" +CC=$LFS_TGT-gcc \ CXX=$LFS_TGT-g++ \ AR=$LFS_TGT-ar \ RANLIB=$LFS_TGT-ranlib \ @@ -171,7 +174,7 @@ RANLIB=$LFS_TGT-ranlib \ --enable-languages=c,c++ \ --disable-libstdcxx-pch \ --enable-multilib \ - --with-multilib-list=m32,m64,mx32 \ + --with-multilib-list=$mlist \ --with-system-zlib \ --disable-bootstrap \ --disable-libgomp @@ -244,23 +247,23 @@ readelf -l a.out | grep ': /tools' [Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2] - Repeat the test for 32-bit: + Repeat the test for 32-bit: -cc -m32 dummy.c +cc -m32 dummy.c readelf -l a.out | grep ': /tools' - In this case, the output shoud be: + In this case, the output shoud be: -[Requesting program interpreter: /tools/lib/ld-linux.so.2] +[Requesting program interpreter: /tools/lib/ld-linux.so.2] - Repeat the test for x32-bit: + Repeat the test for x32-bit: -cc -mx32 dummy.c +cc -mx32 dummy.c readelf -l a.out | grep ': /tools' - In this case, the output shoud be: + In this case, the output shoud be: -[Requesting program interpreter: /tools/lib/ld-linux-x32.so.2] +[Requesting program interpreter: /tools/lib/ld-linux-x32.so.2] Note that the dynamic linker will be /tools/lib/ld-linux.so.2 for 32-bit machines. diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index ba0c4107c..5fda52645 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -82,7 +82,7 @@ cd build - + --enable-multi-arch Enables glibc for multiarch environments. @@ -191,7 +191,7 @@ readelf -l a.out | grep ': /tools' - + Installation of Glibc 32-bit Clean the build directory for redoing glibc for 32-bit: @@ -213,9 +213,10 @@ RANLIB="${LFS_TGT}-ranlib" \ --libdir=/tools/lib32 \ --libexecdir=/tools/lib32 \ --with-headers=/tools/include \ - --with-binutils=/tools/bin \ + --with-binutils=/tools/bin + Now compile the 32-bit version of glibc: make @@ -231,7 +232,7 @@ cd .. - + Installation of Glibc x32-bit Create a build directory for redoing glibc for x32-bit: @@ -253,9 +254,10 @@ RANLIB="${LFS_TGT}-ranlib" \ --libdir=/tools/libx32 \ --libexecdir=/tools/libx32 \ --with-headers=/tools/include \ - --with-binutils=/tools/bin \ + --with-binutils=/tools/bin + Now compile the x32-bit version of glibc: make diff --git a/chapter05/ncurses.xml b/chapter05/ncurses.xml index b0681486c..9aead2c56 100644 --- a/chapter05/ncurses.xml +++ b/chapter05/ncurses.xml @@ -112,7 +112,7 @@ ln -s libncursesw.so /tools/lib/libncurses.so - + Installation of Ncurses - 32 bit Prepare Ncurses for compilation: @@ -143,7 +143,7 @@ cp -Rv DESTDIR_32/tools/lib32/* /tools/lib32 - + Installation of Ncurses - x32 bit Repeat for the x32-ABI: diff --git a/chapter05/stripping.xml b/chapter05/stripping.xml index 5902d300c..dcbd38edd 100644 --- a/chapter05/stripping.xml +++ b/chapter05/stripping.xml @@ -18,7 +18,11 @@ strip --strip-debug /tools/lib/* /usr/bin/strip --strip-unneeded /tools/{,s}bin/* -strip --strip-debug /tools/lib{,{,x}32}/* +strip --strip-debug /tools/lib{,32}/* +/usr/bin/strip --strip-unneeded /tools/{,s}bin/* +strip --strip-debug /tools/lib{,x32}/* +/usr/bin/strip --strip-unneeded /tools/{,s}bin/* +strip --strip-debug /tools/lib{,{,x}32}/* /usr/bin/strip --strip-unneeded /tools/{,s}bin/* These commands will skip a number of files, reporting that it does not @@ -38,7 +42,9 @@ find /tools/{lib,libexec} -name \*.la -delete -find /tools/{lib{,{,x}32},libexec} -name \*.la -delete +find /tools/{lib{,32},libexec} -name \*.la -delete +find /tools/{lib{,x32},libexec} -name \*.la -delete +find /tools/{lib{,{,x}32},libexec} -name \*.la -delete At this point, you should have at least 3 GB of free space in $LFS that can be used to build and install Glibc and Gcc in diff --git a/chapter05/util-linux.xml b/chapter05/util-linux.xml index 203cea201..db9b9d468 100644 --- a/chapter05/util-linux.xml +++ b/chapter05/util-linux.xml @@ -121,7 +121,7 @@ - + Installation of Util-Linux - 32 bit Prepare Util-Linux for compilation: @@ -153,7 +153,7 @@ cp -Rv DESTDIR_32/tools/lib32/* /tools/lib32 - + Installation of Util-Linux - x32 bit Repeat for the x32-ABI: diff --git a/chapter05/xz.xml b/chapter05/xz.xml index c753151a0..8fac7434a 100644 --- a/chapter05/xz.xml +++ b/chapter05/xz.xml @@ -63,7 +63,7 @@ - + Installation of Xz - 32 bit Prepare Xz for compilation: @@ -90,7 +90,7 @@ cp -Rv DESTDIR_32/tools/lib32/* /tools/lib32 - + Installation of Xz - x32 bit Repeat for the x32-ABI: diff --git a/chapter05/zlib.xml b/chapter05/zlib.xml index 41259514e..01a6da5d1 100644 --- a/chapter05/zlib.xml +++ b/chapter05/zlib.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -59,7 +59,7 @@ - + Installation of Zlib - 32 bit Prepare Zlib for compilation: @@ -82,7 +82,7 @@ cp -Rv DESTDIR_32/tools/lib32/* /tools/lib32 - + Installation of Zlib - x32 bit Repeat for the x32-ABI: diff --git a/chapter06/acl.xml b/chapter06/acl.xml index 50d413d47..8b2846dac 100644 --- a/chapter06/acl.xml +++ b/chapter06/acl.xml @@ -79,7 +79,9 @@ ln -sfv ../../lib/$(readlink /usr/lib/libacl.so) /usr/lib/libacl.so< - + + + Installation of Acl - 32-bit Clean previous build: @@ -105,7 +107,9 @@ rm -rf DESTDIR - + + + Installation of Acl - x32-bit Clean previous build: diff --git a/chapter06/attr.xml b/chapter06/attr.xml index 193a19c91..82ec8825c 100644 --- a/chapter06/attr.xml +++ b/chapter06/attr.xml @@ -78,7 +78,9 @@ ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so - + + + Installation of Attr - 32-bit Clean previous build: @@ -105,7 +107,9 @@ rm -rf DESTDIR - + + + Installation of Attr - x32-bit Clean previous build: diff --git a/chapter06/bzip2.xml b/chapter06/bzip2.xml index 028c37178..618d83e1c 100644 --- a/chapter06/bzip2.xml +++ b/chapter06/bzip2.xml @@ -97,7 +97,9 @@ ln -sv bzip2 /bin/bzcat - + + + Installation of Bzip2 - 32-bit Clean previous build: @@ -121,7 +123,9 @@ install -Dm644 libbz2.a /usr/lib32/libbz2.a - + + + Installation of Bzip2 - x32-bit Clean previous build: diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml index d79e9bfe1..c93a29f1d 100644 --- a/chapter06/chapter06.xml +++ b/chapter06/chapter06.xml @@ -22,7 +22,7 @@ - + diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml index e47e131f4..7198d94d7 100644 --- a/chapter06/createfiles.xml +++ b/chapter06/createfiles.xml @@ -47,15 +47,14 @@ ln -sv /tools/lib/libstdc++.{a,so{,.6}} /usr/lib install -vdm755 /usr/lib/pkgconfig ln -sv bash /bin/sh -ln -sv /tools/bin/{bash,cat,chmod,dd,echo,ln,mkdir,pwd,rm,stty,touch} /bin +ln -sv /tools/bin/{bash,cat,chmod,dd,echo,ln,mkdir,pwd,rm,stty,touch} /bin ln -sv /tools/bin/{env,install,perl,printf} /usr/bin -for lib in lib{,32,x32}; do +for lib in lib{,32,x32}; do ln -sv /tools/$lib/libgcc_s.so{,.1} /usr/$lib ln -sv /tools/$lib/libstdc++.{a,so{,.6}} /usr/$lib done -ln -sv /usr/libx32 / - -install -vdm755 /usr/lib{,32,x32}/pkgconfig +ln -sv /usr/libx32 / +install -vdm755 /usr/lib{,32,x32}/pkgconfig ln -sv bash /bin/sh diff --git a/chapter06/creatingdirs.xml b/chapter06/creatingdirs.xml index 2a1a69a1f..d930e909e 100644 --- a/chapter06/creatingdirs.xml +++ b/chapter06/creatingdirs.xml @@ -31,7 +31,7 @@ mkdir -v /var/{log,mail,spool} ln -sv /run /var/run ln -sv /run/lock /var/lock mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local} -mkdir -pv /{bin,boot,etc/{opt,sysconfig,ld.so.conf.d},home,lib/firmware,mnt,opt} +mkdir -pv /{bin,boot,etc/{opt,sysconfig,ld.so.conf.d},home,lib/firmware,mnt,opt} mkdir -pv /{media/{floppy,cdrom},sbin,srv,var} install -dv -m 0750 /root install -dv -m 1777 /tmp /var/tmp @@ -44,8 +44,9 @@ mkdir -v /lib64 mkdir -v /var/{log,mail,spool} ln -sv /run /var/run ln -sv /run/lock /var/lock -mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local} -mkdir -pv /usr/lib{,x}32 +mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local} +mkdir -pv /usr/lib32 +mkdir -pv /usr/libx32 Directories are, by default, created with permission mode 755, but this is not desirable for all directories. In the commands above, two diff --git a/chapter06/eudev.xml b/chapter06/eudev.xml index d56419e67..9e8e8ffb5 100644 --- a/chapter06/eudev.xml +++ b/chapter06/eudev.xml @@ -106,7 +106,7 @@ make -f &udev-lfs-version;/Makefile.lfs install - + Installation of Eudev - 32-bit Clean previous build: @@ -143,7 +143,7 @@ rm -rf DESTDIR - + Installation of Eudev - x32-bit Clean previous build: diff --git a/chapter06/expat.xml b/chapter06/expat.xml index c44085739..d11e02596 100644 --- a/chapter06/expat.xml +++ b/chapter06/expat.xml @@ -69,7 +69,9 @@ - + + + Installation of Expat - 32-bit Clean previous build but keep precompiled doc because it @@ -97,7 +99,9 @@ rm -rf DESTDIR - + + + Installation of Zlib - x32-bit Clean previous build: diff --git a/chapter06/file.xml b/chapter06/file.xml index 1cd665b04..89fde5133 100644 --- a/chapter06/file.xml +++ b/chapter06/file.xml @@ -59,7 +59,9 @@ - + + + Installation of File - 32-bit Clean previous build: @@ -85,7 +87,9 @@ rm -rf DESTDIR - + + + Installation of File - x32-bit Clean previous build: diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml index 96fbb1e53..c4f9456d4 100644 --- a/chapter06/gcc.xml +++ b/chapter06/gcc.xml @@ -51,10 +51,10 @@ ;; esac - Change the default directory name for 64-bit + Change the default directory name for 64-bit libraries to lib: -sed -e '/m64=/s/lib64/lib/' \ +sed -e '/m64=/s/lib64/lib/' \ -i.orig gcc/config/i386/t-linux64 cat > gcc/config/i386/t-linux64 <<"EOF" comma=, @@ -90,13 +90,29 @@ cd build --disable-bootstrap \ --disable-libmpx \ --with-system-zlib - -SED=sed \ +SED=sed \ ../configure --prefix=/usr \ --enable-languages=c,c++ \ --enable-multilib \ - --with-multilib-list=m32,m64,mx32 \ + --with-multilib-list=m32,m64 \ --disable-bootstrap \ + --disable-libmpx \ + --with-system-zlib +SED=sed \ +../configure --prefix=/usr \ + --enable-languages=c,c++ \ + --enable-multilib \ + --with-multilib-list=mx32,m64 \ + --disable-bootstrap \ + --disable-libmpx \ + --with-system-zlib +SED=sed \ +../configure --prefix=/usr \ + --enable-languages=c,c++ \ + --enable-multilib \ + --with-multilib-list=m32,mx32,m64 \ + --disable-bootstrap \ + --disable-libmpx \ --with-system-zlib Note that for other languages, there are some prerequisites that diff --git a/chapter06/glibc-32.xml b/chapter06/glibc-32.xml index fd5a8dddf..227228fed 100644 --- a/chapter06/glibc-32.xml +++ b/chapter06/glibc-32.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -40,7 +40,10 @@ --> - + + + + Installation of Glibc - 32-bit patch -Np1 -i ../&glibc-fhs-patch; @@ -97,7 +100,9 @@ rm -rf build - + + + Glibc - x32-bit The Glibc documentation recommends building Glibc diff --git a/chapter06/gmp.xml b/chapter06/gmp.xml index 8c20188c9..eccff684c 100644 --- a/chapter06/gmp.xml +++ b/chapter06/gmp.xml @@ -121,7 +121,7 @@ make install-html - + Installation of GMP - 32-bit Clean previous build: @@ -172,8 +172,8 @@ rm -rf DESTDIR - - + + Installation of GMP - x32-bit Clean previous build: diff --git a/chapter06/kmod.xml b/chapter06/kmod.xml index 8c0b50ce5..e29660f00 100644 --- a/chapter06/kmod.xml +++ b/chapter06/kmod.xml @@ -97,7 +97,9 @@ ln -sfv kmod /bin/lsmod - + + + Installation of Kmod - 32-bit Clean previous build but keep man pages as they cannot be recreated @@ -129,7 +131,9 @@ rm -rf DESTDIR - + + + Installation of Kmod - x32-bit Clean previous build: diff --git a/chapter06/libcap.xml b/chapter06/libcap.xml index 2d2bcd20e..8ca0c6b33 100644 --- a/chapter06/libcap.xml +++ b/chapter06/libcap.xml @@ -92,7 +92,7 @@ ln -sfv ../../lib/$(readlink /usr/lib/libcap.so) /usr/lib/libcap.so< - + Installation of Libcap - 32-bit Clean previous build: @@ -111,7 +111,7 @@ rm -rf DESTDIR - + Installation of Libcap - x32-bit Clean previous build: diff --git a/chapter06/libelf.xml b/chapter06/libelf.xml index d5766d02a..1dc1278d6 100644 --- a/chapter06/libelf.xml +++ b/chapter06/libelf.xml @@ -63,7 +63,7 @@ install -vm644 config/libelf.pc /usr/lib/pkgconfig - + Installation of Libelf - 32-bit Clean previous build: @@ -90,7 +90,7 @@ rm -rf DESTDIR - + Installation of Libelf - x32-bit Clean previous build: diff --git a/chapter06/libffi.xml b/chapter06/libffi.xml index c1d2f3aed..d424531e0 100644 --- a/chapter06/libffi.xml +++ b/chapter06/libffi.xml @@ -98,8 +98,9 @@ sed -e '/^includedir/ s/=.*$/=@includedir@/' \ - - + + + Installation of Libffi - 32-bit Clean previous build: @@ -132,8 +133,9 @@ rm -rf DESTDIR - - + + + Installation of Libffi - x32-bit Clean previous build: diff --git a/chapter06/libtool.xml b/chapter06/libtool.xml index 2795e3500..8a040ad84 100644 --- a/chapter06/libtool.xml +++ b/chapter06/libtool.xml @@ -70,8 +70,9 @@ - - + + + Installation of Libtool - 32-bit Clean previous build: @@ -97,7 +98,9 @@ rm -rf DESTDIR - + + + Installation of Libtool - x32-bit Clean previous build: diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml index 9d6daff82..ba5daaec3 100644 --- a/chapter06/ncurses.xml +++ b/chapter06/ncurses.xml @@ -54,7 +54,7 @@ --without-normal \ --enable-pc-files \ --enable-widec -./configure --prefix=/usr \ +./configure --prefix=/usr \ --mandir=/usr/share/man \ --with-shared \ --without-debug \ @@ -96,7 +96,7 @@ - + --with-pkg-config-libdir=/usr/lib/pkgconfig This switch forces .pc to be installed in /usr/lib/pkgconfig. If @@ -178,7 +178,9 @@ cp -av lib/lib*.so.5* /usr/lib - + + + Installation of Ncurses - 32-bit Clean previous build: @@ -233,7 +235,9 @@ cp -av lib/lib*.so.5* /usr/lib32 - + + + Installation of Ncurses - x32-bit Clean previous build: diff --git a/chapter06/openssl.xml b/chapter06/openssl.xml index 839270e9a..64ab29d7b 100644 --- a/chapter06/openssl.xml +++ b/chapter06/openssl.xml @@ -74,8 +74,9 @@ cp -vfr doc/* /usr/share/doc/openssl-&openssl-version; - - + + + Installation of OpenSSL - 32-bit Clean previous build: @@ -106,8 +107,9 @@ rm -rf DESTDIR - - + + + Installation of OpenSSL - x32-bit Clean previous build: diff --git a/chapter06/readline.xml b/chapter06/readline.xml index 2a73c1b35..16e1f4cb8 100644 --- a/chapter06/readline.xml +++ b/chapter06/readline.xml @@ -92,7 +92,9 @@ ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so - + + + Installation of Readline - 32-bit Clean previous build: @@ -119,7 +121,9 @@ rm -rf DESTDIR - + + + Installation of Readline - x32-bit Clean previous build: diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml index 6adf21c71..d534e504e 100644 --- a/chapter06/revisedchroot.xml +++ b/chapter06/revisedchroot.xml @@ -62,9 +62,10 @@ rm -f /usr/lib/libz.a files and generally unneeded on a linux system. None of these are necessary at this point. To remove them, run: -find /usr/lib /usr/libexec -name \*.la -delete - -find /usr/lib{,{,x}32} /usr/libexec -name \*.la -delete + find /usr/lib /usr/libexec -name \*.la -delete + find /usr/lib{,32} /usr/libexec -name \*.la -delete +find /usr/lib{,x32} /usr/libexec -name \*.la -delete + find /usr/lib{,{,x}32} /usr/libexec -name \*.la -delete For more information about libtool archive files, see the BLFS section "About Libtool diff --git a/chapter06/strippingagain.xml b/chapter06/strippingagain.xml index 715d5dbd0..b7a5cf0cd 100644 --- a/chapter06/strippingagain.xml +++ b/chapter06/strippingagain.xml @@ -56,7 +56,7 @@ done unset LIB save_lib save_usrlib -save_lib="ld-&glibc-version;.so libc-&glibc-version;.so libpthread-&glibc-version;.so libthread_db-&libthread_db-version;.so" +save_lib="ld-&glibc-version;.so libc-&glibc-version;.so libpthread-&glibc-version;.so libthread_db-&libthread_db-version;.so" cd /lib @@ -113,7 +113,7 @@ unset LIB save_lib save_usrlib /tools/bin/find /{bin,sbin} /usr/{bin,sbin,libexec} -type f \ -exec /tools/bin/strip --strip-all {} ';' -/tools/bin/find /usr/lib{,{,x}32} -type f -name \*.a \ +/tools/bin/find /usr/lib{,{,x}32} -type f -name \*.a \ -exec /tools/bin/strip --strip-debug {} ';' /tools/bin/find /lib /usr/lib{,{,x}32} -type f \( -name \*.so* -a ! -name \*dbg \) \ diff --git a/chapter06/systemd.xml b/chapter06/systemd.xml index b24f7d424..faa774bdf 100644 --- a/chapter06/systemd.xml +++ b/chapter06/systemd.xml @@ -212,7 +212,7 @@ chmod 755 /lib/systemd/systemd-user-sessions - + Installation of systemd - 32-bit If still in the build directory, step out: @@ -280,7 +280,7 @@ rm -f /usr/bin/xsltproc - + Installation of systemd - x32-bit If still in the build directory, step out: diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml index 3cc6e8076..454fc3aad 100644 --- a/chapter06/util-linux.xml +++ b/chapter06/util-linux.xml @@ -52,7 +52,6 @@ - Installation of Util-linux - + + + Installation of Util-linux - 32-bit Clean previous build: @@ -178,8 +178,9 @@ rm -rf DESTDIR - - + + + Installation of Util-linux - x32-bit Clean previous build: diff --git a/chapter06/xz.xml b/chapter06/xz.xml index 16280c904..66f0676de 100644 --- a/chapter06/xz.xml +++ b/chapter06/xz.xml @@ -68,7 +68,9 @@ ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so - + + + Installation of Xz - 32-bit Clean previous build: @@ -95,7 +97,9 @@ rm -rf DESTDIR - + + + Installation of Xz - x32-bit Clean previous build: diff --git a/chapter06/zlib.xml b/chapter06/zlib.xml index 871c245c4..3f47a3816 100644 --- a/chapter06/zlib.xml +++ b/chapter06/zlib.xml @@ -67,7 +67,9 @@ ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so - + + + Installation of Zlib - 32-bit Clean previous build: @@ -93,7 +95,9 @@ rm -rf DESTDIR - + + + Installation of Zlib - x32-bit make distclean diff --git a/chapter08/grub.xml b/chapter08/grub.xml index 904a7c1cf..fecf58603 100644 --- a/chapter08/grub.xml +++ b/chapter08/grub.xml @@ -165,7 +165,7 @@ menuentry "GNU/Linux, Linux &linux-version;-lfs-&versiond;" { } EOF - cat > /boot/grub/grub.cfg << "EOF" + cat > /boot/grub/grub.cfg << "EOF" # Begin /boot/grub/grub.cfg set default=0 set timeout=5 @@ -178,7 +178,7 @@ menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;-multilib" { } EOF - cat > /boot/grub/grub.cfg << "EOF" + cat > /boot/grub/grub.cfg << "EOF" # Begin /boot/grub/grub.cfg set default=0 set timeout=5 diff --git a/chapter08/kernel.xml b/chapter08/kernel.xml index 3bb82bea3..28000914d 100644 --- a/chapter08/kernel.xml +++ b/chapter08/kernel.xml @@ -237,11 +237,11 @@ Kernel hacking ---> cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&version; -cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&version;-multilib +cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&version;-multilib cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&versiond; -cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&versiond;-multilib +cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&versiond;-multilib System.map is a symbol file for the kernel. @@ -353,8 +353,8 @@ EOF config-&linux-version;, vmlinuz-&linux-version;-lfs-&version;, vmlinuz-&linux-version;-lfs-&versiond;, - vmlinuz-&linux-version;-lfs-&version;-multilib, - vmlinuz-&linux-version;-lfs-&versiond;-multilib, + vmlinuz-&linux-version;-lfs-&version;-multilib, + vmlinuz-&linux-version;-lfs-&versiond;-multilib, and System.map-&linux-version; /lib/modules, /usr/share/doc/linux-&linux-version; diff --git a/chapter09/theend.xml b/chapter09/theend.xml index d365903fc..ffcd32b0e 100644 --- a/chapter09/theend.xml +++ b/chapter09/theend.xml @@ -36,7 +36,7 @@ PRETTY_NAME="Linux From Scratch &versiond;" VERSION_CODENAME="<your name here>" EOF -cat > /etc/os-release << "EOF" +cat > /etc/os-release << "EOF" NAME="Linux From Scratch" VERSION="&versiond;" ID=lfs @@ -51,7 +51,7 @@ EOF running: echo &version; > /etc/lfs-release -echo &version;-multilib > /etc/lfs-release +echo &version;-multilib > /etc/lfs-release Creating the file /etc/lfs-release is recommended for compatibility with @@ -79,14 +79,14 @@ DISTRIB_CODENAME="<your name here>" DISTRIB_DESCRIPTION="Linux From Scratch" EOF -cat > /etc/lsb-release << "EOF" +cat > /etc/lsb-release << "EOF" DISTRIB_ID="Linux From Scratch" DISTRIB_RELEASE="&version;-multilib" DISTRIB_CODENAME="<your name here>" DISTRIB_DESCRIPTION="Linux From Scratch" EOF -cat > /etc/lsb-release << "EOF" +cat > /etc/lsb-release << "EOF" DISTRIB_ID="Linux From Scratch" DISTRIB_RELEASE="&versiond;-multilib" DISTRIB_CODENAME="<your name here>" diff --git a/prologue/bookinfo.xml b/prologue/bookinfo.xml index dc6cd899a..ba22dbf54 100644 --- a/prologue/bookinfo.xml +++ b/prologue/bookinfo.xml @@ -9,8 +9,8 @@ Linux From Scratch Version &version; Version &versiond; - Version &version;-multilib - Version &versiond;-multilib + Version &version;-multilib + Version &versiond;-multilib @@ -32,7 +32,7 @@ Lucas - + Editor: Thomas Trepl diff --git a/prologue/multilib.xml b/prologue/multilib.xml index 6f223909f..a579d2c3a 100644 --- a/prologue/multilib.xml +++ b/prologue/multilib.xml @@ -5,12 +5,12 @@ %general-entities; ]> - + About the Multilib Edition - What is 'multilib' + What is Multilib Today, most systems in the x86 world have a word size of 64 bit. The word size is a number of bits which can be used at once @@ -28,7 +28,7 @@ - Why doing multilib? + Why doing Multilib? From a educational point of view, LFS in its 'native' form is probably the best way to see how a Linux system is built from source. @@ -54,7 +54,7 @@ - This multilib edition of LFS goes a small step beyond and a + The multilib edition of LFS goes a small step beyond and a small step back to what has been said in the previous section when talking about target architectures. On one hand, the multilib edition is focused and limited to x86_64 @@ -71,16 +71,16 @@ - Building a multilib system + Building a Multilib System Building a multilib system is not that much different from building a system by using the 'native' LFS book. Beside some tweaks here and there the most prominent difference is that - multilib requires compiling many applications three times: + multilib requires compiling some applications up to three times: one for the primary 64-bit architecture, - one for the minor 32-bit architecture (m32), - and once again for the 32-bit architecture with 64-bit memory - extensions (mx32). + one for the 32-bit architecture (m32), + and once again for the 32-bit architecture with is 32-bit memory + access and 64 bit instruction set (mx32). Continue only if you and your system meets the following requirements: