aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06
diff options
context:
space:
mode:
Diffstat (limited to 'chapter06')
-rw-r--r--chapter06/binutils-pass2.xml18
-rw-r--r--chapter06/gcc-pass2.xml39
-rw-r--r--chapter06/ncurses.xml80
3 files changed, 132 insertions, 5 deletions
diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml
index e55bcf92b..cb7455b77 100644
--- a/chapter06/binutils-pass2.xml
+++ b/chapter06/binutils-pass2.xml
@@ -58,7 +58,7 @@ cd build</userinput></screen>
<para>Prepare Binutils for compilation:</para>
-<screen><userinput remap="configure">../configure \
+<screen arch="default"><userinput remap="configure">../configure \
--prefix=/usr \
--build=$(../config.guess) \
--host=$LFS_TGT \
@@ -66,6 +66,15 @@ cd build</userinput></screen>
--enable-shared \
--disable-werror \
--enable-64-bit-bfd</userinput></screen>
+<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure \
+ --prefix=/usr \
+ --build=$(../config.guess) \
+ --host=$LFS_TGT \
+ --disable-nls \
+ --enable-shared \
+ --disable-werror \
+ --enable-64-bit-bfd \
+ --enable-multilib</userinput></screen>
<variablelist>
<title>The meaning of the new configure options:</title>
@@ -87,6 +96,13 @@ cd build</userinput></screen>
</listitem>
</varlistentry>
+ <varlistentry arch="ml_32,ml_x32,ml_all">
+ <term><parameter>--enable-multilib</parameter></term>
+ <listitem>
+ <para>Enables multilib support in bintutils.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
<para>Compile the package:</para>
diff --git a/chapter06/gcc-pass2.xml b/chapter06/gcc-pass2.xml
index ef2eff517..9d3b60184 100644
--- a/chapter06/gcc-pass2.xml
+++ b/chapter06/gcc-pass2.xml
@@ -54,15 +54,23 @@ mv -v gmp-&gmp-version; gmp
tar -xf ../mpc-&mpc-version;.tar.gz
mv -v mpc-&mpc-version; mpc</userinput></screen>
- <para>If building on x86_64, change the default directory name for 64-bit
+
+ <para arch="default">If building on x86_64, change the default directory name for 64-bit
libraries to <quote>lib</quote>:</para>
-<screen><userinput remap="pre">case $(uname -m) in
+<screen arch="default"><userinput remap="pre">case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
;;
esac</userinput></screen>
+ <para arch="ml_32,ml_x32,ml_all">Change the default directory name for the
+ libraries:</para>
+
+<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">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</userinput></screen>
+
<para>Override the building rule of libgcc and libstdc++ headers, to
allow building these libraries with POSIX threads support:</para>
@@ -79,7 +87,7 @@ cd build</userinput></screen>
<para>Now prepare GCC for compilation:</para>
-<screen><userinput remap="configure">../configure \
+<screen arch="default"><userinput remap="configure">../configure \
--build=$(../config.guess) \
--host=$LFS_TGT \
--target=$LFS_TGT \
@@ -96,7 +104,30 @@ cd build</userinput></screen>
--disable-libssp \
--disable-libvtv \
--enable-languages=c,c++</userinput></screen>
-
+<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure"
+ arch="ml_32">mlist=m64,m32</userinput><userinput remap="configure"
+ arch="ml_x32">mlist=m64,mx32</userinput><userinput remap="configure"
+ arch="ml_all">mlist=m64,m32,mx32</userinput>
+<userinput remap="configure">../configure \
+ --build=$(../config.guess) \
+ --host=$LFS_TGT \
+ --target=$LFS_TGT \
+ LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \
+ --prefix=/usr \
+ --with-build-sysroot=$LFS \
+ --enable-initfini-array \
+ --disable-nls \
+ --enable-multilib --with-multilib-list=$mlist \
+ --disable-decimal-float \
+ --disable-libatomic \
+ --disable-libgomp \
+ --disable-libquadmath \
+ --disable-libssp \
+ --disable-libvtv \
+ --enable-languages=c,c++</userinput></screen>
+<!--
+ LDFLAGS_FOR_TARGET="-L$PWD/$LFS_TGT/libgcc -L$PWD/$LFS_TGT/32/libgcc -L$PWD/$LFS_TGT/x32/libgcc" \
+-->
<variablelist>
<title>The meaning of the new configure options:</title><!-- WIP -->
diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml
index d9457c081..8f7f102f9 100644
--- a/chapter06/ncurses.xml
+++ b/chapter06/ncurses.xml
@@ -189,6 +189,86 @@ echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so</userinput></screen>
</sect2>
+ <!-- - - - - - - - - - -->
+ <!-- Multilib - 32bit -->
+ <!-- - - - - - - - - - -->
+ <sect2 arch="ml_32,ml_all">
+ <title>Building Ncurses - 32bit</title>
+
+ <para>Clean previous build:</para>
+
+<screen><userinput remap="pre">make distclean</userinput></screen>
+
+ <para>Prepare Ncurses for compilation:</para>
+
+<screen><userinput remap="configure">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-normal \
+ --with-cxx-shared \
+ --without-debug \
+ --without-ada \
+ --disable-stripping \
+ --enable-widec</userinput></screen>
+
+ <para>Compile the package:</para>
+
+<screen><userinput remap="make">make</userinput></screen>
+
+ <para>Install the package:</para>
+
+<screen><userinput remap="install">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</userinput></screen>
+
+ </sect2><!-- m32 -->
+
+ <!-- - - - - - - - - - -->
+ <!-- Multilib - x32bit -->
+ <!-- - - - - - - - - - -->
+ <sect2 arch="ml_x32,ml_all">
+ <title>Building Ncurses - x32bit</title>
+
+ <para>Clean previous build:</para>
+
+<screen><userinput remap="pre">make distclean</userinput></screen>
+
+ <para>Prepare Ncurses for compilation:</para>
+
+<screen><userinput remap="configure">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-normal \
+ --with-cxx-shared \
+ --without-debug \
+ --without-ada \
+ --disable-stripping \
+ --enable-widec</userinput></screen>
+
+ <para>Compile the package:</para>
+
+<screen><userinput remap="make">make</userinput></screen>
+
+ <para>Install the package:</para>
+
+<screen><userinput remap="install">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</userinput></screen>
+
+ </sect2><!-- mx32 -->
+
<sect2 role="content">
<title/>