Index: Makefile
===================================================================
--- Makefile (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ Makefile (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -35,4 +35,17 @@
endif
+ifndef ARCH
+ ARCH = default
+endif
+ifneq ($(ARCH), default)
+ 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
+
book: validate profile-html
@echo "Generating chunked XHTML files at $(BASEDIR)/ ..."
@@ -129,4 +142,5 @@
--output $(RENDERTMP)/lfs-html2.xml \
--stringparam profile.revision $(REV) \
+ --stringparam profile.arch $(ARCH) \
stylesheets/lfs-xsl/profile.xsl \
index.xml
@@ -176,4 +190,5 @@
$(Q)xsltproc --nonet --xinclude \
--stringparam profile.revision $(REV) \
+ --stringparam profile.arch $(ARCH) \
--output $(RENDERTMP)/sysv-md5sum.xml \
stylesheets/lfs-xsl/profile.xsl \
Index: chapter01/askforhelp.xml
===================================================================
--- chapter01/askforhelp.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter01/askforhelp.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -39,7 +39,11 @@
- The version of the book being used (in this case
- &version;
- &versiond;)
+
+ The version of the book being used (in this case
+ &version;
+ &version;-multilib
+ &versiond;
+ &versiond;-multilib)
+
@@ -56,5 +60,5 @@
- Note whether you have deviated from the book at all
+ Note whether you have deviated from the book at all
Index: chapter01/changelog.xml
===================================================================
--- chapter01/changelog.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter01/changelog.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -12,6 +12,8 @@
This is version
- &version;
- &versiond;
+ &version;
+ &version;-multilib
+ &versiond;
+ &versiond;-multilib
of the Linux From Scratch book, dated
&releasedate;. If this book is more than six months old, a newer and better
Index: chapter02/hostreqs.xml
===================================================================
--- chapter02/hostreqs.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter02/hostreqs.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -235,3 +235,23 @@
-->
+
+ Building multilib support requires the kernel of the host system
+ to have 32-bit emulation support included.
+
+Binary Emulations --->
+ [*] IA32 Emulation
+ <M> IA32 a.out support
+ [*] x32 ABI for 64-bit mode
+
+
+ The option 'IA32 a.out support' is
+ optional. In case your kernel does not have 'x32 ABI for 64-bit mode'
+ enabled but only 'IA32 Emulation', you can continue to build your
+ system but you have to leave out any sections showing instructions
+ for building x32 objects. If neither 'IA32 Emulation' nor
+ 'x32 ABI for 64-bit mode' is enabled, you will run in errors
+ latest when building glibc in Chapter 6,
+ so an upgrade of your host system kernel is required.
+
+
Index: chapter03/packages.xml
===================================================================
--- chapter03/packages.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter03/packages.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -344,4 +344,13 @@
Download:
MD5 sum: &iproute2-md5;
+
+
+
+
+ ISL (&isl-version;) - &isl-size;:
+
+ Home page:
+ Download:
+ MD5 sum: &isl-md5;
Index: chapter04/addinguser.xml
===================================================================
--- chapter04/addinguser.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter04/addinguser.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -85,4 +85,7 @@
x86_64) chown -v lfs $LFS/lib64 ;;
esac
+chown -v lfs $LFS/lib32
+chown -v lfs $LFS/libx32
+chown -v lfs $LFS/{lib32,libx32}
If a separate working directory was created as suggested, give
Index: chapter04/creatingminlayout.xml
===================================================================
--- chapter04/creatingminlayout.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter04/creatingminlayout.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -30,4 +30,11 @@
x86_64) mkdir -pv $LFS/lib64 ;;
esac
+mkdir -pv $LFS/usr/lib32
+ln -sv usr/lib32 $LFS/lib32
+mkdir -pv $LFS/usr/libx32
+ln -sv usr/libx32 $LFS/libx32
+mkdir -pv $LFS/usr/lib{,x}32
+ln -sv usr/lib32 $LFS/lib32
+ln -sv usr/libx32 $LFS/libx32
Index: chapter04/settingenviron.xml
===================================================================
--- chapter04/settingenviron.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter04/settingenviron.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -38,5 +38,5 @@
.bashrc file now:
-cat > ~/.bashrc << "EOF"
+cat > ~/.bashrc << "EOF"
set +h
umask 022
@@ -50,4 +50,17 @@
export LFS LC_ALL LFS_TGT PATH CONFIG_SITE
EOF
+cat > ~/.bashrc << "EOF"
+set +h
+umask 022
+LFS=/mnt/lfs
+LC_ALL=POSIX
+LFS_TGT=x86_64-lfs-linux-gnu
+LFS_TGT32=i686-lfs-linux-gnu
+LFS_TGTX32=x86_64-lfs-linux-gnux32
+PATH=/usr/bin
+if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
+PATH=$LFS/tools/bin:$PATH
+export LFS LC_ALL LFS_TGT LFS_TGT32 LFS_TGTX32 PATH
+EOF
Index: chapter05/binutils-pass1.xml
===================================================================
--- chapter05/binutils-pass1.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter05/binutils-pass1.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -71,9 +71,15 @@
Now prepare Binutils for compilation:
-../configure --prefix=$LFS/tools \
+../configure --prefix=$LFS/tools \
--with-sysroot=$LFS \
--target=$LFS_TGT \
--disable-nls \
--disable-werror
+../configure --prefix=$LFS/tools \
+ --with-sysroot=$LFS \
+ --target=$LFS_TGT \
+ --disable-nls \
+ --disable-werror \
+ --enable-multilib
@@ -124,4 +130,11 @@
+
+ --enable-multilib
+
+ Enables multilib support.
+
+
+
Index: chapter05/gcc-pass1.xml
===================================================================
--- chapter05/gcc-pass1.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter05/gcc-pass1.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -61,10 +61,12 @@
mv -v gmp-&gmp-version; gmp
tar -xf ../mpc-&mpc-version;.tar.gz
-mv -v mpc-&mpc-version; mpc
-
- On x86_64 hosts, set the default directory name for
+mv -v mpc-&mpc-version; mpc
+tar -xf ../isl-&isl-version;.tar.xz
+mv -v isl-&isl-version; isl
+
+ On x86_64 hosts, set the default directory name for
64-bit libraries to lib
:
-case $(uname -m) in
+case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
@@ -73,4 +75,12 @@
esac
+ Change the default directory name for
+ libraries:
+
+sed -e '/m64=/s/lib64/lib/' \
+ -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \
+ -i.orig gcc/config/i386/t-linux64
+
+
The GCC documentation recommends building GCC
in a dedicated build directory:
@@ -81,5 +91,5 @@
Prepare GCC for compilation:
-../configure \
+../configure \
--target=$LFS_TGT \
--prefix=$LFS/tools \
@@ -101,4 +111,29 @@
--disable-libstdcxx \
--enable-languages=c,c++
+mlist=m64,m32mlist=m64,mx32mlist=m64,m32,mx32
+../configure \
+ --target=$LFS_TGT \
+ --prefix=$LFS/tools \
+ --with-glibc-version=2.11 \
+ --with-sysroot=$LFS \
+ --with-newlib \
+ --without-headers \
+ --enable-initfini-array \
+ --disable-nls \
+ --disable-shared \
+ --enable-multilib --with-multilib-list=$mlist \
+ --disable-decimal-float \
+ --disable-threads \
+ --disable-libatomic \
+ --disable-libgomp \
+ --disable-libquadmath \
+ --disable-libssp \
+ --disable-libvtv \
+ --disable-libstdcxx \
+ --enable-languages=c,c++
+
The meaning of the configure options:
@@ -150,9 +185,16 @@
-
+
--disable-multilib
On x86_64, LFS does not support a multilib configuration.
This switch is harmless for x86.
+
+
+
+ --enable-multilib --with-multilib-list=...
+
+ LFS canbe used to support multilib. Which they are is
+ specified in the multilib list.
Index: chapter05/glibc.xml
===================================================================
--- chapter05/glibc.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter05/glibc.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -48,5 +48,5 @@
operation of the dynamic library loader:
-case $(uname -m) in
+case $(uname -m) in
i?86) ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
;;
@@ -55,4 +55,7 @@
;;
esac
+
+ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
+ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
Some of the Glibc programs use the non-FHS compliant
@@ -75,5 +78,5 @@
Next, prepare Glibc for compilation:
-../configure \
+../configure \
--prefix=/usr \
--host=$LFS_TGT \
@@ -81,4 +84,12 @@
--enable-kernel=&min-kernel; \
--with-headers=$LFS/usr/include \
+ libc_cv_slibdir=/usr/lib
+../configure \
+ --prefix=/usr \
+ --host=$LFS_TGT \
+ --build=$(../scripts/config.guess) \
+ --enable-kernel=&min-kernel; \
+ --with-headers=$LFS/usr/include \
+ --enable-multi-arch \
libc_cv_slibdir=/usr/lib
@@ -205,5 +216,5 @@
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
- Note that for 32-bit machines, the interpreter name will be
+ Note that for 32-bit machines, the interpreter name will be
/lib/ld-linux.so.2.
@@ -233,4 +244,146 @@
+
+
+
+
+ Building Glibc - 32bit
+
+ Now recompile for m32. The extracted source can be
+ reused but needs to be cleaned before installing the m32
+ version of Glibc.
+
+ Clear the build directory and remove artefacts from
+ previous build:
+
+make clean
+find .. -name "*.a" -delete
+
+ Configure Glibc for m32 with the following commands:
+
+CC="$LFS_TGT-gcc -m32" \
+CXX="$LFS_TGT-g++ -m32" \
+../configure \
+ --prefix=/usr \
+ --host=$LFS_TGT32 \
+ --build=$(../scripts/config.guess) \
+ --enable-kernel=&min-kernel; \
+ --with-headers=$LFS/usr/include \
+ --enable-multi-arch \
+ --libdir=/usr/lib32 \
+ --libexecdir=/usr/lib32 \
+ libc_cv_slibdir=/usr/lib32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -a DESTDIR/usr/lib32 $LFS/usr/
+install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
+ $LFS/usr/include/gnu/
+ln -svf ../lib32/ld-linux.so.2 $LFS/lib/ld-linux.so.2
+
+
+
+ At this point, it is imperative to stop and ensure that the basic
+ functions (compiling and linking) of the new toolchain are working as
+ expected. To perform a sanity check, run the following commands:
+
+echo 'int main(){}' > dummy.c
+$LFS_TGT-gcc -m32 dummy.c
+readelf -l a.out | grep '/ld-linux'
+
+ If everything is working correctly, there should be no errors,
+ and the output of the last command will be of the form:
+
+[Requesting program interpreter: /lib/ld-linux.so.2]
+
+ If the output is not shown as above or there was no output at all,
+ then something is wrong. Investigate and retrace the steps to find out
+ where the problem is and correct it. This issue must be resolved before
+ continuing on.
+
+ Once all is well, clean up the test files:
+
+rm -v dummy.c a.out
+
+
+
+
+
+
+
+
+
+
+ Building Glibc - x32bit
+
+ Now recompile for mx32. The extracted source can be
+ reused but needs to be cleaned before installing the mx32
+ version of Glibc.
+
+ Clear the build directory and remove artefacts from
+ previous build:
+
+make clean
+find .. -name "*.a" -delete
+
+ Configure Glibc for mx32 with the following commands:
+
+CC="$LFS_TGT-gcc -mx32" \
+CXX="$LFS_TGT-g++ -mx32" \
+../configure \
+ --prefix=/usr \
+ --host=$LFS_TGTX32 \
+ --build=$(../scripts/config.guess) \
+ --enable-kernel=&min-kernel; \
+ --with-headers=$LFS/usr/include \
+ --enable-multi-arch \
+ --libdir=/usr/libx32 \
+ --libexecdir=/usr/libx32 \
+ libc_cv_slibdir=/usr/libx32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -a DESTDIR/usr/libx32 $LFS/usr/
+install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \
+ $LFS/usr/include/gnu/
+ln -svf ../libx32/ld-linux-x32.so.2 $LFS/lib/ld-linux-x32.so.2
+
+
+ At this point, it is imperative to stop and ensure that the basic
+ functions (compiling and linking) of the new toolchain are working as
+ expected. To perform a sanity check, run the following commands:
+
+echo 'int main(){}' > dummy.c
+$LFS_TGT-gcc -mx32 dummy.c
+readelf -l a.out | grep '/ld-linux-x32'
+
+ If everything is working correctly, there should be no errors,
+ and the output of the last command will be of the form:
+
+[Requesting program interpreter: /libx32/ld-linux-x32.so.2]
+
+ If the output is not shown as above or there was no output at all,
+ then something is wrong. Investigate and retrace the steps to find out
+ where the problem is and correct it. This issue must be resolved before
+ continuing on.
+
+ Once all is well, clean up the test files:
+
+rm -v dummy.c a.out
+
+
+
+
+
Index: chapter05/libstdc++.xml
===================================================================
--- chapter05/libstdc++.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter05/libstdc++.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -82,4 +82,14 @@
+
+ --disable-multilib
+
+ Even when building the multilib version, this switch is
+ given. This is because the additionally built libraries are
+ not required in this stage and some disk space and compile
+ time can be saved.
+
+
+
--disable-libstdcxx-pch
Index: chapter06/binutils-pass2.xml
===================================================================
--- chapter06/binutils-pass2.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter06/binutils-pass2.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -51,5 +51,5 @@
Prepare Binutils for compilation:
-../configure \
+../configure \
--prefix=/usr \
--build=$(../config.guess) \
@@ -59,4 +59,13 @@
--disable-werror \
--enable-64-bit-bfd
+../configure \
+ --prefix=/usr \
+ --build=$(../config.guess) \
+ --host=$LFS_TGT \
+ --disable-nls \
+ --enable-shared \
+ --disable-werror \
+ --enable-64-bit-bfd \
+ --enable-multilib
@@ -77,4 +86,11 @@
Enables 64-bit support (on hosts with narrower word sizes).
May not be needed on 64-bit systems, but does no harm.
+
+
+
+
+ --enable-multilib
+
+ Enables multilib support in bintutils.
Index: chapter06/gcc-pass2.xml
===================================================================
--- chapter06/gcc-pass2.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter06/gcc-pass2.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -53,18 +53,25 @@
mv -v gmp-&gmp-version; gmp
tar -xf ../mpc-&mpc-version;.tar.gz
-mv -v mpc-&mpc-version; mpc
+mv -v mpc-&mpc-version; mpc
+tar -xf ../isl-&isl-version;.tar.xz
+mv -v isl-&isl-version; isl
- If building on x86_64, change the default directory name for 64-bit
+
+ If building on x86_64, change the default directory name for 64-bit
libraries to lib
:
-case $(uname -m) in
+case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
;;
esac
+
+ Change the default directory name for
+ libraries:
+
+sed -e '/m64=/s/lib64/lib/' \
+ -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \
+ -i.orig gcc/config/i386/t-linux64
@@ -85,5 +92,5 @@
Now prepare GCC for compilation:
-../configure \
+../configure \
--build=$(../config.guess) \
--host=$LFS_TGT \
@@ -94,4 +101,25 @@
--disable-nls \
--disable-multilib \
+ --disable-decimal-float \
+ --disable-libatomic \
+ --disable-libgomp \
+ --disable-libquadmath \
+ --disable-libssp \
+ --disable-libvtv \
+ --disable-libstdcxx \
+ --enable-languages=c,c++
+mlist=m64,m32mlist=m64,mx32mlist=m64,m32,mx32
+../configure \
+ --build=$(../config.guess) \
+ --host=$LFS_TGT \
+ --prefix=/usr \
+ CC_FOR_TARGET=$LFS_TGT-gcc \
+ --with-build-sysroot=$LFS \
+ --enable-initfini-array \
+ --disable-nls \
+ --enable-multilib --with-multilib-list=$mlist \
--disable-decimal-float \
--disable-libatomic \
Index: chapter06/ncurses.xml
===================================================================
--- chapter06/ncurses.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter06/ncurses.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -151,4 +151,84 @@
+
+
+
+
+ Building Ncurses - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Ncurses for compilation:
+
+CC="$LFS_TGT-gcc -m32" \
+CXX="$LFS_TGT-g++ -m32" \
+./configure --prefix=/usr \
+ --host=$LFS_TGT32 \
+ --build=$(./config.guess) \
+ --libdir=/usr/lib32 \
+ --mandir=/usr/share/man \
+ --with-shared \
+ --without-debug \
+ --without-ada \
+ --without-normal \
+ --enable-pc-files \
+ --enable-widec \
+ --with-pkg-config-libdir=/usr/lib32/pkgconfig
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR TIC_PATH=$(pwd)/build/progs/tic install
+ln -s libncursesw.so DESTDIR/usr/lib32/libcursesw.so
+cp -Rv DESTDIR/usr/lib32/* $LFS/usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+ Building Ncurses - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Ncurses for compilation:
+
+CC="$LFS_TGT-gcc -mx32" \
+CXX="$LFS_TGT-g++ -mx32" \
+./configure --prefix=/usr \
+ --host=$LFS_TGTX32 \
+ --build=$(./config.guess) \
+ --libdir=/usr/libx32 \
+ --mandir=/usr/share/man \
+ --with-shared \
+ --without-debug \
+ --without-ada \
+ --without-normal \
+ --enable-pc-files \
+ --enable-widec \
+ --with-pkg-config-libdir=/usr/libx32/pkgconfig
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR TIC_PATH=$(pwd)/build/progs/tic install
+ln -s libncursesw.so DESTDIR/usr/libx32/libcursesw.so
+cp -Rv DESTDIR/usr/libx32/* $LFS/usr/libx32
+rm -rf DESTDIR
+
+
+
Index: chapter07/changingowner.xml
===================================================================
--- chapter07/changingowner.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter07/changingowner.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -39,3 +39,8 @@
esac
+ Some more directories exists for
+ multilib support. Change their ownership, too:
+chown -R root:root $LFS/lib32
+chown -R root:root $LFS/libx32
+
Index: chapter07/creatingdirs.xml
===================================================================
--- chapter07/creatingdirs.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter07/creatingdirs.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -42,4 +42,7 @@
install -dv -m 1777 /tmp /var/tmp
+ Required directories for multilib
+ support has already been created while previous installation steps.
+
Directories are, by default, created with permission mode 755, but
this is not desirable for all directories. In the commands above, two
Index: chapter07/libstdc++-pass2.xml
===================================================================
--- chapter07/libstdc++-pass2.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter07/libstdc++-pass2.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -63,8 +63,15 @@
Prepare libstdc++ for compilation:
-../libstdc++-v3/configure \
+../libstdc++-v3/configure \
CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
--prefix=/usr \
--disable-multilib \
+ --disable-nls \
+ --host=$(uname -m)-lfs-linux-gnu \
+ --disable-libstdcxx-pch
+../libstdc++-v3/configure \
+ CXXFLAGS="-g -O2 -D_GNU_SOURCE" \
+ --prefix=/usr \
+ --enable-multilib \
--disable-nls \
--host=$(uname -m)-lfs-linux-gnu \
@@ -99,4 +106,14 @@
+
+ --enable-multilib
+
+ This switch is set by default but it is added here
+ explicitly for documentary purpose. The libstdc++ libraries
+ will be built for every arch (m64, m32, mx32) which are
+ made available in .
+
+
+
Index: chapter07/stripping.xml
===================================================================
--- chapter07/stripping.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter07/stripping.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -16,5 +16,8 @@
While still in chroot, remove those files now:
-find /usr/{lib,libexec} -name \*.la -delete
+find /usr/{lib,libexec} -name \*.la -delete
+find /usr/{lib{,32},libexec} -name \*.la -delete
+find /usr/{lib{,x32},libexec} -name \*.la -delete
+find /usr/{lib{,{,x}32},libexec} -name \*.la -delete
Remove the documentation of the temporary tools, to prevent them
@@ -88,5 +91,14 @@
Strip off debugging symbols from binaries:
-strip --strip-debug $LFS/usr/lib/*
+strip --strip-debug $LFS/usr/lib/*
+strip --strip-unneeded $LFS/usr/{,s}bin/*
+strip --strip-unneeded $LFS/tools/bin/*
+strip --strip-debug $LFS/usr/lib{,32}/*
+strip --strip-unneeded $LFS/usr/{,s}bin/*
+strip --strip-unneeded $LFS/tools/bin/*
+strip --strip-debug $LFS/usr/lib{,x32}/*
+strip --strip-unneeded $LFS/usr/{,s}bin/*
+strip --strip-unneeded $LFS/tools/bin/*
+strip --strip-debug $LFS/usr/lib{,{,x}32}/*
strip --strip-unneeded $LFS/usr/{,s}bin/*
strip --strip-unneeded $LFS/tools/bin/*
Index: chapter07/util-linux.xml
===================================================================
--- chapter07/util-linux.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter07/util-linux.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -127,4 +127,84 @@
+
+
+
+
+
+ Installation of Util-linux - 32-bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Util-linux for compilation:
+
+CC="gcc -m32" \
+./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
+ --docdir=/usr/share/doc/util-linux-&util-linux-version; \
+ --disable-chfn-chsh \
+ --disable-login \
+ --disable-nologin \
+ --disable-su \
+ --disable-setpriv \
+ --disable-runuser \
+ --disable-pylibmount \
+ --disable-static \
+ --without-python \
+ --libdir=/usr/lib32 \
+ --host=i686-pc-linux-gnu
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Util-linux - x32-bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Util-linux for compilation:
+
+CC="gcc -mx32" \
+./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
+ --docdir=/usr/share/doc/util-linux-&util-linux-version; \
+ --disable-chfn-chsh \
+ --disable-login \
+ --disable-nologin \
+ --disable-su \
+ --disable-setpriv \
+ --disable-runuser \
+ --disable-pylibmount \
+ --disable-static \
+ --without-python \
+ --libdir=/usr/libx32 \
+ --host=x86_64-pc-linux-gnux32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
+
Index: chapter08/acl.xml
===================================================================
--- chapter08/acl.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/acl.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -64,4 +64,68 @@
+
+
+
+
+
+
+ Installation of Acl - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Xz for compilation:
+
+CC="gcc -m32" ./configure \
+ --prefix=/usr \
+ --disable-static \
+ --libdir=/usr/lib32 \
+ --libexecdir=/usr/lib32 \
+ --host=i686-pc-linux-gnu
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Acl - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Xz for compilation:
+
+CC="gcc -mx32" ./configure \
+ --prefix=/usr \
+ --disable-static \
+ --libdir=/usr/libx32 \
+ --libexecdir=/usr/libx32 \
+ --host=x86_64-pc-linux-gnux32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
Index: chapter08/attr.xml
===================================================================
--- chapter08/attr.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/attr.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -65,4 +65,66 @@
+
+
+
+
+
+ Installation of Attr - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Attr for compilation:
+
+CC="gcc -m32" ./configure \
+ --prefix=/usr \
+ --disable-static \
+ --libdir=/usr/lib32 \
+ --host=i686-pc-linux-gnu
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Attr - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Attr for compilation:
+
+CC="gcc -mx32" ./configure \
+ --prefix=/usr \
+ --disable-static \
+ --libdir=/usr/libx32 \
+ --host=x86_64-pc-linux-gnux32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
+
Contents of Attr
Index: chapter08/binutils.xml
===================================================================
--- chapter08/binutils.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/binutils.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -71,5 +71,5 @@
Prepare Binutils for compilation:
-../configure --prefix=/usr \
+../configure --prefix=/usr \
--enable-gold \
--enable-ld=default \
@@ -79,4 +79,14 @@
--enable-64-bit-bfd \
--with-system-zlib
+../configure --prefix=/usr \
+ --enable-gold \
+ --enable-ld=default \
+ --enable-plugins \
+ --enable-shared \
+ --disable-werror \
+ --enable-64-bit-bfd \
+ --with-system-zlib \
+ --enable-multilib
+
The meaning of the configure parameters:
@@ -110,4 +120,11 @@
Enables 64-bit support (on hosts with narrower word sizes).
May not be needed on 64-bit systems, but does no harm.
+
+
+
+
+ --enable-multilib
+
+ Enables multilib support in bintutils.
Index: chapter08/bzip2.xml
===================================================================
--- chapter08/bzip2.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/bzip2.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -103,4 +103,58 @@
+
+
+
+
+
+
+ Installation of Bzip2 - 32bit
+
+ Clean previous build:
+
+make clean
+
+ Compile the package:
+
+sed -e "s/^CC=.*/CC=gcc -m32/" -i Makefile{,-libbz2_so}
+make -f Makefile-libbz2_so
+make libbz2.a
+
+ Install the package:
+
+install -Dm755 libbz2.so.1.0.8 /usr/lib32/libbz2.so.1.0.8
+ln -sf libbz2.so.1.0.8 /usr/lib32/libbz2.so
+ln -sf libbz2.so.1.0.8 /usr/lib32/libbz2.so.1
+ln -sf libbz2.so.1.0.8 /usr/lib32/libbz2.so.1.0
+install -Dm644 libbz2.a /usr/lib32/libbz2.a
+
+
+
+
+
+
+
+
+ Installation of Bzip2 - x32bit
+
+ Clean previous build:
+
+make clean
+
+ Compile the package:
+
+sed -e "s/^CC=.*/CC=gcc -mx32/" -i Makefile{,-libbz2_so}
+make -f Makefile-libbz2_so
+make libbz2.a
+
+ Install the package:
+
+install -Dm755 libbz2.so.1.0.8 /usr/libx32/libbz2.so.1.0.8
+ln -sf libbz2.so.1.0.8 /usr/libx32/libbz2.so
+ln -sf libbz2.so.1.0.8 /usr/libx32/libbz2.so.1
+ln -sf libbz2.so.1.0.8 /usr/libx32/libbz2.so.1.0
+install -Dm644 libbz2.a /usr/libx32/libbz2.a
+
+
Index: chapter08/chapter08.xml
===================================================================
--- chapter08/chapter08.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/chapter08.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -35,4 +35,5 @@
+
Index: chapter08/eudev.xml
===================================================================
--- chapter08/eudev.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/eudev.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -85,4 +85,74 @@
+
+
+
+
+
+ Installation of Eudev - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Eudev for compilation:
+
+CC="gcc -m32" \
+./configure --host=i686-pc-linux-gnu \
+ --prefix=/usr \
+ --bindir=/usr/sbin \
+ --libdir=/usr/lib32 \
+ --sysconfdir=/etc \
+ --disable-manpages \
+ --disable-static \
+ --config-cache
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Eudev - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Eudev for compilation:
+
+CC="gcc -mx32" \
+./configure --host=x86_64-lfs-linux-gnux32 \
+ --prefix=/usr \
+ --bindir=/usr/sbin \
+ --libdir=/usr/libx32 \
+ --sysconfdir=/etc \
+ --disable-manpages \
+ --disable-static \
+ --config-cache
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
+
Configuring Eudev
Index: chapter08/expat.xml
===================================================================
--- chapter08/expat.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/expat.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -66,4 +66,68 @@
+
+
+
+
+
+ Installation of Expat - 32bit
+
+ Clean previous build but keep precompiled doc because it
+ cannot be rebuilt in this stage of the system:
+
+sed -e "/^am__append_1/ s/doc//" -i Makefile
+make clean
+
+ Prepare Expat for compilation:
+
+CC="gcc -m32" ./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib32 \
+ --host=i686-pc-linux-gnu
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Expat - x32bit
+
+ Clean previous build but keep precompiled doc because it
+ cannot be rebuilt in this stage of the system:
+
+sed -e "/^am__append_1/ s/doc//" -i Makefile
+make clean
+
+ Prepare Expat for compilation:
+
+CC="gcc -mx32" ./configure \
+ --prefix=/usr \
+ --libdir=/usr/libx32 \
+ --host=x86_64-pc-linux-gnux32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
+
Contents of Expat
Index: chapter08/file.xml
===================================================================
--- chapter08/file.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/file.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -60,4 +60,63 @@
+
+
+
+
+
+ Installation of File - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare File for compilation:
+
+CC="gcc -m32" ./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib32 \
+ --host=i686-pc-linux-gnu
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of File - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare File for compilation:
+
+CC="gcc -mx32" ./configure \
+ --prefix=/usr \
+ --libdir=/usr/libx32 \
+ --host=x86_64-pc-linux-gnux32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
Index: chapter08/gcc.xml
===================================================================
--- chapter08/gcc.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/gcc.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -50,5 +50,5 @@
libraries to lib
:
-case $(uname -m) in
+case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
@@ -57,4 +57,11 @@
esac
+ Change the default directory name for 64-bit
+ libraries to lib
:
+
+sed -e '/m64=/s/lib64/lib/' \
+ -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \
+ -i.orig gcc/config/i386/t-linux64
+
The GCC documentation recommends building GCC in a dedicated build directory:
@@ -64,9 +71,20 @@
Prepare GCC for compilation:
-../configure --prefix=/usr \
+../configure --prefix=/usr \
LD=ld \
--enable-languages=c,c++ \
--disable-multilib \
--disable-bootstrap \
+ --with-system-zlib
+mlist=m64,m32mlist=m64,mx32mlist=m64,m32,mx32
+../configure --prefix=/usr \
+ LD=ld \
+ --enable-languages=c,c++ \
+ --enable-multilib \
+ --with-multilib-list=$mlist \
+ --disable-bootstrap \
--with-system-zlib
@@ -272,8 +290,9 @@
SEARCH_DIR("/usr/lib");
- A 32-bit system may see a few different directories. For example, here
+ A 32-bit system may see a few different directories. For example, here
is the output from an i686 machine:
-SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32")
+
+SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32")
SEARCH_DIR("/usr/local/lib32")
SEARCH_DIR("/lib32")
Index: chapter08/glibc.xml
===================================================================
--- chapter08/glibc.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/glibc.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -68,9 +68,16 @@
Prepare Glibc for compilation:
-../configure --prefix=/usr \
+../configure --prefix=/usr \
--disable-werror \
--enable-kernel=&min-kernel; \
--enable-stack-protector=strong \
--with-headers=/usr/include \
+ libc_cv_slibdir=/usr/lib
+../configure --prefix=/usr \
+ --disable-werror \
+ --enable-kernel=&min-kernel; \
+ --enable-stack-protector=strong \
+ --with-headers=/usr/include \
+ --enable-multi-arch \
libc_cv_slibdir=/usr/lib
@@ -486,4 +493,154 @@
+
+
+
+
+ Building Glibc - 32bit
+
+ Now recompile for m32. The extracted source can be
+ reused but needs to be cleaned before installing the m32
+ version of Glibc.
+
+ Clear the build directory and remove artefacts from
+ previous build:
+
+rm -rf ./*
+find .. -name "*.a" -delete
+
+ Configure Glibc for m32 with the following commands:
+
+CC="gcc -m32" CXX="g++ -m32" \
+../configure \
+ --prefix=/usr \
+ --host=i686-pc-linux-gnu \
+ --build=$(../scripts/config.guess) \
+ --enable-kernel=&min-kernel; \
+ --with-headers=/usr/include \
+ --enable-multi-arch \
+ --libdir=/usr/lib32 \
+ --libexecdir=/usr/lib32 \
+ libc_cv_slibdir=/usr/lib32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -a DESTDIR/usr/lib32/* /usr/lib32/
+install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
+ /usr/include/gnu/
+
+
+ Add the library name to the dynamic loader config:
+
+echo "/usr/lib32" >> /etc/ld.so.conf
+
+
+ At this point, it is imperative to stop and ensure that the basic
+ functions (compiling and linking) of the new toolchain are working as
+ expected. To perform a sanity check, run the following commands:
+
+echo 'int main(){}' > dummy.c
+gcc -m32 dummy.c
+readelf -l a.out | grep '/ld-linux'
+
+ If everything is working correctly, there should be no errors,
+ and the output of the last command will be of the form:
+
+[Requesting program interpreter: /lib/ld-linux.so.2]
+
+ If the output is not shown as above or there was no output at all,
+ then something is wrong. Investigate and retrace the steps to find out
+ where the problem is and correct it. This issue must be resolved before
+ continuing on.
+
+ Once all is well, clean up the test files:
+
+rm -v dummy.c a.out
+
+
+
+
+
+
+
+
+
+
+ Building Glibc - x32bit
+
+ Now recompile for mx32. The extracted source can be
+ reused but needs to be cleaned before installing the mx32
+ version of Glibc.
+
+ Clear the build directory and remove artefacts from
+ previous build:
+
+rm -rf ./*
+find .. -name "*.a" -delete
+
+ Configure Glibc for mx32 with the following commands:
+
+CC="gcc -mx32" CXX="g++ -mx32" \
+../configure \
+ --prefix=/usr \
+ --host=x86_64-pc-linux-gnux32 \
+ --build=$(../scripts/config.guess) \
+ --enable-kernel=&min-kernel; \
+ --with-headers=/usr/include \
+ --enable-multi-arch \
+ --libdir=/usr/libx32 \
+ --libexecdir=/usr/libx32 \
+ libc_cv_slibdir=/usr/libx32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -a DESTDIR/usr/libx32/* /usr/libx32/
+install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \
+ /usr/include/gnu/
+
+ Add the library name to the dynamic loader config:
+
+echo "/usr/libx32" >> /etc/ld.so.conf
+
+
+ At this point, it is imperative to stop and ensure that the basic
+ functions (compiling and linking) of the new toolchain are working as
+ expected. To perform a sanity check, run the following commands:
+
+echo 'int main(){}' > dummy.c
+gcc -mx32 dummy.c
+readelf -l a.out | grep '/ld-linux-x32'
+
+ If everything is working correctly, there should be no errors,
+ and the output of the last command will be of the form:
+
+[Requesting program interpreter: /libx32/ld-linux-x32.so.2]
+
+ If the output is not shown as above or there was no output at all,
+ then something is wrong. Investigate and retrace the steps to find out
+ where the problem is and correct it. This issue must be resolved before
+ continuing on.
+
+ Once all is well, clean up the test files:
+
+rm -v dummy.c a.out
+
+
+
+
+
Contents of Glibc
Index: chapter08/gmp.xml
===================================================================
--- chapter08/gmp.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/gmp.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -121,4 +121,136 @@
+
+
+
+
+
+ Installation of GMP - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Generic libraries can be created by running
+ the following:
+
+cp -v configfsf.guess config.guess
+cp -v configfsf.sub config.sub
+
+ Prepare GMP for compilation:
+
+ABI="32" \
+CFLAGS="-m32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=i686" \
+CXXFLAGS="$CFLAGS" \
+PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
+./configure \
+ --host=i686-pc-linux-gnu \
+ --prefix=/usr \
+ --disable-static \
+ --enable-cxx \
+ --libdir=/usr/lib32 \
+ --includedir=/usr/include/m32/gmp
+
+
+ The meaning of the new configure options:
+
+
+ --includedir=/usr/include/m32/gmp
+
+ Some definitions in gmp.h differs for each arch but
+ has same name. Therefore, the headers must be separated from
+ each other.
+
+
+
+
+
+ Compile the package:
+
+sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
+make
+
+
+ The test suite for GMP in this section is considered critical.
+ Do not skip it under any circumstances.
+
+
+ Test the results:
+
+make check 2>&1 | tee gmp-check-log
+
+ Ensure that all 197 tests in the test suite passed.
+ Check the results by issuing the following command:
+
+awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+cp -Rv DESTDIR/usr/include/m32/* /usr/include/m32/
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of GMP - x32-bit
+
+ Clean previous build:
+
+make distclean
+
+ Generic libraries can be created by running
+ the following:
+
+cp -v configfsf.guess config.guess
+cp -v configfsf.sub config.sub
+
+ Prepare GMP for compilation:
+
+ABI="x32" \
+CFLAGS="-mx32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=x86-64" \
+CXXFLAGS="$CFLAGS" \
+PKG_CONFIG_PATH="/usr/libx32/pkgconfig" \
+./configure \
+ --host=x86_64-pc-linux-gnux32 \
+ --prefix=/usr \
+ --disable-static \
+ --enable-cxx \
+ --libdir=/usr/libx32 \
+ --includedir=/usr/include/mx32/gmp
+
+ Compile the package:
+
+sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
+make
+
+
+ The test suite for GMP in this section is considered critical.
+ Do not skip it under any circumstances.
+
+
+ Test the results:
+
+make check 2>&1 | tee gmp-check-log
+
+ Ensure that all 197 tests in the test suite passed.
+ Check the results by issuing the following command:
+
+awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+cp -Rv DESTDIR/usr/include/mx32/* /usr/include/mx32/
+rm -rf DESTDIR
+
+
+
Contents of GMP
Index: chapter08/isl.xml
===================================================================
--- chapter08/isl.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
+++ chapter08/isl.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -0,0 +1,113 @@
+
+
+ %general-entities;
+]>
+
+
+
+
+
+ isl
+ &isl-version;
+ &isl-url;
+
+
+ ISL-&isl-version;
+
+
+ ISL
+
+
+
+
+
+ ISL is a thread-safe C library for manipulating sets and relations
+ of integer points bounded by affine constraints.
+
+
+ &buildtime;
+ &diskspace;
+
+
+ &isl-fin-sbu;
+ &isl-fin-du;
+
+
+
+
+
+
+ Installation of ISL
+
+ Prepare ISL for compilation:
+
+./configure --prefix=/usr \
+ --disable-static \
+ --docdir=/usr/share/doc/isl-&isl-version;
+
+
+ The meaning of the new configure options:
+
+
+ --docdir=/usr/share/doc/isl-&isl-version;
+
+ This variable specifies the correct place for the
+ documentation.
+
+
+
+
+
+ Compile the package:
+
+make
+
+ Install the package and its documentation:
+
+make install
+install -vd /usr/share/doc/isl-&isl-version;
+install -m644 doc/{CodingStyle,manual.pdf,SubmittingPatches,user.pod} \
+ /usr/share/doc/isl-&isl-version;
+
+ Finally, move a misplaced file:
+
+mkdir -pv /usr/share/gdb/auto-load/usr/lib
+mv -v /usr/lib/libisl*gdb.py /usr/share/gdb/auto-load/usr/lib
+
+
+
+
+ Contents of ISL
+
+
+ Installed Libraries
+ Installed directory
+
+
+ libisl.so
+ /usr/share/doc/isl-&isl-version;
+
+
+
+
+ Short Descriptions
+
+
+
+
+ libisl
+
+ Contains integer set manipulation functions
+
+ libisl
+
+
+
+
+
+
+
+
+
Index: chapter08/kmod.xml
===================================================================
--- chapter08/kmod.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/kmod.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -83,4 +83,76 @@
+
+
+
+
+
+
+ Installation of Kmod - 32bit
+
+ Clean previous build but keep man pages as they cannot
+ be recreated since xsltproc isn't installed yet:
+
+sed -e "s/^CLEANFILES =.*/CLEANFILES =/" -i man/Makefile
+make clean
+
+ Prepare Kmod for compilation:
+
+CC="gcc -m32" ./configure \
+ --host=i686-pc-linux-gnu \
+ --prefix=/usr \
+ --libdir=/usr/lib32 \
+ --sysconfdir=/etc \
+ --with-xz \
+ --with-zlib \
+ --with-rootlibdir=/usr/lib32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Kmod - x32bit
+
+ Clean previous build but keep man pages as they cannot
+ be recreated since xsltproc isn't installed yet:
+
+sed -e "s/^CLEANFILES =.*/CLEANFILES =/" -i man/Makefile
+make clean
+
+ Prepare Kmod for compilation:
+
+CC="gcc -mx32" ./configure \
+ --host=x86_64-pc-linux-gnux32 \
+ --prefix=/usr \
+ --libdir=/usr/libx32 \
+ --sysconfdir=/etc \
+ --with-xz \
+ --with-zlib \
+ --with-rootlibdir=/usr/libx32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
Index: chapter08/libcap.xml
===================================================================
--- chapter08/libcap.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/libcap.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -80,4 +80,54 @@
+
+
+
+
+
+ Installation of Libcap - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Compile the package:
+
+make CC="gcc -m32 -march=i686"
+
+ Install the package:
+
+make lib=lib32 prefix=$PWD/DESTDIR/usr -C libcap install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+sed -e "s|^libdir=.*|libdir=/usr/lib32|" -i /usr/lib32/pkgconfig/lib{cap,psx}.pc
+chmod -v 755 /usr/lib32/libcap.so.&libcap-version;
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Libcap - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Compile the package:
+
+make CC="gcc -mx32 -march=x86-64"
+
+ Install the package:
+
+make lib=libx32 prefix=$PWD/DESTDIR/usr -C libcap install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+sed -e "s|^libdir=.*|libdir=/usr/libx32|" -i /usr/libx32/pkgconfig/lib{cap,psx}.pc
+chmod -v 755 /usr/libx32/libcap.so.&libcap-version;
+rm -rf DESTDIR
+
+
+
Contents of Libcap
Index: chapter08/libelf.xml
===================================================================
--- chapter08/libelf.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/libelf.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -69,4 +69,70 @@
+
+
+
+
+
+ Installation of Libelf - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Libtool for compilation:
+
+CC="gcc -m32" ./configure \
+ --host=i686-pc-linux-gnu \
+ --prefix=/usr \
+ --libdir=/usr/lib32 \
+ --disable-debuginfod \
+ --enable-libdebuginfod=dummy
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR -C libelf install
+install -vDm644 config/libelf.pc DESTDIR/usr/lib32/pkgconfig/libelf.pc
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Libelf - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Libtool for compilation:
+
+CC="gcc -mx32" ./configure \
+ --host=x86_64-pc-linux-gnux32 \
+ --prefix=/usr \
+ --libdir=/usr/lib32 \
+ --disable-debuginfod \
+ --enable-libdebuginfod=dummy
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR -C libelf install
+install -vDm644 config/libelf.pc DESTDIR/usr/libx32/pkgconfig/libelf.pc
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
+
Contents of Libelf
Index: chapter08/libffi.xml
===================================================================
--- chapter08/libffi.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/libffi.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -88,4 +88,76 @@
+
+
+
+
+
+ Installation of Libffi - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Libffi for compilation:
+
+CC="gcc -m32" CXX="g++ -m32" ./configure \
+ --prefix=/usr \
+ --disable-static \
+ --libdir=/usr/lib32 \
+ --with-gcc-arch=i686 \
+ --host=i686-pc-linux-gnu
+
+ Compile the package:
+
+make
+
+ To test the results, issue:
+
+make check
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Libffi - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Libffi for compilation:
+
+CC="gcc -mx32" CXX="g++ -mx32" ./configure \
+ --prefix=/usr \
+ --disable-static \
+ --libdir=/usr/libx32 \
+ --with-gcc-arch=x86_64 \
+ --host=x86_64-unknown-linux-gnux32
+
+ Compile the package:
+
+make
+
+ To test the results, issue:
+
+make check
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
+
Contents of Libffi
Index: chapter08/libtool.xml
===================================================================
--- chapter08/libtool.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/libtool.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -78,4 +78,63 @@
+
+
+
+
+
+ Installation of Libtool - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Libtool for compilation:
+
+CC="gcc -m32" ./configure \
+ --host=i686-pc-linux-gnu \
+ --prefix=/usr \
+ --libdir=/usr/lib32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Libtool - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Libtool for compilation:
+
+CC="gcc -mx32" ./configure \
+ --host=x86_64-pc-linux-gnux32 \
+ --prefix=/usr \
+ --libdir=/usr/libx32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
Index: chapter08/ncurses.xml
===================================================================
--- chapter08/ncurses.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/ncurses.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -150,4 +150,94 @@
+
+
+
+
+
+ Building Ncurses - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Ncurses for compilation:
+
+CC="gcc -m32" CXX="g++ -m32" \
+./configure --prefix=/usr \
+ --host=i686-pc-linux-gnu \
+ --libdir=/usr/lib32 \
+ --mandir=/usr/share/man \
+ --with-shared \
+ --without-debug \
+ --without-normal \
+ --enable-pc-files \
+ --enable-widec \
+ --with-pkg-config-libdir=/usr/lib32/pkgconfig
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+mkdir -p DESTDIR/usr/lib32/pkgconfig
+for lib in ncurses form panel menu ; do
+ rm -vf DESTDIR/usr/lib32/lib${lib}.so
+ echo "INPUT(-l${lib}w)" > DESTDIR/usr/lib32/lib${lib}.so
+ ln -svf ${lib}w.pc DESTDIR/usr/lib32/pkgconfig/$lib.pc
+done
+rm -vf DESTDIR/usr/lib32/libcursesw.so
+echo "INPUT(-lncursesw)" > DESTDIR/usr/lib32/libcursesw.so
+ln -sfv libncurses.so DESTDIR/usr/lib32/libcurses.so
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+ Building Ncurses - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Ncurses for compilation:
+
+CC="gcc -mx32" CXX="g++ -mx32" \
+./configure --prefix=/usr \
+ --host=x86_64-pc-linux-gnux32 \
+ --libdir=/usr/libx32 \
+ --mandir=/usr/share/man \
+ --with-shared \
+ --without-debug \
+ --without-normal \
+ --enable-pc-files \
+ --enable-widec \
+ --with-pkg-config-libdir=/usr/libx32/pkgconfig
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+mkdir -p DESTDIR/usr/libx32/pkgconfig
+for lib in ncurses form panel menu ; do
+ rm -vf DESTDIR/usr/libx32/lib${lib}.so
+ echo "INPUT(-l${lib}w)" > DESTDIR/usr/libx32/lib${lib}.so
+ ln -svf ${lib}w.pc DESTDIR/usr/libx32/pkgconfig/$lib.pc
+done
+rm -vf DESTDIR/usr/libx32/libcursesw.so
+echo "INPUT(-lncursesw)" > DESTDIR/usr/libx32/libcursesw.so
+ln -sfv libncurses.so DESTDIR/usr/libx32/libcurses.so
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
Index: chapter08/openssl.xml
===================================================================
--- chapter08/openssl.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/openssl.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -98,4 +98,74 @@
+
+
+
+
+
+
+ Installation of OpenSSL - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare OpenSSL for compilation:
+
+MACHINE="i686" \
+CC="gcc -m32 -march=i686" \
+CXX="g++ -m32 -march=i686" \
+ ./config \
+ --prefix=/usr \
+ --openssldir=/etc/ssl \
+ --libdir=lib32 \
+ shared \
+ zlib-dynamic
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of OpenSSL - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare OpenSSL for compilation:
+
+MACHINE="x86_64" \
+CC="gcc -mx32" \
+CXX="g++ -mx32" \
+ ./config \
+ --prefix=/usr \
+ --openssldir=/etc/ssl \
+ --libdir=libx32 \
+ shared \
+ zlib-dynamic
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
Index: chapter08/readline.xml
===================================================================
--- chapter08/readline.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/readline.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -101,4 +101,66 @@
+
+
+
+
+
+ Installation of Readline - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Readline for compilation:
+
+CC="gcc -m32" ./configure \
+ --host=i686-pc-linux-gnu \
+ --prefix=/usr \
+ --libdir=/usr/lib32 \
+ --disable-static
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Readline - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Readline for compilation:
+
+CC="gcc -mx32" ./configure \
+ --host=x86_64-pc-linux-gnux32 \
+ --prefix=/usr \
+ --libdir=/usr/libx32 \
+ --disable-static
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
+
Contents of Readline
Index: chapter08/revisedchroot.xml
===================================================================
--- chapter08/revisedchroot.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/revisedchroot.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -44,5 +44,7 @@
To remove them, run:
-find /usr/lib /usr/libexec -name \*.la -delete
+find /usr/lib /usr/libexec -name \*.la -delete
+find /usr/lib32 -name \*.la -delete
+find /usr/libx32 -name \*.la -delete
For more information about libtool archive files, see the
+
+cd /usr/lib32
+for LIB in $save_usrlib; do
+ objcopy --only-keep-debug $LIB $LIB.dbg
+ strip --strip-unneeded $LIB
+ objcopy --add-gnu-debuglink=$LIB.dbg $LIB
+done
+
+cd /usr/libx32
+for LIB in $save_usrlib; do
+ objcopy --only-keep-debug $LIB $LIB.dbg
+ strip --strip-unneeded $LIB
+ objcopy --add-gnu-debuglink=$LIB.dbg $LIB
+done
unset LIB save_usrlib
@@ -57,8 +70,16 @@
Now the binaries and libraries can be stripped:
find /usr/lib -type f -name \*.a \
- -exec strip --strip-debug {} ';'
+ -exec strip --strip-debug {} ';'
+find /usr/lib32 -type f -name \*.a \
+ -exec strip --strip-debug {} ';'
+find /usr/libx32 -type f -name \*.a \
+ -exec strip --strip-debug {} ';'
find /usr/lib -type f -name \*.so* ! -name \*dbg \
- -exec strip --strip-unneeded {} ';'
+ -exec strip --strip-unneeded {} ';'
+find /usr/lib32 -type f -name \*.so* ! -name \*dbg \
+ -exec strip --strip-unneeded {} ';'
+find /usr/libx32 -type f -name \*.so* ! -name \*dbg \
+ -exec strip --strip-unneeded {} ';'
find /usr/{bin,sbin,libexec} -type f \
Index: chapter08/systemd.xml
===================================================================
--- chapter08/systemd.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/systemd.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -223,4 +223,131 @@
+
+
+
+
+
+
+ Installation of systemd - 32-bit
+
+ Clean previous build:
+
+rm -rf *
+
+ Create a symlink to work around missing xsltproc:
+
+
+ln -sf /bin/true /usr/bin/xsltproc
+
+
+
+ Prepare systemd for compilation:
+
+ PKG_CONFIG_PATH="/usr/lib32/pkgconfig" \
+CC="gcc -m32 -march=i686" \
+CXX="g++ -m32 -march=i686" \
+LANG=en_US.UTF-8 \
+meson --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ -Dblkid=true \
+ -Dbuildtype=release \
+ -Ddefault-dnssec=no \
+ -Dfirstboot=false \
+ -Dinstall-tests=false \
+ -Dkill-path=/bin/kill \
+ -Dkmod-path=/bin/kmod \
+ -Dldconfig=false \
+ -Dmount-path=/bin/mount \
+ -Drootprefix= \
+ -Drootlibdir=/usr/lib32 \
+ -Dsplit-usr=true \
+ -Dsulogin-path=/sbin/sulogin \
+ -Dsysusers=false \
+ -Dumount-path=/bin/umount \
+ -Db_lto=false \
+ ..
+
+ Compile the package:
+
+LANG=en_US.UTF-8 ninja
+
+ Install the package:
+
+LANG=en_US.UTF-8 DESTDIR=$PWD/DESTDIR ninja install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+rm -f /usr/bin/xsltproc
+
+
+
+
+
+
+
+
+ Installation of systemd - x32-bit
+
+ Clean previous build:
+
+rm -rf *
+
+ Create a symlink to work around missing xsltproc:
+
+ln -sf /bin/true /usr/bin/xsltproc
+
+ Fix an issue on x32:
+
+sed '/log_debug/s@PRI_TIMEX@PRIi64@' -i src/timesync/timesyncd-manager.c
+sed '/long drift_freq;/s@long @int64_t @' -i src/timesync/timesyncd-manager.h
+
+ Prepare systemd for compilation:
+
+PKG_CONFIG_PATH="/usr/libx32/pkgconfig" \
+CC="gcc -mx32" \
+CXX="g++ -mx32" \
+CFLAGS+="-Wno-error=shift-overflow" \
+CXXFLAGS+="-Wno-error=shift-overflow" \
+LANG=en_US.UTF-8 \
+meson --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ -Dblkid=true \
+ -Dbuildtype=release \
+ -Ddefault-dnssec=no \
+ -Dfirstboot=false \
+ -Dinstall-tests=false \
+ -Dkill-path=/bin/kill \
+ -Dkmod-path=/bin/kmod \
+ -Dldconfig=false \
+ -Dmount-path=/bin/mount \
+ -Drootprefix= \
+ -Drootlibdir=/usr/libx32 \
+ -Dsplit-usr=true \
+ -Dsulogin-path=/sbin/sulogin \
+ -Dsysusers=false \
+ -Dumount-path=/bin/umount \
+ -Db_lto=false \
+ ..
+
+ Compile the package:
+
+LANG=en_US.UTF-8 ninja
+
+ Install the package:
+
+LANG=en_US.UTF-8 DESTDIR=$PWD/DESTDIR ninja install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+rm -f /usr/bin/xsltproc
+
+
Index: chapter08/util-linux.xml
===================================================================
--- chapter08/util-linux.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/util-linux.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -108,4 +108,122 @@
+
+
+
+
+
+
+ Installation of Util-linux - 32-bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Util-linux for compilation:
+
+CC="gcc -m32" \
+./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
+ --host=i686-pc-linux-gnu \
+ --libdir=/usr/lib32 \
+ --docdir=/usr/share/doc/util-linux-&util-linux-version; \
+ --disable-chfn-chsh \
+ --disable-login \
+ --disable-nologin \
+ --disable-su \
+ --disable-setpriv \
+ --disable-runuser \
+ --disable-pylibmount \
+ --disable-static \
+ --without-python \
+ --without-systemd \
+ --without-systemdsystemunitdir \
+ --enable-libmount-force-mountinfo
+
+CC="gcc -m32" \
+./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
+ --host=i686-pc-linux-gnu \
+ --libdir=/usr/lib32 \
+ --docdir=/usr/share/doc/util-linux-&util-linux-version; \
+ --disable-chfn-chsh \
+ --disable-login \
+ --disable-nologin \
+ --disable-su \
+ --disable-setpriv \
+ --disable-runuser \
+ --disable-pylibmount \
+ --disable-static \
+ --without-python \
+ --enable-libmount-force-mountinfo
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Util-linux - x32-bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Util-linux for compilation:
+
+CC="gcc -mx32" \
+./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
+ --host=x86_64-pc-linux-gnux32 \
+ --libdir=/usr/libx32 \
+ --docdir=/usr/share/doc/util-linux-&util-linux-version; \
+ --disable-chfn-chsh \
+ --disable-login \
+ --disable-nologin \
+ --disable-su \
+ --disable-setpriv \
+ --disable-runuser \
+ --disable-pylibmount \
+ --disable-static \
+ --without-python \
+ --without-systemd \
+ --without-systemdsystemunitdir \
+ --enable-libmount-force-mountinfo
+
+CC="gcc -mx32" \
+./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
+ --host=x86_64-pc-linux-gnux32 \
+ --libdir=/usr/libx32 \
+ --docdir=/usr/share/doc/util-linux-&util-linux-version; \
+ --disable-chfn-chsh \
+ --disable-login \
+ --disable-nologin \
+ --disable-su \
+ --disable-setpriv \
+ --disable-runuser \
+ --disable-pylibmount \
+ --disable-static \
+ --without-python \
+ --enable-libmount-force-mountinfo
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
Index: chapter08/xz.xml
===================================================================
--- chapter08/xz.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/xz.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -64,4 +64,66 @@
+
+
+
+
+
+
+ Installation of Xz - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Xz for compilation:
+
+CC="gcc -m32" ./configure \
+ --host=i686-pc-linux-gnu \
+ --prefix=/usr \
+ --libdir=/usr/lib32 \
+ --disable-static
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Xz - x32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Xz for compilation:
+
+CC="gcc -mx32" ./configure \
+ --host=x86_64-pc-linux-gnux32 \
+ --prefix=/usr \
+ --libdir=/usr/libx32 \
+ --disable-static
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
Index: chapter08/zlib.xml
===================================================================
--- chapter08/zlib.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/zlib.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -64,4 +64,60 @@
+
+
+
+
+
+ Installation of Zlib - 32bit
+
+ Clean previous build:
+
+make distclean
+
+ Prepare Zlib for compilation:
+
+CC="gcc -m32" \
+./configure --prefix=/usr \
+ --libdir=/usr/lib32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib32/* /usr/lib32
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Zlib - x32bit
+
+make distclean
+
+ Prepare Zlib for compilation:
+
+CC="gcc -mx32" \
+./configure --prefix=/usr \
+ --libdir=/usr/libx32
+
+ Compile the package:
+
+make
+
+ Install the package:
+
+make DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/libx32/* /usr/libx32
+rm -rf DESTDIR
+
+
+
Contents of Zlib
Index: chapter08/zstd.xml
===================================================================
--- chapter08/zstd.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter08/zstd.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -65,4 +65,52 @@
+
+
+
+
+
+
+ Installation of Zstd - 32bit
+
+ Clean previous build:
+
+make clean
+
+ Compile the package:
+
+CC="gcc -m32" make
+
+ Install the package:
+
+make prefix=/usr DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib/* /usr/lib32/
+sed -e "/^libdir/s/lib$/lib32/" -i /usr/lib32/pkgconfig/libzstd.pc
+rm -rf DESTDIR
+
+
+
+
+
+
+
+
+ Installation of Zstd - x32bit
+
+ Clean previous build:
+
+make clean
+
+ Compile the package:
+
+CC="gcc -mx32" make
+
+ Install the package:
+
+make prefix=/usr DESTDIR=$PWD/DESTDIR install
+cp -Rv DESTDIR/usr/lib/* /usr/libx32/
+sed -e "/^libdir/s/lib$/libx32/" -i /usr/libx32/pkgconfig/libzstd.pc
+rm -rf DESTDIR
+
+
Index: chapter10/kernel.xml
===================================================================
--- chapter10/kernel.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ chapter10/kernel.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -156,4 +156,37 @@
+
+
+ The kernel on a multilib system needs to be able to
+ identify and start binaries compiled for different architectures
+ than the default.
+
+
+
+ If support for any 32bit ABI was built, make sure that the option
+ "IA32 Emulation" is selected. The option 'IA32 a.out support' is
+ optional.
+
+
+
+ If support for the x32bit ABI was built, make sure that the option
+ "x32 ABI for 64-bit mode" is selected.
+
+
+Binary Emulations --->
+ [*] IA32 Emulation
+ <M> IA32 a.out support
+
+Binary Emulations --->
+ [*] x32 ABI for 64-bit mode
+
+Binary Emulations --->
+ [*] IA32 Emulation
+ <M> IA32 a.out support
+ [*] x32 ABI for 64-bit mode
+
+
+
+
The rationale for the above configuration items:
Index: packages.ent
===================================================================
--- packages.ent (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ packages.ent (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -351,4 +351,12 @@
+
+
+
+
+
+
+
+
Index: prologue/bookinfo.xml
===================================================================
--- prologue/bookinfo.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ prologue/bookinfo.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -8,6 +8,8 @@
Linux From Scratch
- Version &version;
- Version &versiond;
+ Version &version;
+ Version &versiond;
+ Version &version;-multilib
+ Version &versiond;-multilib
Published &releasedate;
@@ -30,4 +32,9 @@
Editor: DJ
Lucas
+
+
+
+ Editor: Thomas
+ Trepl
Index: prologue/multilib.xml
===================================================================
--- prologue/multilib.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
+++ prologue/multilib.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -0,0 +1,99 @@
+
+
+ %general-entities;
+]>
+
+
+
+
+ About the Multilib Edition
+
+ 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
+ in the most efficient way. Previous architectures of x86 processors
+ had a word size of 32 bit which means they have a different
+ understanding of what is the best alignment of data in memory as
+ well as they have a different mechanism to address a different size
+ of memory. Even the instruction set of the 64 bit processors is
+ quite simmilar to the instructions of 32 bit processors, binaries
+ (objects compiled to machine code) cannot directly be executed on
+ 64 bit systems.
+
+ Multilib is a mechanism to provide support for the 32 bit
+ binaries so that they can be executed of modern 64 bit CPUs.
+
+
+
+ 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.
+ There is no need to confuse with different architectures. But when
+ there is a need to run 32 binaries and you don't want to build the
+ whole system in 32 bit (which would be waste of ressources
+ nowadays) than LFS-multilib is an option. Examples for such a
+ need could be
+
+ Closed-source software without source only
+ available for 32 bit. That may be the case for printer driver
+ or any other kind of hardware drivers, the company provides
+ the binaries. If you have such a driver, LFS-multilib
+ may help you getting the stuff running
+
+ If you want to go far beyond LFS and setup a
+ virtualization platform like VirtualBox,
+ you will need multilib support
+
+ or even just because you can
+
+
+
+
+
+ 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
+ architectures only, on the other hand, it expands
+ the instructions to utilize both possible architectures, namely
+ 32-bit as well as 64-bit.
+
+ It also goes a bit beyond the basic educational
+ approach of LFS which is to show you how to build a Linux system.
+ To achieve this, no support for additional architectures than
+ the default one for your system is required. If you haven't
+ previously built by the standard LFS book, you are encouraged to
+ do so before using this edition.
+
+
+
+ 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 some applications up to three times:
+ one for the primary 64-bit architecture,
+ 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:
+
+ you have a x86_64 compatible machine
+ you already have some experience with LFS
+ you have a need for 32-bit support
+
+
+
+ If you passed all three requirements, go ahead and build LFS
+ in multilib mode.
+
+
+
+
Index: prologue/preface.xml
===================================================================
--- prologue/preface.xml (revision 3e8234557c4e07a85c578b8a993dce3365754df5)
+++ prologue/preface.xml (revision 2ab0d9caf5fc0272bf3ae7206329eef54fd4a87f)
@@ -16,4 +16,5 @@
+