Changes in / [24c34df:feed564]


Ignore:
Files:
2 added
51 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r24c34df rfeed564  
    3535endif
    3636
     37ifndef ARCH
     38  ARCH = default
     39endif
     40ifneq ($(ARCH), default)
     41  ifneq ($(ARCH), ml_32)
     42    ifneq ($(ARCH), ml_x32)
     43      ifneq ($(ARCH), ml_all)
     44        $(error ARCH must be either 'default' (default if unset), 'ml_32', 'ml_x32' or 'ml_all'.)
     45      endif
     46    endif
     47  endif
     48endif
     49
    3750book: validate profile-html
    3851        @echo "Generating chunked XHTML files at $(BASEDIR)/ ..."
     
    129142                --output $(RENDERTMP)/lfs-html2.xml   \
    130143                --stringparam profile.revision $(REV) \
     144                --stringparam profile.arch $(ARCH)    \
    131145                stylesheets/lfs-xsl/profile.xsl       \
    132146                index.xml
     
    176190        $(Q)xsltproc --nonet --xinclude                    \
    177191                --stringparam profile.revision $(REV) \
     192                --stringparam profile.arch $(ARCH)    \
    178193                --output $(RENDERTMP)/sysv-md5sum.xml \
    179194                stylesheets/lfs-xsl/profile.xsl       \
  • chapter01/askforhelp.xml

    r24c34df rfeed564  
    3939    <itemizedlist>
    4040      <listitem>
    41         <para>The version of the book being used (in this case
    42               <phrase revision="sysv">&version;</phrase>
    43               <phrase revision="systemd">&versiond;</phrase>)</para>
     41        <para>
     42          The version of the book being used (in this case
     43          <phrase arch="default" revision="sysv">&version;</phrase>
     44          <phrase arch="ml_32,ml_x32,ml_all" revision="sysv">&version;-multilib</phrase>
     45          <phrase arch="default" revision="systemd">&versiond;</phrase>
     46          <phrase arch="ml_32,ml_x32,ml_all" revision="systemd">&versiond;-multilib</phrase>)
     47        </para>
    4448      </listitem>
    4549      <listitem>
     
    5660      </listitem>
    5761      <listitem>
    58         <para>Note whether you have deviated from the book at all </para>
     62        <para>Note whether you have deviated from the book at all</para>
    5963      </listitem>
    6064    </itemizedlist>
  • chapter01/changelog.xml

    r24c34df rfeed564  
    1212
    1313  <para>This is version
    14         <phrase revision="sysv">&version;</phrase>
    15         <phrase revision="systemd">&versiond;</phrase>
     14    <phrase arch="default" revision="sysv">&version;</phrase>
     15    <phrase arch="ml_32,ml_x32,ml_all" revision="sysv">&version;-multilib</phrase>
     16    <phrase arch="default" revision="systemd">&versiond;</phrase>
     17    <phrase arch="ml_32,ml_x32,ml_all" revision="systemd">&versiond;-multilib</phrase>
    1618  of the Linux From Scratch book, dated
    1719  &releasedate;. If this book is more than six months old, a newer and better
  • chapter02/hostreqs.xml

    r24c34df rfeed564  
    235235-->
    236236
     237    <para arch="ml_32,ml_x32,ml_all">
     238      Building multilib support requires the kernel of the host system
     239      to have 32-bit emulation support included.
     240    </para>
     241<screen arch="ml_32,ml_x32,ml_all">Binary Emulations  ---&gt;
     242    [*] IA32 Emulation
     243    &lt;M&gt;   IA32 a.out support
     244    [*] x32 ABI for 64-bit mode
     245</screen>
     246
     247    <para arch="ml_32,ml_x32,ml_all">The option 'IA32 a.out support' is
     248      optional. In case your kernel does not have 'x32 ABI for 64-bit mode'
     249      enabled but only 'IA32 Emulation', you can continue to build your
     250      system but you have to leave out any sections showing instructions
     251      for building x32 objects. If neither 'IA32 Emulation' nor
     252      'x32 ABI for 64-bit mode' is enabled, you will run in errors
     253      latest when building <application>glibc</application> in Chapter 6,
     254      so an upgrade of your host system kernel is required.
     255    </para>
     256   
    237257</sect1>
  • chapter03/packages.xml

    r24c34df rfeed564  
    344344        <para>Download: <ulink url="&iproute2-url;"/></para>
    345345        <para>MD5 sum: <literal>&iproute2-md5;</literal></para>
     346      </listitem>
     347    </varlistentry>
     348
     349    <varlistentry arch="ml_32,ml_x32,ml_all">
     350      <term>ISL (&isl-version;) - <token>&isl-size;</token>:</term>
     351      <listitem>
     352        <para>Home page: <ulink url="&isl-home;"/></para>
     353        <para>Download: <ulink url="&isl-url;"/></para>
     354        <para>MD5 sum: <literal>&isl-md5;</literal></para>
    346355      </listitem>
    347356    </varlistentry>
  • chapter04/addinguser.xml

    r24c34df rfeed564  
    8585  x86_64) chown -v lfs $LFS/lib64 ;;
    8686esac</userinput></screen>
     87<screen arch="ml_32"  ><userinput>chown -v lfs $LFS&lib-m32;</userinput></screen>
     88<screen arch="ml_x32" ><userinput>chown -v lfs $LFS&lib-mx32;</userinput></screen>
     89<screen arch="ml_all" ><userinput>chown -v lfs $LFS/{lib32,libx32}</userinput></screen>
    8790
    8891  <para>If a separate working directory was created as suggested, give
  • chapter04/creatingminlayout.xml

    r24c34df rfeed564  
    2525  x86_64) mkdir -pv $LFS/lib64 ;;
    2626esac</userinput></screen>
    27 
     27<screen arch="ml_32"  ><userinput>mkdir -pv $LFS&lib-m32;</userinput></screen>
     28<screen arch="ml_x32" ><userinput>mkdir -pv $LFS&lib-mx32;</userinput></screen>
     29<screen arch="ml_all" ><userinput>mkdir -pv $LFS/lib{,x}32</userinput></screen>
     30<!--
     31<screen arch="ml_32"  ><userinput>mkdir -pv $LFS/{usr/,}lib32</userinput></screen>
     32<screen arch="ml_x32" ><userinput>mkdir -pv $LFS/{usr/,}libx32</userinput></screen>
     33<screen arch="ml_all" ><userinput>mkdir -pv $LFS/{usr/,}{lib32,libx32}</userinput></screen>
     34<screen arch="ml_32"  ><userinput>mkdir -pv $LFS&usr-inc-m32;</userinput></screen>
     35<screen arch="ml_x32" ><userinput>mkdir -pv $LFS&usr-inc-mx32;</userinput></screen>
     36<screen arch="ml_all" ><userinput>mkdir -pv $LFS&usr-inc-m32;
     37mkdir -pv $LFS&usr-inc-mx32;</userinput></screen>
     38-->
    2839  <para>Programs in <xref linkend="chapter-temporary-tools"/> will be compiled
    2940  with a cross-compiler (more details in section <xref
  • chapter04/settingenviron.xml

    r24c34df rfeed564  
    3838  <filename>.bashrc</filename> file now:</para>
    3939
    40 <screen><userinput>cat &gt; ~/.bashrc &lt;&lt; "EOF"
     40<screen arch="default"><userinput>cat &gt; ~/.bashrc &lt;&lt; "EOF"
    4141<literal>set +h
    4242umask 022
     
    5050export LFS LC_ALL LFS_TGT PATH CONFIG_SITE</literal>
    5151EOF</userinput></screen>
     52<screen arch="ml_32,ml_x32,ml_all"><userinput>cat &gt; ~/.bashrc &lt;&lt; "EOF"
     53<literal>set +h
     54umask 022
     55LFS=/mnt/lfs
     56LC_ALL=POSIX
     57LFS_TGT=x86_64-lfs-linux-gnu
     58LFS_TGT32=i686-lfs-linux-gnu
     59LFS_TGTX32=x86_64-lfs-linux-gnux32
     60PATH=/usr/bin
     61if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
     62PATH=$LFS/tools/bin:$PATH
     63export LFS LC_ALL LFS_TGT LFS_TGT32 LFS_TGTX32 PATH</literal>
     64EOF</userinput></screen>
    5265
    5366  <variablelist>
  • chapter05/binutils-pass1.xml

    r24c34df rfeed564  
    7171    <para>Now prepare Binutils for compilation:</para>
    7272
    73 <screen><userinput remap="configure">../configure --prefix=$LFS/tools       \
     73<screen arch="default"><userinput remap="configure">../configure --prefix=$LFS/tools       \
    7474             --with-sysroot=$LFS        \
    7575             --target=$LFS_TGT          \
    7676             --disable-nls              \
    7777             --disable-werror</userinput></screen>
     78<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=$LFS/tools       \
     79             --with-sysroot=$LFS        \
     80             --target=$LFS_TGT          \
     81             --disable-nls              \
     82             --disable-werror           \
     83             --enable-multilib</userinput></screen>
    7884
    7985    <variablelist>
     
    124130      </varlistentry>
    125131
     132      <varlistentry arch="ml_32,ml_x32,ml_all">
     133        <term><parameter>--enable-multilib</parameter></term>
     134        <listitem>
     135          <para>Enables multilib support.</para>
     136        </listitem>
     137      </varlistentry>
     138
    126139    </variablelist>
    127140
  • chapter05/gcc-pass1.xml

    r24c34df rfeed564  
    6161mv -v gmp-&gmp-version; gmp
    6262tar -xf ../mpc-&mpc-version;.tar.gz
    63 mv -v mpc-&mpc-version; mpc</userinput></screen>
    64 
    65     <para>On x86_64 hosts, set the default directory name for
     63mv -v mpc-&mpc-version; mpc</userinput>
     64<userinput remap="pre" arch="ml_32,ml_x32,ml_all">tar -xf ../isl-&isl-version;.tar.xz
     65mv -v isl-&isl-version; isl</userinput></screen>
     66
     67    <para arch="default">On x86_64 hosts, set the default directory name for
    6668    64-bit libraries to <quote>lib</quote>:</para>
    6769
    68 <screen><userinput remap="pre">case $(uname -m) in
     70<screen arch="default"><userinput remap="pre">case $(uname -m) in
    6971  x86_64)
    7072    sed -e '/m64=/s/lib64/lib/' \
     
    7375esac</userinput></screen>
    7476
     77    <para arch="ml_32,ml_x32,ml_all">Change the default directory name for
     78    libraries:</para>
     79
     80<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
     81    -e '/m32=/s/m32=.*/m32=..\&lib-m32;$(call if_multiarch,:i386-linux-gnu)/' \
     82    -i.orig gcc/config/i386/t-linux64
     83</userinput></screen>
     84
    7585    <para>The GCC documentation recommends building GCC
    7686    in a dedicated build directory:</para>
     
    8191    <para>Prepare GCC for compilation:</para>
    8292
    83 <screen><userinput remap="configure">../configure                                       \
     93<screen arch="default"><userinput remap="configure">../configure                                       \
    8494    --target=$LFS_TGT                              \
    8595    --prefix=$LFS/tools                            \
     
    101111    --disable-libstdcxx                            \
    102112    --enable-languages=c,c++</userinput></screen>
     113<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure"
     114    arch="ml_32">mlist=m64,m32</userinput><userinput remap="configure"
     115    arch="ml_x32">mlist=m64,mx32</userinput><userinput remap="configure"
     116    arch="ml_all">mlist=m64,m32,mx32</userinput>
     117<userinput remap="configure">../configure                                       \
     118    --target=$LFS_TGT                              \
     119    --prefix=$LFS/tools                            \
     120    --with-glibc-version=2.11                      \
     121    --with-sysroot=$LFS                            \
     122    --with-newlib                                  \
     123    --without-headers                              \
     124    --enable-initfini-array                        \
     125    --disable-nls                                  \
     126    --disable-shared                               \
     127    --enable-multilib --with-multilib-list=$mlist  \
     128    --disable-decimal-float                        \
     129    --disable-threads                              \
     130    --disable-libatomic                            \
     131    --disable-libgomp                              \
     132    --disable-libquadmath                          \
     133    --disable-libssp                               \
     134    --disable-libvtv                               \
     135    --disable-libstdcxx                            \
     136    --enable-languages=c,c++</userinput></screen>
     137
    103138    <variablelist>
    104139      <title>The meaning of the configure options:</title>
     
    150185      </varlistentry>
    151186
    152       <varlistentry>
     187      <varlistentry arch="default">
    153188        <term><parameter>--disable-multilib</parameter></term>
    154189        <listitem>
    155190          <para>On x86_64, LFS does not support a multilib configuration.
    156191          This switch is harmless for x86.</para>
     192        </listitem>
     193      </varlistentry>
     194      <varlistentry arch="ml_32,ml_x32,ml_all">
     195        <term><parameter>--enable-multilib --with-multilib-list=...</parameter></term>
     196        <listitem>
     197          <para>LFS canbe used to support multilib. Which they are is
     198          specified in the multilib list.</para>
    157199        </listitem>
    158200      </varlistentry>
  • chapter05/glibc.xml

    r24c34df rfeed564  
    4848    operation of the dynamic library loader:</para>
    4949
    50 <screen><userinput remap="pre">case $(uname -m) in
     50<screen arch="default"><userinput remap="pre">case $(uname -m) in
    5151    i?86)   ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
    5252    ;;
     
    5555    ;;
    5656esac</userinput></screen>
     57<!-- no ld-linux.so.2 here as multilib is based on x86_64, not on i686 -->
     58<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
     59ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3</userinput></screen>
    5760
    5861    <note>
     
    8083    <para>Next, prepare Glibc for compilation:</para>
    8184
    82 <screen><userinput remap="configure">../configure                             \
     85<screen arch="default"><userinput remap="configure">../configure                             \
    8386      --prefix=/usr                      \
    8487      --host=$LFS_TGT                    \
     
    8689      --enable-kernel=&min-kernel;                \
    8790      --with-headers=$LFS/usr/include    \
     91      libc_cv_slibdir=/lib</userinput></screen>
     92<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure                             \
     93      --prefix=/usr                      \
     94      --host=$LFS_TGT                    \
     95      --build=$(../scripts/config.guess) \
     96      --enable-kernel=&min-kernel;                \
     97      --with-headers=$LFS/usr/include    \
     98      --enable-multi-arch                \
     99      --libdir=/usr/lib                  \
     100      --libexecdir=/usr/lib              \
    88101      libc_cv_slibdir=/lib</userinput></screen>
    89102<!--
     
    208221<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
    209222
    210       <para>Note that for 32-bit machines, the interpreter name will be
     223      <para arch="default">Note that for 32-bit machines, the interpreter name will be
    211224      <filename>/lib/ld-linux.so.2</filename>.</para>
    212225
     
    236249  </sect2>
    237250
     251  <!-- - - - - - - - - - -->
     252  <!-- Multilib - 32bit  -->
     253  <!-- - - - - - - - - - -->
     254  <sect2 arch="ml_32,ml_all">
     255    <title>Building Glibc - 32bit</title>
     256
     257    <para>Now recompile for m32. The extracted source can be
     258    reused but needs to cleaned before installing the m32
     259    version of Glibc.</para>
     260
     261    <para>Clear the build directory and remove artefacts from
     262    previous build:</para>
     263     
     264<screen><userinput remap="pre">make clean
     265find .. -name "*.a" -delete</userinput></screen>
     266
     267    <para>Configure Glibc for m32 with the following commands:</para>
     268
     269<screen><userinput remap="configure">CC="$LFS_TGT-gcc -m32" \
     270CXX="$LFS_TGT-g++ -m32" \
     271../configure                             \
     272      --prefix=/usr                      \
     273      --host=$LFS_TGT32                  \
     274      --build=$(../scripts/config.guess) \
     275      --enable-kernel=&min-kernel;                \
     276      --with-headers=$LFS/usr/include    \
     277      --enable-multi-arch                \
     278      --libdir=&usr-lib-m32;                \
     279      --libexecdir=&usr-lib-m32;            \
     280      libc_cv_slibdir=&lib-m32;</userinput></screen>
     281
     282    <para>Compile the package:</para>
     283
     284<screen><userinput remap="make">make</userinput></screen>
     285
     286    <para>Install the package:</para>
     287
     288<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     289cp -a DESTDIR&lib-m32;/*     $LFS&lib-m32;/
     290cp -a DESTDIR&usr-lib-m32; $LFS/usr/
     291install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
     292               $LFS/usr/include/gnu/
     293ln -svf ..&lib-m32;/ld-linux.so.2 $LFS/lib/ld-linux.so.2</userinput></screen>
     294
     295    <caution>
     296      <para>At this point, it is imperative to stop and ensure that the basic
     297      functions (compiling and linking) of the new toolchain are working as
     298      expected. To perform a sanity check, run the following commands:</para>
     299
     300<screen><userinput>echo 'int main(){}' &gt; dummy.c
     301$LFS_TGT-gcc -m32 dummy.c
     302readelf -l a.out | grep '/ld-linux'</userinput></screen>
     303
     304      <para>If everything is working correctly, there should be no errors,
     305      and the output of the last command will be of the form:</para>
     306
     307<screen><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen>
     308
     309      <para>If the output is not shown as above or there was no output at all,
     310      then something is wrong. Investigate and retrace the steps to find out
     311      where the problem is and correct it. This issue must be resolved before
     312      continuing on.</para>
     313
     314      <para>Once all is well, clean up the test files:</para>
     315
     316<screen><userinput>rm -v dummy.c a.out</userinput></screen>
     317
     318    </caution>
     319
     320  </sect2><!-- m32 -->
     321
     322  <!-- - - - - - - - - - -->
     323  <!-- Multilib - x32bit -->
     324  <!-- - - - - - - - - - -->
     325 
     326  <sect2 arch="ml_x32,ml_all">
     327    <title>Building Glibc - x32bit</title>
     328
     329    <para>Now recompile for mx32. The extracted source can be
     330    reused but needs to cleaned before installing the mx32
     331    version of Glibc.</para>
     332
     333    <para>Clear the build directory and remove artefacts from
     334    previous build:</para>
     335     
     336<screen><userinput remap="pre">make clean
     337find .. -name "*.a" -delete</userinput></screen>
     338
     339    <para>Configure Glibc for mx32 with the following commands:</para>
     340
     341<screen><userinput remap="configure">CC="$LFS_TGT-gcc -mx32" \
     342CXX="$LFS_TGT-g++ -mx32" \
     343../configure                             \
     344      --prefix=/usr                      \
     345      --host=$LFS_TGTX32                 \
     346      --build=$(../scripts/config.guess) \
     347      --enable-kernel=&min-kernel;                \
     348      --with-headers=$LFS/usr/include    \
     349      --enable-multi-arch                \
     350      --libdir=&usr-lib-mx32;               \
     351      --libexecdir=&usr-lib-mx32;           \
     352      libc_cv_slibdir=&lib-mx32;</userinput></screen>
     353
     354    <para>Compile the package:</para>
     355
     356<screen><userinput remap="make">make</userinput></screen>
     357
     358    <para>Install the package:</para>
     359
     360<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     361cp -a DESTDIR&lib-mx32;/*     $LFS&lib-mx32;/
     362cp -a DESTDIR&usr-lib-mx32; $LFS/usr/
     363install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \
     364               $LFS/usr/include/gnu/
     365ln -svf ..&lib-mx32;/ld-linux-x32.so.2 $LFS/lib/ld-linux-x32.so.2</userinput></screen>
     366
     367    <caution>
     368      <para>At this point, it is imperative to stop and ensure that the basic
     369      functions (compiling and linking) of the new toolchain are working as
     370      expected. To perform a sanity check, run the following commands:</para>
     371
     372<screen><userinput>echo 'int main(){}' &gt; dummy.c
     373$LFS_TGT-gcc -mx32 dummy.c
     374readelf -l a.out | grep '/ld-linux-x32'</userinput></screen>
     375
     376      <para>If everything is working correctly, there should be no errors,
     377      and the output of the last command will be of the form:</para>
     378
     379<screen><computeroutput>[Requesting program interpreter: /libx32/ld-linux-x32.so.2]</computeroutput></screen>
     380
     381      <para>If the output is not shown as above or there was no output at all,
     382      then something is wrong. Investigate and retrace the steps to find out
     383      where the problem is and correct it. This issue must be resolved before
     384      continuing on.</para>
     385
     386      <para>Once all is well, clean up the test files:</para>
     387
     388<screen><userinput>rm -v dummy.c a.out</userinput></screen>
     389
     390    </caution>
     391
     392  </sect2><!-- mx32 -->
     393
    238394  <sect2 role="content">
    239395    <title/>
  • chapter05/libstdc++.xml

    r24c34df rfeed564  
    8282      </varlistentry>
    8383
     84      <varlistentry arch="ml_32,ml_x32,ml_all">
     85        <term><parameter>--disable-multilib</parameter></term>
     86        <listitem>
     87          <para>Even when building the multilib version, this switch is
     88          given. This is because the additionally built libraries are
     89          not required in this stage and some disk space and compile
     90          time can be saved.</para>
     91        </listitem>
     92      </varlistentry>
     93
    8494      <varlistentry>
    8595        <term><parameter>--disable-libstdcxx-pch</parameter></term>
  • chapter06/binutils-pass2.xml

    r24c34df rfeed564  
    5151    <para>Prepare Binutils for compilation:</para>
    5252
    53 <screen><userinput remap="configure">../configure                   \
     53<screen arch="default"><userinput remap="configure">../configure                   \
    5454    --prefix=/usr              \
    5555    --build=$(../config.guess) \
     
    5959    --disable-werror           \
    6060    --enable-64-bit-bfd</userinput></screen>
     61<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure                   \
     62    --prefix=/usr              \
     63    --build=$(../config.guess) \
     64    --host=$LFS_TGT            \
     65    --disable-nls              \
     66    --enable-shared            \
     67    --disable-werror           \
     68    --enable-64-bit-bfd        \
     69    --enable-multilib</userinput></screen>
    6170
    6271    <variablelist>
     
    7786          <para>Enables 64-bit support (on hosts with narrower word sizes).
    7887          May not be needed on 64-bit systems, but does no harm.</para>
     88        </listitem>
     89      </varlistentry>
     90
     91      <varlistentry arch="ml_32,ml_x32,ml_all">
     92        <term><parameter>--enable-multilib</parameter></term>
     93        <listitem>
     94          <para>Enables multilib support in bintutils.</para>
    7995        </listitem>
    8096      </varlistentry>
  • chapter06/gcc-pass2.xml

    r24c34df rfeed564  
    5353mv -v gmp-&gmp-version; gmp
    5454tar -xf ../mpc-&mpc-version;.tar.gz
    55 mv -v mpc-&mpc-version; mpc</userinput></screen>
     55mv -v mpc-&mpc-version; mpc</userinput>
     56<userinput remap="pre" arch="ml_32,ml_x32,ml_all">tar -xf ../isl-&isl-version;.tar.xz
     57mv -v isl-&isl-version; isl</userinput></screen>
    5658
    57     <para>If building on x86_64, change the default directory name for 64-bit
     59
     60    <para arch="default">If building on x86_64, change the default directory name for 64-bit
    5861    libraries to <quote>lib</quote>:</para>
    5962
    60 <screen><userinput remap="pre">case $(uname -m) in
     63<screen arch="default"><userinput remap="pre">case $(uname -m) in
    6164  x86_64)
    6265    sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
    6366  ;;
    6467esac</userinput></screen>
     68
     69    <para arch="ml_32,ml_x32,ml_all">Change the default directory name for
     70    libraries:</para>
     71
     72<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
     73    -e '/m32=/s/m32=.*/m32=..\&lib-m32;$(call if_multiarch,:i386-linux-gnu)/' \
     74    -i.orig gcc/config/i386/t-linux64</userinput></screen>
    6575<!--
    66     <para>Fix an issue with GCC-10.1 when building with a cross
    67     compiler:</para>
    68 
    6976<screen><userinput remap="pre">patch -Np1 -i ../&gcc-cross-patch;</userinput></screen>
    7077-->
     
    8592    <para>Now prepare GCC for compilation:</para>
    8693
    87 <screen><userinput remap="configure">../configure                                       \
     94<screen arch="default"><userinput remap="configure">../configure                                       \
    8895    --build=$(../config.guess)                     \
    8996    --host=$LFS_TGT                                \
     
    94101    --disable-nls                                  \
    95102    --disable-multilib                             \
     103    --disable-decimal-float                        \
     104    --disable-libatomic                            \
     105    --disable-libgomp                              \
     106    --disable-libquadmath                          \
     107    --disable-libssp                               \
     108    --disable-libvtv                               \
     109    --disable-libstdcxx                            \
     110    --enable-languages=c,c++</userinput></screen>
     111<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure"
     112    arch="ml_32">mlist=m64,m32</userinput><userinput remap="configure"
     113    arch="ml_x32">mlist=m64,mx32</userinput><userinput remap="configure"
     114    arch="ml_all">mlist=m64,m32,mx32</userinput>
     115<userinput remap="configure">../configure                                       \
     116    --build=$(../config.guess)                     \
     117    --host=$LFS_TGT                                \
     118    --prefix=/usr                                  \
     119    CC_FOR_TARGET=$LFS_TGT-gcc                     \
     120    --with-build-sysroot=$LFS                      \
     121    --enable-initfini-array                        \
     122    --disable-nls                                  \
     123    --enable-multilib --with-multilib-list=$mlist  \
    96124    --disable-decimal-float                        \
    97125    --disable-libatomic                            \
  • chapter06/ncurses.xml

    r24c34df rfeed564  
    160160<screen><userinput remap="install">ln -sfv ../../lib/$(readlink $LFS/usr/lib/libncursesw.so) $LFS/usr/lib/libncursesw.so</userinput></screen>
    161161
    162 
    163162  </sect2>
     163
     164  <!-- - - - - - - - - - -->
     165  <!-- Multilib - 32bit  -->
     166  <!-- - - - - - - - - - -->
     167  <sect2 arch="ml_32,ml_all">
     168    <title>Building Ncurses - 32bit</title>
     169
     170    <para>Clean previous build:</para>
     171
     172<screen><userinput remap="pre">make distclean</userinput></screen>
     173
     174    <para>Prepare Ncurses for compilation:</para>
     175
     176<screen><userinput remap="configure">CC="$LFS_TGT-gcc -m32"              \
     177CXX="$LFS_TGT-g++ -m32"             \
     178./configure --prefix=/usr           \
     179            --host=$LFS_TGT32       \
     180            --build=$(./config.guess)    \
     181            --libdir=&usr-lib-m32;     \
     182            --mandir=/usr/share/man \
     183            --with-shared           \
     184            --without-debug         \
     185            --without-ada           \
     186            --without-normal        \
     187            --enable-pc-files       \
     188            --enable-widec          \
     189            --with-pkg-config-libdir=&usr-lib-m32;/pkgconfig</userinput></screen>
     190
     191    <para>Compile the package:</para>
     192
     193<screen><userinput remap="make">make</userinput></screen>
     194
     195    <para>Install the package:</para>
     196
     197<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR TIC_PATH=$(pwd)/build/progs/tic install
     198ln -s libncursesw.so DESTDIR&usr-lib-m32;/libcursesw.so
     199cp -Rv DESTDIR&usr-lib-m32;/* $LFS&usr-lib-m32;
     200rm -rf DESTDIR</userinput></screen>
     201
     202  </sect2><!-- m32 -->
     203
     204  <!-- - - - - - - - - - -->
     205  <!-- Multilib - x32bit -->
     206  <!-- - - - - - - - - - -->
     207  <sect2 arch="ml_x32,ml_all">
     208    <title>Building Ncurses - x32bit</title>
     209
     210    <para>Clean previous build:</para>
     211
     212<screen><userinput remap="pre">make distclean</userinput></screen>
     213
     214    <para>Prepare Ncurses for compilation:</para>
     215
     216<screen><userinput remap="configure">CC="$LFS_TGT-gcc -mx32"             \
     217CXX="$LFS_TGT-g++ -mx32"            \
     218./configure --prefix=/usr           \
     219            --host=$LFS_TGTX32      \
     220            --build=$(./config.guess)    \
     221            --libdir=&usr-lib-mx32;    \
     222            --mandir=/usr/share/man \
     223            --with-shared           \
     224            --without-debug         \
     225            --without-ada           \
     226            --without-normal        \
     227            --enable-pc-files       \
     228            --enable-widec          \
     229            --with-pkg-config-libdir=&usr-lib-mx32;/pkgconfig</userinput></screen>
     230
     231    <para>Compile the package:</para>
     232
     233<screen><userinput remap="make">make</userinput></screen>
     234
     235    <para>Install the package:</para>
     236
     237<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR TIC_PATH=$(pwd)/build/progs/tic install
     238ln -s libncursesw.so DESTDIR&usr-lib-mx32;/libcursesw.so
     239cp -Rv DESTDIR&usr-lib-mx32;/* $LFS&usr-lib-mx32;
     240rm -rf DESTDIR</userinput></screen>
     241
     242  </sect2><!-- mx32 -->
    164243
    165244  <sect2 role="content">
  • chapter07/changingowner.xml

    r24c34df rfeed564  
    3939esac</userinput></screen>
    4040
     41  <para arch="ml_32,ml_x32,ml_all">Some more directories exists for
     42  multilib support. Change their ownership, too:</para>
     43<screen arch="ml_32,ml_x32,ml_all"><userinput arch="ml_32,ml_all">chown -R root:root $LFS&lib-m32;</userinput>
     44<userinput arch="ml_x32,ml_all">chown -R root:root $LFS&lib-mx32;</userinput></screen>
     45 
    4146</sect1>
  • chapter07/creatingdirs.xml

    r24c34df rfeed564  
    4141install -dv -m 1777 /tmp /var/tmp</userinput></screen>
    4242
     43  <para arch="ml_32,ml_x32,ml_all">Required directories for multilib
     44  support has already been created while previous installation steps.</para>
     45
    4346  <para>Directories are, by default, created with permission mode 755, but
    4447  this is not desirable for all directories. In the commands above, two
  • chapter07/libstdc++-pass2.xml

    r24c34df rfeed564  
    6363    <para>Prepare libstdc++ for compilation:</para>
    6464
    65 <screen><userinput remap="configure">../libstdc++-v3/configure            \
     65<screen arch="default"><userinput remap="configure">../libstdc++-v3/configure            \
    6666    CXXFLAGS="-g -O2 -D_GNU_SOURCE"  \
    6767    --prefix=/usr                    \
    6868    --disable-multilib               \
     69    --disable-nls                    \
     70    --host=$(uname -m)-lfs-linux-gnu \
     71    --disable-libstdcxx-pch</userinput></screen>
     72<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../libstdc++-v3/configure            \
     73    CXXFLAGS="-g -O2 -D_GNU_SOURCE"  \
     74    --prefix=/usr                    \
     75    --enable-multilib                \
    6976    --disable-nls                    \
    7077    --host=$(uname -m)-lfs-linux-gnu \
     
    99106      </varlistentry>
    100107
     108      <varlistentry arch="ml_32,ml_x32,ml_all">
     109        <term><parameter>--enable-multilib</parameter></term>
     110        <listitem>
     111          <para>This switch is set by default but it is added here
     112          explicitly for documentary purpose. The libstdc++ libraries
     113          will be built for every arch (m64, m32, mx32) which are
     114          made available in <xref linkend="ch-tools-gcc-pass1"/>.</para>
     115        </listitem>
     116      </varlistentry>
     117
    101118    </variablelist>
    102119
  • chapter07/stripping.xml

    r24c34df rfeed564  
    1616  While still in chroot, remove those files now:</para>
    1717
    18 <screen><userinput>find /usr/{lib,libexec} -name \*.la -delete</userinput></screen>
     18<screen arch="default"><userinput>find /usr/{lib,libexec} -name \*.la -delete</userinput></screen>
     19<screen arch="ml_32"><userinput>find /usr/{lib{,32},libexec} -name \*.la -delete</userinput></screen>
     20<screen arch="ml_x32"><userinput>find /usr/{lib{,x32},libexec} -name \*.la -delete</userinput></screen>
     21<screen arch="ml_all"><userinput>find /usr/{lib{,{,x}32},libexec} -name \*.la -delete</userinput></screen>
    1922
    2023    <para>Remove the documentation of the temporary tools, to prevent them
     
    8891
    8992    <para>Strip off debugging symbols from binaries:</para>
    90 <screen role="nodump"><userinput>strip --strip-debug $LFS/usr/lib/*
     93<screen arch="default" role="nodump"><userinput>strip --strip-debug $LFS/usr/lib/*
     94strip --strip-unneeded $LFS/usr/{,s}bin/*
     95strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
     96<screen arch="ml_32" role="nodump"><userinput>strip --strip-debug $LFS/usr/lib{,32}/*
     97strip --strip-unneeded $LFS/usr/{,s}bin/*
     98strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
     99<screen arch="ml_x32" role="nodump"><userinput>strip --strip-debug $LFS/usr/lib{,x32}/*
     100strip --strip-unneeded $LFS/usr/{,s}bin/*
     101strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
     102<screen arch="ml_all" role="nodump"><userinput>strip --strip-debug $LFS/usr/lib{,{,x}32}/*
    91103strip --strip-unneeded $LFS/usr/{,s}bin/*
    92104strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
  • chapter07/util-linux.xml

    r24c34df rfeed564  
    116116  </sect2>
    117117
     118  <!-- - - - - - - - - - -->
     119  <!-- Multilib - 32bit  -->
     120  <!-- - - - - - - - - - -->
     121 
     122  <sect2 arch="ml_32,ml_all" role="installation">
     123    <title>Installation of Util-linux - 32-bit</title>
     124
     125    <para>Clean previous build:</para>
     126
     127<screen><userinput remap="pre">make distclean</userinput></screen>
     128
     129    <para>Prepare Util-linux for compilation:</para>
     130
     131<screen><userinput remap="configure">CC="gcc -m32" \
     132./configure ADJTIME_PATH=/var/lib/hwclock/adjtime    \
     133            --docdir=/usr/share/doc/util-linux-&util-linux-version; \
     134            --disable-chfn-chsh  \
     135            --disable-login      \
     136            --disable-nologin    \
     137            --disable-su         \
     138            --disable-setpriv    \
     139            --disable-runuser    \
     140            --disable-pylibmount \
     141            --disable-static     \
     142            --without-python     \
     143            --libdir=&usr-lib-m32;      \
     144            --host=i686-pc-linux-gnu</userinput></screen>
     145
     146    <para>Compile the package:</para>
     147
     148<screen><userinput remap="make">make</userinput></screen>
     149
     150    <para>Install the package:</para>
     151
     152<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     153cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     154rm -rf DESTDIR</userinput></screen>
     155
     156  </sect2><!-- m32 -->
     157
     158  <!-- - - - - - - - - - -->
     159  <!-- Multilib - x32bit -->
     160  <!-- - - - - - - - - - -->
     161 
     162  <sect2 arch="ml_x32,ml_all" role="installation">
     163    <title>Installation of Util-linux - x32-bit</title>
     164
     165    <para>Clean previous build:</para>
     166
     167<screen><userinput remap="pre">make distclean</userinput></screen>
     168
     169    <para>Prepare Util-linux for compilation:</para>
     170
     171<screen><userinput remap="configure">CC="gcc -mx32" \
     172./configure ADJTIME_PATH=/var/lib/hwclock/adjtime    \
     173            --docdir=/usr/share/doc/util-linux-&util-linux-version; \
     174            --disable-chfn-chsh  \
     175            --disable-login      \
     176            --disable-nologin    \
     177            --disable-su         \
     178            --disable-setpriv    \
     179            --disable-runuser    \
     180            --disable-pylibmount \
     181            --disable-static     \
     182            --without-python     \
     183            --libdir=&usr-lib-mx32; \
     184            --host=x86_64-pc-linux-gnux32</userinput></screen>
     185
     186    <para>Compile the package:</para>
     187
     188<screen><userinput remap="make">make</userinput></screen>
     189
     190    <para>Install the package:</para>
     191
     192<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     193cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     194rm -rf DESTDIR</userinput></screen>
     195
     196  </sect2><!-- mx32 -->
     197
    118198  <sect2 role="content">
    119199    <title/>
  • chapter08/acl.xml

    r24c34df rfeed564  
    8080  </sect2>
    8181
     82  <!-- - - - - - - - - - -->
     83  <!-- Multilib - 32bit  -->
     84  <!-- - - - - - - - - - -->
     85 
     86  <sect2 arch="ml_32,ml_all" role="installation">
     87    <title>Installation of Acl - 32bit</title>
     88
     89    <para>Clean previous build:</para>
     90
     91<screen><userinput remap="pre">make distclean</userinput></screen>
     92
     93    <para>Prepare Xz for compilation:</para>
     94
     95<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     96    --prefix=/usr         \
     97    --disable-static      \
     98    --libdir=&usr-lib-m32;   \
     99    --libexecdir=&usr-lib-m32;   \
     100    --host=i686-pc-linux-gnu</userinput></screen>
     101
     102    <para>Compile the package:</para>
     103
     104<screen><userinput remap="make">make</userinput></screen>
     105
     106    <para>Install the package:</para>
     107
     108<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     109cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     110rm -rf DESTDIR</userinput></screen>
     111
     112  </sect2><!-- m32 -->
     113
     114  <!-- - - - - - - - - - -->
     115  <!-- Multilib - x32bit -->
     116  <!-- - - - - - - - - - -->
     117 
     118  <sect2 arch="ml_x32,ml_all" role="installation">
     119    <title>Installation of Acl - x32bit</title>
     120
     121    <para>Clean previous build:</para>
     122
     123<screen><userinput remap="pre">make distclean</userinput></screen>
     124
     125    <para>Prepare Xz for compilation:</para>
     126
     127<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     128    --prefix=/usr          \
     129    --disable-static       \
     130    --libdir=&usr-lib-mx32;   \
     131    --libexecdir=&usr-lib-mx32;   \
     132    --host=x86_64-pc-linux-gnux32</userinput></screen>
     133
     134    <para>Compile the package:</para>
     135
     136<screen><userinput remap="make">make</userinput></screen>
     137
     138    <para>Install the package:</para>
     139
     140<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     141cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     142rm -rf DESTDIR</userinput></screen>
     143
     144  </sect2><!-- mx32 -->
     145
    82146  <sect2 id="contents-acl" role="content">
    83147    <title>Contents of Acl</title>
  • chapter08/attr.xml

    r24c34df rfeed564  
    7979  </sect2>
    8080
     81  <!-- - - - - - - - - - -->
     82  <!-- Multilib - 32bit  -->
     83  <!-- - - - - - - - - - -->
     84 
     85  <sect2 arch="ml_32,ml_all" role="installation">
     86    <title>Installation of Attr - 32bit</title>
     87
     88    <para>Clean previous build:</para>
     89
     90<screen><userinput remap="pre">make distclean</userinput></screen>
     91
     92    <para>Prepare Attr for compilation:</para>
     93
     94<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     95    --prefix=/usr         \
     96    --disable-static      \
     97    --libdir=&usr-lib-m32; \
     98    --host=i686-pc-linux-gnu</userinput></screen>
     99
     100    <para>Compile the package:</para>
     101
     102<screen><userinput remap="make">make</userinput></screen>
     103
     104    <para>Install the package:</para>
     105
     106<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     107cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     108rm -rf DESTDIR</userinput></screen>
     109
     110  </sect2><!-- m32 -->
     111
     112  <!-- - - - - - - - - - -->
     113  <!-- Multilib - x32bit -->
     114  <!-- - - - - - - - - - -->
     115 
     116  <sect2 arch="ml_x32,ml_all" role="installation">
     117    <title>Installation of Attr - x32bit</title>
     118
     119    <para>Clean previous build:</para>
     120
     121<screen><userinput remap="pre">make distclean</userinput></screen>
     122
     123    <para>Prepare Attr for compilation:</para>
     124
     125<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     126    --prefix=/usr          \
     127    --disable-static       \
     128    --libdir=&usr-lib-mx32;   \
     129    --host=x86_64-pc-linux-gnux32</userinput></screen>
     130
     131    <para>Compile the package:</para>
     132
     133<screen><userinput remap="make">make</userinput></screen>
     134
     135    <para>Install the package:</para>
     136
     137<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     138cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     139rm -rf DESTDIR</userinput></screen>
     140
     141  </sect2><!-- mx32 -->
     142
    81143  <sect2 id="contents-attr" role="content">
    82144    <title>Contents of Attr</title>
  • chapter08/binutils.xml

    r24c34df rfeed564  
    7171    <para>Prepare Binutils for compilation:</para>
    7272
    73 <screen><userinput remap="configure">../configure --prefix=/usr       \
     73<screen arch="default"><userinput remap="configure">../configure --prefix=/usr       \
    7474             --enable-gold       \
    7575             --enable-ld=default \
     
    7979             --enable-64-bit-bfd \
    8080             --with-system-zlib</userinput></screen>
     81<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=/usr       \
     82             --enable-gold       \
     83             --enable-ld=default \
     84             --enable-plugins    \
     85             --enable-shared     \
     86             --disable-werror    \
     87             --enable-64-bit-bfd \
     88             --with-system-zlib  \
     89             --enable-multilib</userinput></screen>
     90
    8191    <variablelist>
    8292      <title>The meaning of the configure parameters:</title>
     
    110120           <para>Enables 64-bit support (on hosts with narrower word sizes).
    111121           May not be needed on 64-bit systems, but does no harm.</para>
     122        </listitem>
     123      </varlistentry>
     124
     125      <varlistentry arch="ml_32,ml_x32,ml_all">
     126        <term><parameter>--enable-multilib</parameter></term>
     127        <listitem>
     128          <para>Enables multilib support in bintutils.</para>
    112129        </listitem>
    113130      </varlistentry>
  • chapter08/bzip2.xml

    r24c34df rfeed564  
    101101
    102102  </sect2>
     103
     104  <!-- - - - - - - - - - -->
     105  <!-- Multilib - 32bit  -->
     106  <!-- - - - - - - - - - -->
     107 
     108  <sect2 arch="ml_32,ml_all" role="installation">
     109    <title>Installation of Bzip2 - 32bit</title>
     110
     111    <para>Clean previous build:</para>
     112
     113<screen><userinput remap="pre">make clean</userinput></screen>
     114
     115    <para>Compile the package:</para>
     116
     117<screen><userinput remap="make">sed -e "s/^CC=.*/CC=gcc -m32/" -i Makefile{,-libbz2_so}
     118make -f Makefile-libbz2_so
     119make libbz2.a</userinput></screen>
     120
     121    <para>Install the package:</para>
     122
     123<screen><userinput remap="install">install -Dm755 libbz2.so.1.0.8 &usr-lib-m32;/libbz2.so.1.0.8
     124ln -sf libbz2.so.1.0.8 &usr-lib-m32;/libbz2.so
     125ln -sf libbz2.so.1.0.8 &usr-lib-m32;/libbz2.so.1
     126ln -sf libbz2.so.1.0.8 &usr-lib-m32;/libbz2.so.1.0
     127install -Dm644 libbz2.a &usr-lib-m32;/libbz2.a</userinput></screen>
     128
     129  </sect2><!-- m32 -->
     130
     131  <!-- - - - - - - - - - -->
     132  <!-- Multilib - x32bit -->
     133  <!-- - - - - - - - - - -->
     134 
     135  <sect2 arch="ml_x32,ml_all" role="installation">
     136    <title>Installation of Bzip2 - x32bit</title>
     137
     138    <para>Clean previous build:</para>
     139
     140<screen><userinput remap="pre">make clean</userinput></screen>
     141
     142    <para>Compile the package:</para>
     143
     144<screen><userinput remap="make">sed -e "s/^CC=.*/CC=gcc -mx32/" -i Makefile{,-libbz2_so}
     145make -f Makefile-libbz2_so
     146make libbz2.a</userinput></screen>
     147
     148    <para>Install the package:</para>
     149
     150<screen><userinput remap="install">install -Dm755 libbz2.so.1.0.8 &usr-lib-mx32;/libbz2.so.1.0.8
     151ln -sf libbz2.so.1.0.8 &usr-lib-mx32;/libbz2.so
     152ln -sf libbz2.so.1.0.8 &usr-lib-mx32;/libbz2.so.1
     153ln -sf libbz2.so.1.0.8 &usr-lib-mx32;/libbz2.so.1.0
     154install -Dm644 libbz2.a &usr-lib-mx32;/libbz2.a</userinput></screen>
     155
     156  </sect2><!-- mx32 -->
    103157
    104158  <sect2 id="contents-bzip2" role="content">
  • chapter08/chapter08.xml

    r24c34df rfeed564  
    3535  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpfr.xml"/>
    3636  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpc.xml"/>
     37  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="isl.xml"/>
    3738  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="attr.xml"/>
    3839  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="acl.xml"/>
  • chapter08/eudev.xml

    r24c34df rfeed564  
    9090  </sect2>
    9191
     92  <!-- - - - - - - - - - -->
     93  <!-- Multilib - 32bit  -->
     94  <!-- - - - - - - - - - -->
     95 
     96  <sect2 arch="ml_32,ml_all" role="installation">
     97    <title>Installation of Eudev - 32bit</title>
     98
     99    <para>Clean previous build:</para>
     100
     101<screen><userinput remap="pre">make distclean</userinput></screen>
     102
     103    <para>Prepare Eudev for compilation:</para>
     104
     105<screen><userinput remap="configure">CC="gcc -m32" \
     106./configure --host=i686-pc-linux-gnu     \
     107            --prefix=/usr                \
     108            --bindir=/sbin               \
     109            --sbindir=/sbin              \
     110            --libdir=&usr-lib-m32;          \
     111            --sysconfdir=/etc            \
     112            --libexecdir=&lib-m32;          \
     113            --with-rootprefix=           \
     114            --with-rootlibdir=&usr-lib-m32; \
     115            --disable-manpages           \
     116            --disable-static             \
     117            --config-cache</userinput></screen>
     118
     119    <para>Compile the package:</para>
     120
     121<screen><userinput remap="make">make</userinput></screen>
     122
     123    <para>Install the package:</para>
     124
     125<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     126cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     127rm -rf DESTDIR</userinput></screen>
     128
     129  </sect2><!-- m32 -->
     130
     131  <!-- - - - - - - - - - -->
     132  <!-- Multilib - x32bit -->
     133  <!-- - - - - - - - - - -->
     134 
     135  <sect2 arch="ml_x32,ml_all" role="installation">
     136    <title>Installation of Eudev - x32bit</title>
     137
     138    <para>Clean previous build:</para>
     139
     140<screen><userinput remap="pre">make distclean</userinput></screen>
     141
     142    <para>Prepare Eudev for compilation:</para>
     143
     144<screen><userinput remap="configure">CC="gcc -mx32" \
     145./configure --prefix=/usr                \
     146            --bindir=/sbin               \
     147            --sbindir=/sbin              \
     148            --libdir=&usr-lib-mx32;          \
     149            --sysconfdir=/etc            \
     150            --libexecdir=&lib-mx32;         \
     151            --with-rootprefix=           \
     152            --with-rootlibdir=&usr-lib-mx32; \
     153            --disable-manpages           \
     154            --disable-static             \
     155            --config-cache</userinput></screen>
     156
     157    <para>Compile the package:</para>
     158
     159<screen><userinput remap="make">make</userinput></screen>
     160
     161    <para>Install the package:</para>
     162
     163<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     164cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     165rm -rf DESTDIR</userinput></screen>
     166
     167  </sect2><!-- mx32 -->
     168
    92169  <sect2 id="conf-eudev" role="configuration">
    93170    <title>Configuring Eudev</title>
  • chapter08/expat.xml

    r24c34df rfeed564  
    6666  </sect2>
    6767
     68  <!-- - - - - - - - - - -->
     69  <!-- Multilib - 32bit  -->
     70  <!-- - - - - - - - - - -->
     71 
     72  <sect2 arch="ml_32,ml_all" role="installation">
     73    <title>Installation of Expat - 32bit</title>
     74
     75    <para>Clean previous build but keep precompiled doc because it
     76    cannot be rebuilt in this stage of the system:</para>
     77
     78<screen><userinput remap="pre">sed -e "/^am__append_1/ s/doc//" -i Makefile
     79make clean</userinput></screen>
     80
     81    <para>Prepare Expat for compilation:</para>
     82
     83<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     84    --prefix=/usr         \
     85    --libdir=&usr-lib-m32;  \
     86    --host=i686-pc-linux-gnu</userinput></screen>
     87
     88    <para>Compile the package:</para>
     89
     90<screen><userinput remap="make">make</userinput></screen>
     91
     92    <para>Install the package:</para>
     93
     94<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     95cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     96rm -rf DESTDIR</userinput></screen>
     97
     98  </sect2><!-- m32 -->
     99
     100  <!-- - - - - - - - - - -->
     101  <!-- Multilib - x32bit -->
     102  <!-- - - - - - - - - - -->
     103 
     104  <sect2 arch="ml_x32,ml_all" role="installation">
     105    <title>Installation of Expat - x32bit</title>
     106
     107    <para>Clean previous build but keep precompiled doc because it
     108    cannot be rebuilt in this stage of the system:</para>
     109
     110<screen><userinput remap="pre">sed -e "/^am__append_1/ s/doc//" -i Makefile
     111make clean</userinput></screen>
     112
     113    <para>Prepare Expat for compilation:</para>
     114
     115<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     116    --prefix=/usr         \
     117    --libdir=&usr-lib-mx32; \
     118    --host=x86_64-pc-linux-gnux32</userinput></screen>
     119
     120    <para>Compile the package:</para>
     121
     122<screen><userinput remap="make">make</userinput></screen>
     123
     124    <para>Install the package:</para>
     125
     126<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     127cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     128rm -rf DESTDIR</userinput></screen>
     129
     130  </sect2><!-- mx32 -->
     131
    68132  <sect2 id="contents-expat" role="content">
    69133    <title>Contents of Expat</title>
  • chapter08/file.xml

    r24c34df rfeed564  
    7070  </sect2>
    7171
     72  <!-- - - - - - - - - - -->
     73  <!-- Multilib - 32bit  -->
     74  <!-- - - - - - - - - - -->
     75 
     76  <sect2 arch="ml_32,ml_all" role="installation">
     77    <title>Installation of File - 32bit</title>
     78
     79    <para>Clean previous build:</para>
     80
     81<screen><userinput remap="pre">make distclean</userinput></screen>
     82
     83    <para>Prepare File for compilation:</para>
     84
     85<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     86    --prefix=/usr         \
     87    --libdir=&usr-lib-m32;   \
     88    --host=i686-pc-linux-gnu</userinput></screen>
     89
     90    <para>Compile the package:</para>
     91
     92<screen><userinput remap="make">make</userinput></screen>
     93
     94    <para>Install the package:</para>
     95
     96<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     97cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     98rm -rf DESTDIR</userinput></screen>
     99
     100  </sect2><!-- m32 -->
     101
     102  <!-- - - - - - - - - - -->
     103  <!-- Multilib - x32bit -->
     104  <!-- - - - - - - - - - -->
     105 
     106  <sect2 arch="ml_x32,ml_all" role="installation">
     107    <title>Installation of File - x32bit</title>
     108
     109    <para>Clean previous build:</para>
     110
     111<screen><userinput remap="pre">make distclean</userinput></screen>
     112
     113    <para>Prepare File for compilation:</para>
     114
     115<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     116    --prefix=/usr          \
     117    --libdir=&usr-lib-mx32;   \
     118    --host=x86_64-pc-linux-gnux32</userinput></screen>
     119
     120    <para>Compile the package:</para>
     121
     122<screen><userinput remap="make">make</userinput></screen>
     123
     124    <para>Install the package:</para>
     125
     126<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     127cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     128rm -rf DESTDIR</userinput></screen>
     129
     130  </sect2><!-- mx32 -->
    72131
    73132  <sect2 id="contents-file" role="content">
  • chapter08/gcc.xml

    r24c34df rfeed564  
    4242    <title>Installation of GCC</title>
    4343
    44     <para>If building on x86_64, change the default directory name for 64-bit
     44    <para arch="default">If building on x86_64, change the default directory name for 64-bit
    4545    libraries to <quote>lib</quote>:</para>
    4646
    47 <screen><userinput remap="pre">case $(uname -m) in
     47<screen arch="default"><userinput remap="pre">case $(uname -m) in
    4848  x86_64)
    4949    sed -e '/m64=/s/lib64/lib/' \
     
    5252esac</userinput></screen>
    5353
     54    <para arch="ml_32,ml_x32,ml_all">Change the default directory name for 64-bit
     55    libraries to <quote>lib</quote>:</para>
     56
     57<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
     58    -e '/m32=/s/m32=.*/m32=..\&lib-m32;$(call if_multiarch,:i386-linux-gnu)/' \
     59    -i.orig gcc/config/i386/t-linux64</userinput></screen>
     60
    5461    <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
    5562
     
    5966    <para>Prepare GCC for compilation:</para>
    6067
    61 <screen><userinput remap="configure">../configure --prefix=/usr            \
     68<screen arch="default"><userinput remap="configure">../configure --prefix=/usr            \
    6269             LD=ld                    \
    6370             --enable-languages=c,c++ \
    6471             --disable-multilib       \
    6572             --disable-bootstrap      \
     73             --with-system-zlib</userinput></screen>
     74<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure"
     75  arch="ml_32" >mlist=m64,m32</userinput><userinput remap="configure"
     76  arch="ml_x32">mlist=m64,mx32</userinput><userinput remap="configure"
     77  arch="ml_all">mlist=m64,m32,mx32</userinput>
     78<userinput remap="configure">../configure --prefix=/usr               \
     79             LD=ld                       \
     80             --enable-languages=c,c++    \
     81             --enable-multilib           \
     82             --with-multilib-list=$mlist \
     83             --disable-bootstrap         \
    6684             --with-system-zlib</userinput></screen>
    6785
     
    257275SEARCH_DIR("/usr/lib");</computeroutput></screen>
    258276
    259    <para>A 32-bit system may see a few different directories. For example, here
     277   <para arch="default">A 32-bit system may see a few different directories. For example, here
    260278   is the output from an i686 machine:</para>
    261279
    262 <screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32")
     280<!-- not using entities here as the dir names has nothing to do with multilib -->
     281<screen arch="default"><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32")
    263282SEARCH_DIR("/usr/local/lib32")
    264283SEARCH_DIR("/lib32")
  • chapter08/glibc.xml

    r24c34df rfeed564  
    6464    <para>Prepare Glibc for compilation:</para>
    6565
    66 <screen><userinput remap="configure">../configure --prefix=/usr                            \
     66<screen arch="default"><userinput remap="configure">../configure --prefix=/usr                            \
    6767             --disable-werror                         \
    6868             --enable-kernel=&min-kernel;                      \
    6969             --enable-stack-protector=strong          \
    7070             --with-headers=/usr/include              \
     71             libc_cv_slibdir=/lib</userinput></screen>
     72<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=/usr                            \
     73             --disable-werror                         \
     74             --enable-kernel=&min-kernel;                      \
     75             --enable-stack-protector=strong          \
     76             --with-headers=/usr/include              \
     77             --enable-multi-arch                      \
    7178             libc_cv_slibdir=/lib</userinput></screen>
    7279
     
    461468  </sect2>
    462469
     470  <!-- - - - - - - - - - -->
     471  <!-- Multilib - 32bit  -->
     472  <!-- - - - - - - - - - -->
     473  <sect2 arch="ml_32,ml_all">
     474    <title>Building Glibc - 32bit</title>
     475
     476    <para>Now recompile for m32. The extracted source can be
     477    reused but needs to cleaned before installing the m32
     478    version of Glibc.</para>
     479
     480    <para>Clear the build directory and remove artefacts from
     481    previous build:</para>
     482     
     483<screen><userinput remap="pre">rm -rf ./*
     484find .. -name "*.a" -delete</userinput></screen>
     485
     486    <para>Configure Glibc for m32 with the following commands:</para>
     487
     488<screen><userinput remap="configure">CC="gcc -m32" CXX="g++ -m32" \
     489../configure                             \
     490      --prefix=/usr                      \
     491      --host=i686-pc-linux-gnu           \
     492      --build=$(../scripts/config.guess) \
     493      --enable-kernel=&min-kernel;                \
     494      --with-headers=/usr/include        \
     495      --enable-multi-arch                \
     496      --libdir=&usr-lib-m32;                \
     497      --libexecdir=&usr-lib-m32;            \
     498      libc_cv_slibdir=&lib-m32;</userinput></screen>
     499
     500    <para>Compile the package:</para>
     501
     502<screen><userinput remap="make">make</userinput></screen>
     503
     504    <para>Install the package:</para>
     505
     506<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     507cp -a DESTDIR&lib-m32;/*     &lib-m32;/
     508cp -a DESTDIR&usr-lib-m32;/* &usr-lib-m32;/
     509install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
     510               /usr/include/gnu/
     511ln -svf ..&lib-m32;/ld-linux.so.2 /lib/ld-linux.so.2</userinput></screen>
     512
     513    <para>Add the library name to the dynamic loader config:</para>
     514
     515<screen role="install"><userinput>echo "&usr-lib-m32;" &gt;&gt; /etc/ld.so.conf</userinput></screen>
     516
     517    <caution>
     518      <para>At this point, it is imperative to stop and ensure that the basic
     519      functions (compiling and linking) of the new toolchain are working as
     520      expected. To perform a sanity check, run the following commands:</para>
     521
     522<screen><userinput>echo 'int main(){}' &gt; dummy.c
     523gcc -m32 dummy.c
     524readelf -l a.out | grep '/ld-linux'</userinput></screen>
     525
     526      <para>If everything is working correctly, there should be no errors,
     527      and the output of the last command will be of the form:</para>
     528
     529<screen><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen>
     530
     531      <para>If the output is not shown as above or there was no output at all,
     532      then something is wrong. Investigate and retrace the steps to find out
     533      where the problem is and correct it. This issue must be resolved before
     534      continuing on.</para>
     535
     536      <para>Once all is well, clean up the test files:</para>
     537
     538<screen><userinput>rm -v dummy.c a.out</userinput></screen>
     539
     540    </caution>
     541
     542  </sect2><!-- m32 -->
     543
     544  <!-- - - - - - - - - - -->
     545  <!-- Multilib - x32bit -->
     546  <!-- - - - - - - - - - -->
     547 
     548  <sect2 arch="ml_x32,ml_all">
     549    <title>Building Glibc - x32bit</title>
     550
     551    <para>Now recompile for mx32. The extracted source can be
     552    reused but needs to cleaned before installing the mx32
     553    version of Glibc.</para>
     554
     555    <para>Clear the build directory and remove artefacts from
     556    previous build:</para>
     557     
     558<screen><userinput remap="pre">rm -rf ./*
     559find .. -name "*.a" -delete</userinput></screen>
     560
     561    <para>Configure Glibc for mx32 with the following commands:</para>
     562
     563<screen><userinput remap="configure">CC="gcc -mx32" CXX="g++ -mx32" \
     564../configure                             \
     565      --prefix=/usr                      \
     566      --host=x86_64-pc-linux-gnux32      \
     567      --build=$(../scripts/config.guess) \
     568      --enable-kernel=&min-kernel;                \
     569      --with-headers=$LFS/usr/include    \
     570      --enable-multi-arch                \
     571      --libdir=&usr-lib-mx32;               \
     572      --libexecdir=&usr-lib-mx32;           \
     573      libc_cv_slibdir=&lib-mx32;</userinput></screen>
     574
     575    <para>Compile the package:</para>
     576
     577<screen><userinput remap="make">make</userinput></screen>
     578
     579    <para>Install the package:</para>
     580
     581<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     582cp -a DESTDIR&lib-mx32;/*     &lib-mx32;/
     583cp -a DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;/
     584install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \
     585               /usr/include/gnu/
     586ln -svf ..&lib-mx32;/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2</userinput></screen>
     587
     588    <para>Add the library name to the dynamic loader config:</para>
     589
     590<screen role="install"><userinput>echo "&usr-lib-mx32;" &gt;&gt; /etc/ld.so.conf</userinput></screen>
     591
     592    <caution>
     593      <para>At this point, it is imperative to stop and ensure that the basic
     594      functions (compiling and linking) of the new toolchain are working as
     595      expected. To perform a sanity check, run the following commands:</para>
     596
     597<screen><userinput>echo 'int main(){}' &gt; dummy.c
     598gcc -mx32 dummy.c
     599readelf -l a.out | grep '/ld-linux-x32'</userinput></screen>
     600
     601      <para>If everything is working correctly, there should be no errors,
     602      and the output of the last command will be of the form:</para>
     603
     604<screen><computeroutput>[Requesting program interpreter: /libx32/ld-linux-x32.so.2]</computeroutput></screen>
     605
     606      <para>If the output is not shown as above or there was no output at all,
     607      then something is wrong. Investigate and retrace the steps to find out
     608      where the problem is and correct it. This issue must be resolved before
     609      continuing on.</para>
     610
     611      <para>Once all is well, clean up the test files:</para>
     612
     613<screen><userinput>rm -v dummy.c a.out</userinput></screen>
     614
     615    </caution>
     616
     617  </sect2><!-- mx32 -->
     618
    463619  <sect2 id="contents-glibc" role="content">
    464620    <title>Contents of Glibc</title>
  • chapter08/gmp.xml

    r24c34df rfeed564  
    121121  </sect2>
    122122
     123  <!-- - - - - - - - - - -->
     124  <!-- Multilib - 32bit  -->
     125  <!-- - - - - - - - - - -->
     126
     127  <sect2 arch="ml_32,ml_all" role="installation">
     128    <title>Installation of GMP - 32bit</title>
     129
     130    <para>Clean previous build:</para>
     131
     132<screen><userinput remap="pre">make distclean</userinput></screen>
     133
     134    <para>Generic libraries can be created by running
     135    the following:</para>
     136
     137<screen role="nodump"><userinput remap="pre">cp -v configfsf.guess config.guess
     138cp -v configfsf.sub   config.sub</userinput></screen>
     139
     140    <para>Prepare GMP for compilation:</para>
     141
     142<screen><userinput remap="configure">ABI="32" \
     143CFLAGS="-m32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=i686" \
     144CXXFLAGS="$CFLAGS" \
     145PKG_CONFIG_PATH="&usr-lib-m32;/pkgconfig" \
     146./configure             \
     147    --prefix=/usr       \
     148    --disable-static    \
     149    --enable-cxx        \
     150    --libdir=&usr-lib-m32; \
     151    --includedir=&usr-inc-m32;/gmp</userinput></screen>
     152
     153    <variablelist>
     154      <title>The meaning of the new configure options:</title>
     155
     156      <varlistentry>
     157        <term><parameter>--includedir=&usr-inc-m32;/gmp</parameter></term>
     158        <listitem>
     159          <para>Some definitions in gmp.h differs for each arch but
     160          has same name. Therefore, the headers must be separated from
     161          each other.</para>
     162        </listitem>
     163      </varlistentry>
     164
     165    </variablelist>
     166
     167    <para>Compile the package:</para>
     168
     169<screen><userinput remap="make">sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
     170make</userinput></screen>
     171
     172    <important>
     173      <para>The test suite for GMP in this section is considered critical.
     174      Do not skip it under any circumstances.</para>
     175    </important>
     176
     177    <para>Test the results:</para>
     178
     179<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
     180 
     181    <para>Ensure that all 197 tests in the test suite passed.
     182    Check the results by issuing the following command:</para>
     183
     184<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
     185
     186    <para>Install the package:</para>
     187
     188<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     189cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     190cp -Rv DESTDIR&usr-inc-m32;/* &usr-inc-m32;/
     191rm -rf DESTDIR</userinput></screen>
     192
     193  </sect2><!-- m32 -->
     194
     195  <!-- - - - - - - - - - -->
     196  <!-- Multilib - x32bit -->
     197  <!-- - - - - - - - - - -->
     198
     199  <sect2 arch="ml_x32,ml_all" role="installation">
     200    <title>Installation of GMP - x32-bit</title>
     201
     202    <para>Clean previous build:</para>
     203
     204<screen><userinput remap="pre">make distclean</userinput></screen>
     205
     206    <para>Generic libraries can be created by running
     207    the following:</para>
     208
     209<screen role="nodump"><userinput remap="pre">cp -v configfsf.guess config.guess
     210cp -v configfsf.sub   config.sub</userinput></screen>
     211
     212    <para>Prepare GMP for compilation:</para>
     213
     214<screen><userinput remap="configure">ABI="x32" \
     215CFLAGS="-mx32 -O2 -pedantic -fomit-frame-pointer -mtune=generic -march=x86-64" \
     216CXXFLAGS="$CFLAGS" \
     217PKG_CONFIG_PATH="&usr-lib-mx32;/pkgconfig" \
     218./configure              \
     219    --prefix=/usr        \
     220    --disable-static     \
     221    --enable-cxx         \
     222    --libdir=&usr-lib-mx32; \
     223    --includedir=&usr-inc-mx32;/gmp</userinput></screen>
     224
     225    <para>Compile the package:</para>
     226
     227<screen><userinput remap="make">sed -i 's/$(exec_prefix)\/include/$\(includedir\)/' Makefile
     228make</userinput></screen>
     229
     230    <important>
     231      <para>The test suite for GMP in this section is considered critical.
     232      Do not skip it under any circumstances.</para>
     233    </important>
     234
     235    <para>Test the results:</para>
     236
     237<screen><userinput remap="test">make check 2>&amp;1 | tee gmp-check-log</userinput></screen>
     238 
     239    <para>Ensure that all 197 tests in the test suite passed.
     240    Check the results by issuing the following command:</para>
     241
     242<screen><userinput remap="test">awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log</userinput></screen>
     243
     244    <para>Install the package:</para>
     245
     246<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     247cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     248cp -Rv DESTDIR&usr-inc-mx32;/* &usr-inc-mx32;/
     249rm -rf DESTDIR</userinput></screen>
     250
     251  </sect2><!-- mx32 -->
     252
    123253  <sect2 id="contents-gmp" role="content">
    124254    <title>Contents of GMP</title>
  • chapter08/kmod.xml

    r24c34df rfeed564  
    9494  </sect2>
    9595
     96  <!-- - - - - - - - - - -->
     97  <!-- Multilib - 32bit  -->
     98  <!-- - - - - - - - - - -->
     99 
     100  <sect2 arch="ml_32,ml_all" role="installation">
     101    <title>Installation of Kmod - 32bit</title>
     102
     103    <para>Clean previous build but keep man pages as they cannot
     104    be recreated since xsltproc isn't installed yet:</para>
     105
     106<screen><userinput remap="pre">sed -e "s/^CLEANFILES =.*/CLEANFILES =/" -i man/Makefile
     107make clean</userinput></screen>
     108
     109    <para>Prepare Kmod for compilation:</para>
     110
     111<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     112    --prefix=/usr                 \
     113    --bindir=/bin                 \
     114    --libdir=&usr-lib-m32;          \
     115    --sysconfdir=/etc             \
     116    --with-xz                     \
     117    --with-zlib                   \
     118    --host=i686-pc-linux-gnu      \
     119    --with-rootlibdir=&usr-lib-m32;</userinput></screen>
     120
     121    <para>Compile the package:</para>
     122
     123<screen><userinput remap="make">make</userinput></screen>
     124
     125    <para>Install the package:</para>
     126
     127<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     128cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     129rm -rf DESTDIR</userinput></screen>
     130
     131  </sect2><!-- m32 -->
     132
     133  <!-- - - - - - - - - - -->
     134  <!-- Multilib - x32bit -->
     135  <!-- - - - - - - - - - -->
     136 
     137  <sect2 arch="ml_x32,ml_all" role="installation">
     138    <title>Installation of Kmod - x32bit</title>
     139
     140    <para>Clean previous build but keep man pages as they cannot
     141    be recreated since xsltproc isn't installed yet:</para>
     142
     143<screen><userinput remap="pre">sed -e "s/^CLEANFILES =.*/CLEANFILES =/" -i man/Makefile
     144make clean</userinput></screen>
     145
     146    <para>Prepare Kmod for compilation:</para>
     147
     148<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     149    --prefix=/usr                 \
     150    --bindir=/bin                 \
     151    --libdir=&usr-lib-mx32;          \
     152    --sysconfdir=/etc             \
     153    --with-xz                     \
     154    --with-zlib                   \
     155    --host=x86_64-pc-linux-gnux32 \
     156    --with-rootlibdir=&usr-lib-mx32;</userinput></screen>
     157
     158    <para>Compile the package:</para>
     159
     160<screen><userinput remap="make">make</userinput></screen>
     161
     162    <para>Install the package:</para>
     163
     164<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     165cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     166rm -rf DESTDIR</userinput></screen>
     167
     168  </sect2><!-- mx32 -->
     169
    96170  <sect2 id="contents-kmod" role="content">
    97171    <title>Contents of Kmod</title>
  • chapter08/libcap.xml

    r24c34df rfeed564  
    8282  </sect2>
    8383
     84  <!-- - - - - - - - - - -->
     85  <!-- Multilib - 32bit  -->
     86  <!-- - - - - - - - - - -->
     87 
     88  <sect2 arch="ml_32,ml_all" role="installation">
     89    <title>Installation of Libcap - 32bit</title>
     90
     91    <para>Clean previous build:</para>
     92
     93<screen><userinput remap="pre">make distclean</userinput></screen>
     94
     95    <para>Compile the package:</para>
     96
     97<screen><userinput remap="make">make CC="gcc -m32 -march=i686"</userinput></screen>
     98
     99    <para>Install the package:</para>
     100
     101<screen><userinput remap="install">make lib=lib32 prefix=$PWD/DESTDIR/usr -C libcap install
     102cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     103sed -e "s|^libdir=.*|libdir=&usr-lib-m32;|" -i &usr-lib-m32;/pkgconfig/lib{cap,psx}.pc
     104chmod -v 755 &usr-lib-m32;/libcap.so.&libcap-version;
     105rm -rf DESTDIR</userinput></screen>
     106
     107  </sect2><!-- m32 -->
     108
     109  <!-- - - - - - - - - - -->
     110  <!-- Multilib - x32bit -->
     111  <!-- - - - - - - - - - -->
     112 
     113  <sect2 arch="ml_x32,ml_all" role="installation">
     114    <title>Installation of Libcap - x32bit</title>
     115
     116    <para>Clean previous build:</para>
     117
     118<screen><userinput remap="pre">make distclean</userinput></screen>
     119
     120    <para>Compile the package:</para>
     121
     122<screen><userinput remap="make">make CC="gcc -mx32 -march=x86-64"</userinput></screen>
     123
     124    <para>Install the package:</para>
     125
     126<screen><userinput remap="install">make lib=libx32 prefix=$PWD/DESTDIR/usr -C libcap install
     127cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     128sed -e "s|^libdir=.*|libdir=&usr-lib-mx32;|" -i &usr-lib-mx32;/pkgconfig/lib{cap,psx}.pc
     129chmod -v 755 &usr-lib-mx32;/libcap.so.&libcap-version;
     130rm -rf DESTDIR</userinput></screen>
     131
     132  </sect2><!-- mx32 -->
     133
    84134  <sect2 id="contents-libcap" role="content">
    85135    <title>Contents of Libcap</title>
  • chapter08/libelf.xml

    r24c34df rfeed564  
    7070  </sect2>
    7171
     72  <!-- - - - - - - - - - -->
     73  <!-- Multilib - 32bit  -->
     74  <!-- - - - - - - - - - -->
     75 
     76  <sect2 arch="ml_32,ml_all" role="installation">
     77    <title>Installation of Libelf - 32bit</title>
     78
     79    <para>Clean previous build:</para>
     80
     81<screen><userinput remap="pre">make distclean</userinput></screen>
     82
     83    <para>Prepare Libtool for compilation:</para>
     84
     85<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     86    --prefix=/usr            \
     87    --libdir=&usr-lib-m32;     \
     88    --host=i686-pc-linux-gnu \
     89    --disable-debuginfod     \
     90    --enable-libdebuginfod=dummy</userinput></screen>
     91
     92    <para>Compile the package:</para>
     93
     94<screen><userinput remap="make">make</userinput></screen>
     95
     96    <para>Install the package:</para>
     97
     98<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR -C libelf install
     99install -vDm644 config/libelf.pc DESTDIR&usr-lib-m32;/pkgconfig/libelf.pc
     100cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     101rm -rf DESTDIR</userinput></screen>
     102
     103  </sect2><!-- m32 -->
     104
     105  <!-- - - - - - - - - - -->
     106  <!-- Multilib - x32bit -->
     107  <!-- - - - - - - - - - -->
     108 
     109  <sect2 arch="ml_x32,ml_all" role="installation">
     110    <title>Installation of Libelf - x32bit</title>
     111
     112    <para>Clean previous build:</para>
     113
     114<screen><userinput remap="pre">make distclean</userinput></screen>
     115
     116    <para>Prepare Libtool for compilation:</para>
     117
     118<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     119    --prefix=/usr                 \
     120    --libdir=&usr-lib-m32;           \
     121    --host=x86_64-pc-linux-gnux32 \
     122    --disable-debuginfod          \
     123    --enable-libdebuginfod=dummy</userinput></screen>
     124
     125    <para>Compile the package:</para>
     126
     127<screen><userinput remap="make">make</userinput></screen>
     128
     129    <para>Install the package:</para>
     130
     131<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR -C libelf install
     132install -vDm644 config/libelf.pc DESTDIR&usr-lib-mx32;/pkgconfig/libelf.pc
     133cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     134rm -rf DESTDIR</userinput></screen>
     135
     136  </sect2><!-- mx32 -->
     137
    72138  <sect2 id="contents-elfutils" role="content">
    73139    <title>Contents of Libelf</title>
  • chapter08/libffi.xml

    r24c34df rfeed564  
    8888  </sect2>
    8989
     90  <!-- - - - - - - - - - -->
     91  <!-- Multilib - 32bit  -->
     92  <!-- - - - - - - - - - -->
     93 
     94  <sect2 arch="ml_32,ml_all" role="installation">
     95    <title>Installation of Libffi - 32bit</title>
     96
     97    <para>Clean previous build:</para>
     98
     99<screen><userinput remap="pre">make distclean</userinput></screen>
     100
     101    <para>Prepare Libffi for compilation:</para>
     102
     103<screen><userinput remap="configure">CC="gcc -m32" CXX="g++ -m32" ./configure \
     104    --prefix=/usr            \
     105    --disable-static         \
     106    --libdir=&usr-lib-m32;     \
     107    --with-gcc-arch=i686     \
     108    --host=i686-pc-linux-gnu</userinput></screen>
     109
     110    <para>Compile the package:</para>
     111
     112<screen><userinput remap="make">make</userinput></screen>
     113
     114    <para>To test the results, issue:</para>
     115
     116<screen><userinput remap="test">make check</userinput></screen>
     117
     118    <para>Install the package:</para>
     119
     120<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     121cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     122rm -rf DESTDIR</userinput></screen>
     123
     124  </sect2><!-- m32 -->
     125
     126  <!-- - - - - - - - - - -->
     127  <!-- Multilib - x32bit -->
     128  <!-- - - - - - - - - - -->
     129 
     130  <sect2 arch="ml_x32,ml_all" role="installation">
     131    <title>Installation of Libffi - x32bit</title>
     132
     133    <para>Clean previous build:</para>
     134
     135<screen><userinput remap="pre">make distclean</userinput></screen>
     136
     137    <para>Prepare Libffi for compilation:</para>
     138
     139<screen><userinput remap="configure">CC="gcc -mx32" CXX="g++ -mx32" ./configure \
     140    --prefix=/usr            \
     141    --disable-static         \
     142    --libdir=&usr-lib-mx32;     \
     143    --with-gcc-arch=x86_64   \
     144    --host=x86_64-unknown-linux-gnux32</userinput></screen>
     145
     146    <para>Compile the package:</para>
     147
     148<screen><userinput remap="make">make</userinput></screen>
     149
     150    <para>To test the results, issue:</para>
     151
     152<screen><userinput remap="test">make check</userinput></screen>
     153
     154    <para>Install the package:</para>
     155
     156<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     157cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     158rm -rf DESTDIR</userinput></screen>
     159
     160  </sect2><!-- mx32 -->
     161
    90162  <sect2 id="contents-libffi" role="content">
    91163    <title>Contents of Libffi</title>
  • chapter08/libtool.xml

    r24c34df rfeed564  
    7878  </sect2>
    7979
     80  <!-- - - - - - - - - - -->
     81  <!-- Multilib - 32bit  -->
     82  <!-- - - - - - - - - - -->
     83 
     84  <sect2 arch="ml_32,ml_all" role="installation">
     85    <title>Installation of Libtool - 32bit</title>
     86
     87    <para>Clean previous build:</para>
     88
     89<screen><userinput remap="pre">make distclean</userinput></screen>
     90
     91    <para>Prepare Libtool for compilation:</para>
     92
     93<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     94    --prefix=/usr         \
     95    --libdir=&usr-lib-m32;  \
     96    --host=i686-pc-linux-gnu</userinput></screen>
     97
     98    <para>Compile the package:</para>
     99
     100<screen><userinput remap="make">make</userinput></screen>
     101
     102    <para>Install the package:</para>
     103
     104<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     105cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     106rm -rf DESTDIR</userinput></screen>
     107
     108  </sect2><!-- m32 -->
     109
     110  <!-- - - - - - - - - - -->
     111  <!-- Multilib - x32bit -->
     112  <!-- - - - - - - - - - -->
     113 
     114  <sect2 arch="ml_x32,ml_all" role="installation">
     115    <title>Installation of Libtool - x32bit</title>
     116
     117    <para>Clean previous build:</para>
     118
     119<screen><userinput remap="pre">make distclean</userinput></screen>
     120
     121    <para>Prepare Libtool for compilation:</para>
     122
     123<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     124    --prefix=/usr         \
     125    --libdir=&usr-lib-mx32;  \
     126    --host=x86_64-pc-linux-gnux32</userinput></screen>
     127
     128    <para>Compile the package:</para>
     129
     130<screen><userinput remap="make">make</userinput></screen>
     131
     132    <para>Install the package:</para>
     133
     134<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     135cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     136rm -rf DESTDIR</userinput></screen>
     137
     138  </sect2><!-- mx32 -->
    80139
    81140  <sect2 id="contents-libtool" role="content">
  • chapter08/ncurses.xml

    r24c34df rfeed564  
    161161
    162162  </sect2>
     163
     164  <!-- - - - - - - - - - -->
     165  <!-- Multilib - 32bit  -->
     166  <!-- - - - - - - - - - -->
     167  <sect2 arch="ml_32,ml_all">
     168    <title>Building Ncurses - 32bit</title>
     169
     170    <para>Clean previous build:</para>
     171
     172<screen><userinput remap="pre">make distclean</userinput></screen>
     173
     174    <para>Prepare Ncurses for compilation:</para>
     175
     176<screen><userinput remap="configure">CC="gcc -m32" CXX="g++ -m32" \
     177./configure --prefix=/usr           \
     178            --host=i686-pc-linux-gnu \
     179            --libdir=&usr-lib-m32;     \
     180            --mandir=/usr/share/man \
     181            --with-shared           \
     182            --without-debug         \
     183            --without-normal        \
     184            --enable-pc-files       \
     185            --enable-widec          \
     186            --with-pkg-config-libdir=&usr-lib-m32;/pkgconfig</userinput></screen>
     187
     188    <para>Compile the package:</para>
     189
     190<screen><userinput remap="make">make</userinput></screen>
     191
     192    <para>Install the package:</para>
     193
     194<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     195mkdir -p DESTDIR&usr-lib-m32;/pkgconfig
     196for lib in ncurses form panel menu ; do
     197    rm -vf                    DESTDIR&usr-lib-m32;/lib${lib}.so
     198    echo "INPUT(-l${lib}w)" > DESTDIR&usr-lib-m32;/lib${lib}.so
     199    ln -svf ${lib}w.pc        DESTDIR&usr-lib-m32;/pkgconfig/$lib.pc
     200done
     201rm -vf                     DESTDIR&usr-lib-m32;/libcursesw.so
     202echo "INPUT(-lncursesw)" > DESTDIR&usr-lib-m32;/libcursesw.so
     203ln -sfv libncurses.so      DESTDIR&usr-lib-m32;/libcurses.so
     204cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     205rm -rf DESTDIR</userinput></screen>
     206
     207  </sect2><!-- m32 -->
     208
     209  <!-- - - - - - - - - - -->
     210  <!-- Multilib - x32bit -->
     211  <!-- - - - - - - - - - -->
     212  <sect2 arch="ml_x32,ml_all">
     213    <title>Building Ncurses - x32bit</title>
     214
     215    <para>Clean previous build:</para>
     216
     217<screen><userinput remap="pre">make distclean</userinput></screen>
     218
     219    <para>Prepare Ncurses for compilation:</para>
     220
     221<screen><userinput remap="configure">CC="gcc -mx32" CXX="g++ -mx32" \
     222./configure --prefix=/usr           \
     223            --host=x86_64-pc-linux-gnux32 \
     224            --libdir=&usr-lib-mx32;    \
     225            --mandir=/usr/share/man \
     226            --with-shared           \
     227            --without-debug         \
     228            --without-normal        \
     229            --enable-pc-files       \
     230            --enable-widec          \
     231            --with-pkg-config-libdir=&usr-lib-mx32;/pkgconfig</userinput></screen>
     232
     233    <para>Compile the package:</para>
     234
     235<screen><userinput remap="make">make</userinput></screen>
     236
     237    <para>Install the package:</para>
     238
     239<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     240mkdir -p DESTDIR&usr-lib-mx32;/pkgconfig
     241for lib in ncurses form panel menu ; do
     242    rm -vf                    DESTDIR&usr-lib-mx32;/lib${lib}.so
     243    echo "INPUT(-l${lib}w)" > DESTDIR&usr-lib-mx32;/lib${lib}.so
     244    ln -svf ${lib}w.pc        DESTDIR&usr-lib-mx32;/pkgconfig/$lib.pc
     245done
     246rm -vf                     DESTDIR&usr-lib-mx32;/libcursesw.so
     247echo "INPUT(-lncursesw)" > DESTDIR&usr-lib-mx32;/libcursesw.so
     248ln -sfv libncurses.so      DESTDIR&usr-lib-mx32;/libcurses.so
     249cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     250rm -rf DESTDIR</userinput></screen>
     251
     252  </sect2><!-- mx32 -->
    163253
    164254  <sect2 id="contents-ncurses" role="content">
  • chapter08/openssl.xml

    r24c34df rfeed564  
    7979
    8080  </sect2>
     81
     82  <!-- - - - - - - - - - -->
     83  <!-- Multilib - 32bit  -->
     84  <!-- - - - - - - - - - -->
     85 
     86  <sect2 arch="ml_32,ml_all" role="installation">
     87    <title>Installation of OpenSSL - 32bit</title>
     88
     89    <para>Clean previous build:</para>
     90
     91<screen><userinput remap="pre">make distclean</userinput></screen>
     92
     93    <para>Prepare OpenSSL for compilation:</para>
     94
     95<screen><userinput remap="configure">MACHINE="i686"             \
     96CC="gcc -m32 -march=i686"  \
     97CXX="g++ -m32 -march=i686" \
     98    ./config               \
     99    --prefix=/usr          \
     100    --libdir=&usr-lib-m32;    \
     101    --openssldir=/etc/ssl  \
     102    --libdir=lib32         \
     103    shared                 \
     104    zlib-dynamic</userinput></screen>
     105
     106    <para>Compile the package:</para>
     107
     108<screen><userinput remap="make">make</userinput></screen>
     109
     110    <para>Install the package:</para>
     111
     112<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     113cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     114rm -rf DESTDIR</userinput></screen>
     115
     116  </sect2><!-- m32 -->
     117
     118  <!-- - - - - - - - - - -->
     119  <!-- Multilib - x32bit -->
     120  <!-- - - - - - - - - - -->
     121 
     122  <sect2 arch="ml_x32,ml_all" role="installation">
     123    <title>Installation of OpenSSL - x32bit</title>
     124
     125    <para>Clean previous build:</para>
     126
     127<screen><userinput remap="pre">make distclean</userinput></screen>
     128
     129    <para>Prepare OpenSSL for compilation:</para>
     130
     131<screen><userinput remap="configure">MACHINE="x86_64"          \
     132CC="gcc -mx32"            \
     133CXX="g++ -mx32"           \
     134    ./config              \
     135    --prefix=/usr         \
     136    --libdir=&usr-lib-mx32;  \
     137    --openssldir=/etc/ssl \
     138    --libdir=libx32       \
     139    shared                \
     140    zlib-dynamic</userinput></screen>
     141
     142    <para>Compile the package:</para>
     143
     144<screen><userinput remap="make">make</userinput></screen>
     145
     146    <para>Install the package:</para>
     147
     148<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     149cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     150rm -rf DESTDIR</userinput></screen>
     151
     152  </sect2><!-- mx32 -->
    81153
    82154  <sect2 id="contents-openssl" role="content">
  • chapter08/readline.xml

    r24c34df rfeed564  
    108108  </sect2>
    109109
     110  <!-- - - - - - - - - - -->
     111  <!-- Multilib - 32bit  -->
     112  <!-- - - - - - - - - - -->
     113 
     114  <sect2 arch="ml_32,ml_all" role="installation">
     115    <title>Installation of Readline - 32bit</title>
     116
     117    <para>Clean previous build:</para>
     118
     119<screen><userinput remap="pre">make distclean</userinput></screen>
     120
     121    <para>Prepare Readline for compilation:</para>
     122
     123<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     124    --prefix=/usr                     \
     125    --libdir=&usr-lib-m32;               \
     126    --disable-static                  \
     127    --host=i686-pc-linux-gnu</userinput></screen>
     128
     129    <para>Compile the package:</para>
     130
     131<screen><userinput remap="make">make</userinput></screen>
     132
     133    <para>Install the package:</para>
     134
     135<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     136cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     137rm -rf DESTDIR</userinput></screen>
     138
     139  </sect2><!-- m32 -->
     140
     141  <!-- - - - - - - - - - -->
     142  <!-- Multilib - x32bit -->
     143  <!-- - - - - - - - - - -->
     144 
     145  <sect2 arch="ml_x32,ml_all" role="installation">
     146    <title>Installation of Readline - x32bit</title>
     147
     148    <para>Clean previous build:</para>
     149
     150<screen><userinput remap="pre">make distclean</userinput></screen>
     151
     152    <para>Prepare Readline for compilation:</para>
     153
     154<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     155    --prefix=/usr          \
     156    --libdir=&usr-lib-mx32;   \
     157    --disable-static       \
     158    --host=x86_64-pc-linux-gnux32</userinput></screen>
     159
     160    <para>Compile the package:</para>
     161
     162<screen><userinput remap="make">make</userinput></screen>
     163
     164    <para>Install the package:</para>
     165
     166<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     167cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     168rm -rf DESTDIR</userinput></screen>
     169
     170  </sect2><!-- mx32 -->
     171
    110172  <sect2 id="contents-readline" role="content">
    111173    <title>Contents of Readline</title>
  • chapter08/revisedchroot.xml

    r24c34df rfeed564  
    4444  To remove them, run:</para>
    4545
    46 <screen><userinput>find /usr/lib /usr/libexec -name \*.la -delete</userinput></screen>
     46<screen><userinput>find /usr/lib /usr/libexec -name \*.la -delete</userinput><userinput arch="ml_32,ml_all">
     47find &usr-lib-m32; -name \*.la -delete</userinput><userinput arch="ml_x32,ml_all">
     48find &usr-lib-mx32; -name \*.la -delete</userinput></screen>
    4749
    4850   <para>For more information about libtool archive files, see the <ulink
  • chapter08/strippingagain.xml

    r24c34df rfeed564  
    3737
    3838cd /lib
    39 
    4039for LIB in $save_lib; do
    4140    objcopy --only-keep-debug $LIB $LIB.dbg
    4241    strip --strip-unneeded $LIB
    4342    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
    44 done   
     43done</userinput>
     44<userinput arch="ml_32,ml_all">
     45cd &lib-m32;
     46for LIB in $save_lib; do
     47    objcopy --only-keep-debug $LIB $LIB.dbg
     48    strip --strip-unneeded $LIB
     49    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
     50done</userinput>
     51<userinput arch="ml_x32,ml_all">
     52cd &lib-mx32;
     53for LIB in $save_lib; do
     54    objcopy --only-keep-debug $LIB $LIB.dbg
     55    strip --strip-unneeded $LIB
     56    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
     57done</userinput><userinput>
    4558
    4659save_usrlib="libquadmath.so.&libquadmath-version; libstdc++.so.&libstdcpp-version;
     
    4861
    4962cd /usr/lib
    50 
    5163for LIB in $save_usrlib; do
    5264    objcopy --only-keep-debug $LIB $LIB.dbg
    5365    strip --strip-unneeded $LIB
    5466    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
    55 done
     67done</userinput>
     68<userinput arch="ml_32,ml_all">
     69cd &usr-lib-m32;
     70for LIB in $save_usrlib; do
     71    objcopy --only-keep-debug $LIB $LIB.dbg
     72    strip --strip-unneeded $LIB
     73    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
     74done</userinput>
     75<userinput arch="ml_x32,ml_all">
     76cd &usr-lib-mx32;
     77for LIB in $save_usrlib; do
     78    objcopy --only-keep-debug $LIB $LIB.dbg
     79    strip --strip-unneeded $LIB
     80    objcopy --add-gnu-debuglink=$LIB.dbg $LIB
     81done</userinput><userinput>
    5682
    5783unset LIB save_lib save_usrlib</userinput></screen>
     
    6692  <para>Now the binaries and libraries can be stripped:</para>
    6793<screen><userinput>find /usr/lib -type f -name \*.a \
    68    -exec strip --strip-debug {} ';'
     94   -exec strip --strip-debug {} ';'</userinput>
     95<userinput arch="ml_32,ml_all">find &usr-lib-m32; -type f -name \*.a \
     96   -exec strip --strip-debug {} ';'</userinput>
     97<userinput arch="ml_x32,ml_all">find &usr-lib-mx32; -type f -name \*.a \
     98   -exec strip --strip-debug {} ';'</userinput><userinput>
    6999
    70100find /lib /usr/lib -type f -name \*.so* ! -name \*dbg \
    71    -exec strip --strip-unneeded {} ';'
     101   -exec strip --strip-unneeded {} ';'</userinput>
     102<userinput arch="ml_32,ml_all">find &lib-m32; &usr-lib-m32; -type f -name \*.so* ! -name \*dbg \
     103   -exec strip --strip-unneeded {} ';'</userinput>
     104<userinput arch="ml_x32,ml_all">find &lib-mx32; &usr-lib-mx32; -type f -name \*.so* ! -name \*dbg \
     105   -exec strip --strip-unneeded {} ';'</userinput><userinput>
    72106
    73107find /{bin,sbin} /usr/{bin,sbin,libexec} -type f \
  • chapter08/systemd.xml

    r24c34df rfeed564  
    246246
    247247  </sect2>
     248
     249  <!-- - - - - - - - - - -->
     250  <!-- Multilib - 32bit  -->
     251  <!-- - - - - - - - - - -->
     252 
     253  <sect2 arch="ml_32,ml_all" role="installation">
     254    <title>Installation of systemd - 32-bit</title>
     255
     256    <para>Clean previous build:</para>
     257
     258<screen><userinput remap="pre">rm -rf *</userinput></screen>
     259
     260    <para>Create a symlink to work around missing xsltproc:</para>
     261
     262<!-- screen><userinput remap="pre">ln -sf /tools/bin/true /usr/bin/xsltproc</userinput></screen -->
     263<screen><userinput remap="pre">ln -sf /bin/true /usr/bin/xsltproc</userinput></screen>
     264
     265<!-- with cross-LFS we have util-linux in place:
     266    <para>Because we have not yet installed the final version of Util-Linux,
     267    create links to the libraries in the approprite location:</para>
     268
     269<screen><userinput remap="pre">for file in /tools/lib32/lib{blkid,mount,uuid}*; do
     270    ln -sf $file /usr/lib32/
     271done</userinput></screen>
     272-->
     273
     274    <para>Prepare systemd for compilation:</para>
     275
     276    <screen><userinput remap="configure">PKG_CONFIG_PATH="&usr-lib-m32;/pkgconfig" \
     277CC="gcc -m32 -march=i686"              \
     278CXX="g++ -m32 -march=i686"             \
     279LANG=en_US.UTF-8                       \
     280meson --prefix=/usr                    \
     281      --sysconfdir=/etc                \
     282      --localstatedir=/var             \
     283      -Dblkid=true                     \
     284      -Dbuildtype=release              \
     285      -Ddefault-dnssec=no              \
     286      -Dfirstboot=false                \
     287      -Dinstall-tests=false            \
     288      -Dkill-path=/bin/kill            \
     289      -Dkmod-path=/bin/kmod            \
     290      -Dldconfig=false                 \
     291      -Dmount-path=/bin/mount          \
     292      -Drootprefix=                    \
     293      -Drootlibdir=&usr-lib-m32;          \
     294      -Dsplit-usr=true                 \
     295      -Dsulogin-path=/sbin/sulogin     \
     296      -Dsysusers=false                 \
     297      -Dumount-path=/bin/umount        \
     298      -Db_lto=false                    \
     299      ..</userinput></screen>
     300
     301    <para>Compile the package:</para>
     302
     303<screen><userinput remap="make">LANG=en_US.UTF-8 ninja</userinput></screen>
     304
     305    <para>Install the package:</para>
     306
     307<screen><userinput remap="install">LANG=en_US.UTF-8 DESTDIR=$PWD/DESTDIR ninja install
     308cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     309rm -rf DESTDIR
     310rm -f /usr/bin/xsltproc</userinput></screen>
     311
     312  </sect2><!-- m32 -->
     313
     314  <!-- - - - - - - - - - -->
     315  <!-- Multilib - x32bit -->
     316  <!-- - - - - - - - - - -->
     317 
     318  <sect2 arch="ml_x32,ml_all" role="installation">
     319    <title>Installation of systemd - x32-bit</title>
     320
     321    <para>Clean previous build:</para>
     322
     323<screen><userinput remap="pre">rm -rf *</userinput></screen>
     324
     325    <para>Create a symlink to work around missing xsltproc:</para>
     326
     327<screen><userinput remap="pre">ln -sf /bin/true /usr/bin/xsltproc</userinput></screen>
     328
     329    <para>Fix an issue on x32:</para>
     330
     331<screen><userinput remap="pre">sed '/log_debug/s@PRI_TIMEX@PRIi64@' -i src/timesync/timesyncd-manager.c
     332sed '/long drift_freq;/s@long @int64_t @' -i src/timesync/timesyncd-manager.h</userinput></screen>
     333
     334    <para>Prepare systemd for compilation:</para>
     335
     336<screen><userinput remap="configure">PKG_CONFIG_PATH="&usr-lib-mx32;/pkgconfig" \
     337CC="gcc -mx32"                          \
     338CXX="g++ -mx32"                         \
     339CFLAGS+="-Wno-error=shift-overflow"     \
     340CXXFLAGS+="-Wno-error=shift-overflow"   \
     341LANG=en_US.UTF-8                        \
     342meson --prefix=/usr                     \
     343      --sysconfdir=/etc                 \
     344      --localstatedir=/var              \
     345      -Dblkid=true                      \
     346      -Dbuildtype=release               \
     347      -Ddefault-dnssec=no               \
     348      -Dfirstboot=false                 \
     349      -Dinstall-tests=false             \
     350      -Dkill-path=/bin/kill             \
     351      -Dkmod-path=/bin/kmod             \
     352      -Dldconfig=false                  \
     353      -Dmount-path=/bin/mount           \
     354      -Drootprefix=                     \
     355      -Drootlibdir=&usr-lib-mx32;          \
     356      -Dsplit-usr=true                  \
     357      -Dsulogin-path=/sbin/sulogin      \
     358      -Dsysusers=false                  \
     359      -Dumount-path=/bin/umount         \
     360      -Db_lto=false                     \
     361      ..</userinput></screen>
     362
     363    <para>Compile the package:</para>
     364
     365<screen><userinput remap="make">LANG=en_US.UTF-8 ninja</userinput></screen>
     366
     367    <para>Install the package:</para>
     368
     369<screen><userinput remap="install">LANG=en_US.UTF-8 DESTDIR=$PWD/DESTDIR ninja install
     370cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     371rm -rf DESTDIR
     372rm -f /usr/bin/xsltproc</userinput></screen>
     373
     374  </sect2><!-- mx32 -->
    248375
    249376  <sect2 id="contents-systemd" role="content">
  • chapter08/util-linux.xml

    r24c34df rfeed564  
    102102
    103103  </sect2>
     104
     105  <!-- - - - - - - - - - -->
     106  <!-- Multilib - 32bit  -->
     107  <!-- - - - - - - - - - -->
     108 
     109  <sect2 arch="ml_32,ml_all" role="installation">
     110    <title>Installation of Util-linux - 32-bit</title>
     111
     112    <para>Clean previous build:</para>
     113
     114<screen><userinput remap="pre">make distclean</userinput></screen>
     115
     116    <para>Prepare Util-linux for compilation:</para>
     117
     118<screen revision="sysv"><userinput remap="configure">CC="gcc -m32" \
     119./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \
     120            --docdir=/usr/share/doc/util-linux-&util-linux-version; \
     121            --disable-chfn-chsh      \
     122            --disable-login          \
     123            --disable-nologin        \
     124            --disable-su             \
     125            --disable-setpriv        \
     126            --disable-runuser        \
     127            --disable-pylibmount     \
     128            --disable-static         \
     129            --without-python         \
     130            --without-systemd        \
     131            --libdir=&usr-lib-m32;      \
     132            --host=i686-pc-linux-gnu \
     133            --without-systemdsystemunitdir \
     134            --enable-libmount-force-mountinfo</userinput></screen>
     135
     136<screen revision="systemd"><userinput remap="configure">CC="gcc -m32" \
     137./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \
     138            --docdir=/usr/share/doc/util-linux-&util-linux-version; \
     139            --disable-chfn-chsh      \
     140            --disable-login          \
     141            --disable-nologin        \
     142            --disable-su             \
     143            --disable-setpriv        \
     144            --disable-runuser        \
     145            --disable-pylibmount     \
     146            --disable-static         \
     147            --without-python         \
     148            --libdir=&usr-lib-m32;      \
     149            --host=i686-pc-linux-gnu \
     150            --enable-libmount-force-mountinfo</userinput></screen>
     151
     152    <para>Compile the package:</para>
     153
     154<screen><userinput remap="make">make</userinput></screen>
     155
     156    <para>Install the package:</para>
     157
     158<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     159cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     160rm -rf DESTDIR</userinput></screen>
     161
     162  </sect2><!-- m32 -->
     163
     164  <!-- - - - - - - - - - -->
     165  <!-- Multilib - x32bit -->
     166  <!-- - - - - - - - - - -->
     167 
     168  <sect2 arch="ml_x32,ml_all" role="installation">
     169    <title>Installation of Util-linux - x32-bit</title>
     170
     171    <para>Clean previous build:</para>
     172
     173<screen><userinput remap="pre">make distclean</userinput></screen>
     174
     175    <para>Prepare Util-linux for compilation:</para>
     176
     177<screen revision="sysv"><userinput remap="configure">CC="gcc -mx32" \
     178./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \
     179            --docdir=/usr/share/doc/util-linux-&util-linux-version; \
     180            --disable-chfn-chsh  \
     181            --disable-login      \
     182            --disable-nologin    \
     183            --disable-su         \
     184            --disable-setpriv    \
     185            --disable-runuser    \
     186            --disable-pylibmount \
     187            --disable-static     \
     188            --without-python     \
     189            --without-systemd    \
     190            --without-systemdsystemunitdir \
     191            --libdir=&usr-lib-mx32; \
     192            --host=x86_64-pc-linux-gnux32 \
     193            --enable-libmount-force-mountinfo</userinput></screen>
     194
     195<screen revision="systemd"><userinput remap="configure">CC="gcc -mx32" \
     196./configure ADJTIME_PATH=/var/lib/hwclock/adjtime   \
     197            --docdir=/usr/share/doc/util-linux-&util-linux-version; \
     198            --disable-chfn-chsh  \
     199            --disable-login      \
     200            --disable-nologin    \
     201            --disable-su         \
     202            --disable-setpriv    \
     203            --disable-runuser    \
     204            --disable-pylibmount \
     205            --disable-static     \
     206            --without-python     \
     207            --libdir=&usr-lib-mx32; \
     208            --host=x86_64-pc-linux-gnux32 \
     209            --enable-libmount-force-mountinfo</userinput></screen>
     210
     211    <para>Compile the package:</para>
     212
     213<screen><userinput remap="make">make</userinput></screen>
     214
     215    <para>Install the package:</para>
     216
     217<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     218cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     219rm -rf DESTDIR</userinput></screen>
     220
     221  </sect2><!-- mx32 -->
    104222
    105223  <sect2 id="contents-utillinux" role="content">
  • chapter08/xz.xml

    r24c34df rfeed564  
    6868
    6969  </sect2>
     70
     71  <!-- - - - - - - - - - -->
     72  <!-- Multilib - 32bit  -->
     73  <!-- - - - - - - - - - -->
     74 
     75  <sect2 arch="ml_32,ml_all" role="installation">
     76    <title>Installation of Xz - 32bit</title>
     77
     78    <para>Clean previous build:</para>
     79
     80<screen><userinput remap="pre">make distclean</userinput></screen>
     81
     82    <para>Prepare Xz for compilation:</para>
     83
     84<screen><userinput remap="configure">CC="gcc -m32" ./configure \
     85    --prefix=/usr         \
     86    --disable-static      \
     87    --libdir=&usr-lib-m32;   \
     88    --host=i686-pc-linux-gnu</userinput></screen>
     89
     90    <para>Compile the package:</para>
     91
     92<screen><userinput remap="make">make</userinput></screen>
     93
     94    <para>Install the package:</para>
     95
     96<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     97cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     98rm -rf DESTDIR</userinput></screen>
     99
     100  </sect2><!-- m32 -->
     101
     102  <!-- - - - - - - - - - -->
     103  <!-- Multilib - x32bit -->
     104  <!-- - - - - - - - - - -->
     105 
     106  <sect2 arch="ml_x32,ml_all" role="installation">
     107    <title>Installation of Xz - x32bit</title>
     108
     109    <para>Clean previous build:</para>
     110
     111<screen><userinput remap="pre">make distclean</userinput></screen>
     112
     113    <para>Prepare Xz for compilation:</para>
     114
     115<screen><userinput remap="configure">CC="gcc -mx32" ./configure \
     116    --prefix=/usr          \
     117    --disable-static       \
     118    --libdir=&usr-lib-mx32;   \
     119    --host=x86_64-pc-linux-gnux32</userinput></screen>
     120
     121    <para>Compile the package:</para>
     122
     123<screen><userinput remap="make">make</userinput></screen>
     124
     125    <para>Install the package:</para>
     126
     127<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     128cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     129rm -rf DESTDIR</userinput></screen>
     130
     131  </sect2><!-- mx32 -->
    70132
    71133  <sect2 id="contents-xz" role="content">
  • chapter08/zlib.xml

    r24c34df rfeed564  
    7272  </sect2>
    7373
     74  <!-- - - - - - - - - - -->
     75  <!-- Multilib - 32bit  -->
     76  <!-- - - - - - - - - - -->
     77
     78  <sect2 arch="ml_32,ml_all" role="installation">
     79    <title>Installation of Zlib - 32bit</title>
     80
     81    <para>Clean previous build:</para>
     82
     83<screen><userinput remap="pre">make distclean</userinput></screen>
     84
     85    <para>Prepare Zlib for compilation:</para>
     86
     87<screen><userinput remap="configure">CC="gcc -m32" \
     88./configure --prefix=/usr \
     89    --libdir=&usr-lib-m32;</userinput></screen>
     90
     91    <para>Compile the package:</para>
     92
     93<screen><userinput remap="make">make</userinput></screen>
     94
     95    <para>Install the package:</para>
     96
     97<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     98cp -Rv DESTDIR&usr-lib-m32;/* &usr-lib-m32;
     99rm -rf DESTDIR</userinput></screen>
     100
     101  </sect2><!-- m32 -->
     102
     103  <!-- - - - - - - - - - -->
     104  <!-- Multilib - x32bit -->
     105  <!-- - - - - - - - - - -->
     106
     107  <sect2 arch="ml_x32,ml_all" role="installation">
     108    <title>Installation of Zlib - x32bit</title>
     109
     110<screen><userinput remap="pre">make distclean</userinput></screen>
     111
     112    <para>Prepare Zlib for compilation:</para>
     113
     114<screen><userinput remap="configure">CC="gcc -mx32" \
     115./configure --prefix=/usr    \
     116    --libdir=&usr-lib-mx32;</userinput></screen>
     117
     118    <para>Compile the package:</para>
     119
     120<screen><userinput remap="make">make</userinput></screen>
     121
     122    <para>Install the package:</para>
     123
     124<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
     125cp -Rv DESTDIR&usr-lib-mx32;/* &usr-lib-mx32;
     126rm -rf DESTDIR</userinput></screen>
     127
     128  </sect2><!-- mx32 -->
     129
    74130  <sect2 id="contents-zlib" role="content">
    75131    <title>Contents of Zlib</title>
  • chapter08/zstd.xml

    r24c34df rfeed564  
    6565
    6666  </sect2>
     67
     68  <!-- - - - - - - - - - -->
     69  <!-- Multilib - 32bit  -->
     70  <!-- - - - - - - - - - -->
     71 
     72  <sect2 arch="ml_32,ml_all" role="installation">
     73    <title>Installation of Zstd - 32bit</title>
     74
     75    <para>Clean previous build:</para>
     76
     77<screen><userinput remap="pre">make clean</userinput></screen>
     78
     79    <para>Compile the package:</para>
     80
     81<screen><userinput remap="make">CC="gcc -m32" make</userinput></screen>
     82
     83    <para>Install the package:</para>
     84
     85<screen><userinput remap="install">CC="gcc -m32" make prefix=/usr DESTDIR=$PWD/DESTDIR install
     86cp -Rv DESTDIR/usr/lib/* &usr-lib-m32;/
     87sed -e "/^libdir/s/lib$&lib-m32;/" -i &usr-lib-m32;/pkgconfig/libzstd.pc
     88rm -rf DESTDIR</userinput></screen>
     89
     90  </sect2><!-- m32 -->
     91
     92  <!-- - - - - - - - - - -->
     93  <!-- Multilib - x32bit -->
     94  <!-- - - - - - - - - - -->
     95 
     96  <sect2 arch="ml_x32,ml_all" role="installation">
     97    <title>Installation of Zstd - x32bit</title>
     98
     99    <para>Clean previous build:</para>
     100
     101<screen><userinput remap="pre">make clean</userinput></screen>
     102
     103    <para>Compile the package:</para>
     104
     105<screen><userinput remap="make">CC="gcc -mx32" make</userinput></screen>
     106
     107    <para>Install the package:</para>
     108
     109<screen><userinput remap="install">CC="gcc -mx32" make prefix=/usr DESTDIR=$PWD/DESTDIR install
     110cp -Rv DESTDIR/usr/lib/* &usr-lib-mx32;/
     111sed -e "/^libdir/s/lib$&lib-mx32;/" -i &usr-lib-mx32;/pkgconfig/libzstd.pc
     112rm -rf DESTDIR</userinput></screen>
     113
     114  </sect2><!-- mx32 -->
    67115
    68116  <sect2 id="contents-zstd" role="content">
  • chapter10/kernel.xml

    r24c34df rfeed564  
    156156    </note>
    157157
     158    <note arch="ml_32,ml_x32,ml_all">
     159      <para>
     160        The kernel on a multilib system needs to be able to
     161        identify and start binaries compiled for different architectures
     162        than the default.
     163      </para>
     164
     165      <para arch="ml_32,ml_all">
     166        If support for any 32bit ABI was built, make sure that the option
     167        "IA32 Emulation" is selected. The option 'IA32 a.out support' is
     168        optional.
     169      </para>
     170
     171      <para arch="ml_x32,ml_all">
     172        If support for the x32bit ABI was built, make sure that the option
     173        "x32 ABI for 64-bit mode" is selected.
     174      </para>
     175
     176<screen arch="ml_32">Binary Emulations  ---&gt;
     177    [*] IA32 Emulation
     178    &lt;M&gt;   IA32 a.out support
     179</screen>
     180<screen arch="ml_x32">Binary Emulations  ---&gt;
     181    [*] x32 ABI for 64-bit mode
     182</screen>
     183<screen arch="ml_all">Binary Emulations  ---&gt;
     184    [*] IA32 Emulation
     185    &lt;M&gt;   IA32 a.out support
     186    [*] x32 ABI for 64-bit mode
     187</screen>
     188
     189    </note>
     190   
    158191    <variablelist>
    159192      <title>The rationale for the above configuration items:</title>
  • general.ent

    r24c34df rfeed564  
    6464<!ENTITY % patches-entities SYSTEM "patches.ent">
    6565%patches-entities;
     66
     67<!-- multilib definitions -->
     68<!ENTITY lib-m32          "/lib32">
     69<!ENTITY lib-mx32         "/libx32">
     70<!ENTITY usr-lib-m32      "/usr/lib32">
     71<!ENTITY usr-lib-mx32     "/usr/libx32">
     72<!ENTITY usr-inc-m32      "/usr/include/m32">
     73<!ENTITY usr-inc-mx32     "/usr/include/mx32">
  • packages.ent

    r24c34df rfeed564  
    352352<!ENTITY iproute2-fin-du "15 MB">
    353353<!ENTITY iproute2-fin-sbu "0.2 SBU">
     354
     355<!ENTITY isl-version "0.22.1">
     356<!ENTITY isl-size "1.6 MB">
     357<!ENTITY isl-url "http://isl.gforge.inria.fr/isl-&isl-version;.tar.xz">
     358<!ENTITY isl-md5 "6e124849a9b62e3e2d5d51e955323f6e">
     359<!ENTITY isl-home "http://isl.gforge.inria.fr/">
     360<!ENTITY isl-fin-du "20 MB">
     361<!ENTITY isl-fin-sbu "0.1 SBU">
    354362
    355363<!ENTITY kbd-version "2.4.0">
  • prologue/bookinfo.xml

    r24c34df rfeed564  
    88<bookinfo>
    99  <title>Linux From Scratch</title>
    10   <subtitle revision='sysv'   >Version &version; </subtitle>
    11   <subtitle revision='systemd'>Version &versiond;</subtitle>
     10  <subtitle arch="default" revision='sysv'>Version &version;</subtitle>
     11  <subtitle arch="default" revision='systemd'>Version &versiond;</subtitle>
     12  <subtitle arch="ml_32,ml_x32,ml_all" revision='sysv'>Version &version;-multilib</subtitle>
     13  <subtitle arch="ml_32,ml_x32,ml_all" revision='systemd'>Version &versiond;-multilib</subtitle>
    1214  <subtitle>Published &releasedate;</subtitle>
    1315
     
    3032      <firstname>Editor: DJ</firstname>
    3133      <surname>Lucas</surname>
     34    </author>
     35
     36    <author arch="ml_32,ml_x32,ml_all">
     37      <firstname>Editor: Thomas</firstname>
     38      <surname>Trepl</surname>
    3239    </author>
    3340  </authorgroup>
  • prologue/preface.xml

    r24c34df rfeed564  
    1616  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="architecture.xml"/>
    1717  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="prerequisites.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="multilib.xml"/>
    1819  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="standards.xml"/>
    1920  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="why.xml"/>
Note: See TracChangeset for help on using the changeset viewer.