- Timestamp:
- 03/31/2021 10:41:31 AM (3 years ago)
- Branches:
- ml-11.0, multilib
- Children:
- 6702623
- Parents:
- 989524c
- git-author:
- Thomas Trepl <thomas@…> (04/01/2019 05:00:45 PM)
- git-committer:
- Xℹ Ruoyao <xry111@…> (03/31/2021 10:41:31 AM)
- Location:
- chapter05
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/binutils-pass1.xml
r989524c rb3f1ebb3 73 73 <para>Now prepare Binutils for compilation:</para> 74 74 75 <screen ><userinput remap="configure">../configure --prefix=/tools \75 <screen arch="default"><userinput remap="configure">../configure --prefix=/tools \ 76 76 --with-sysroot=$LFS \ 77 77 --with-lib-path=/tools/lib \ … … 79 79 --disable-nls \ 80 80 --disable-werror</userinput></screen> 81 82 <screen arch="multilib"><userinput remap="configure">../configure --prefix=/tools \ 83 --with-sysroot=$LFS \ 84 --with-lib-path=/tools/lib:/tools/lib32:/tools/libx32 \ 85 --target=$LFS_TGT \ 86 --disable-nls \ 87 --disable-werror \ 88 --enable-64-bit-bfd \ 89 --enable-multilib</userinput></screen> 81 90 82 91 <variablelist> … … 147 156 first pass will soon be replaced by those from the second.</para> 148 157 149 <para>If building on x86_64, create a symlink to ensure the sanity of 158 <para arch="default">If building on x86_64, create a symlink to ensure the 159 sanity of the toolchain:</para> 160 161 <para arch="multilib">Create a symlink to ensure the sanity of 150 162 the toolchain:</para> 151 163 152 <screen ><userinput remap="install">case $(uname -m) in164 <screen arch="default"><userinput remap="install">case $(uname -m) in 153 165 x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;; 154 166 esac</userinput></screen> 167 168 <screen arch="multilib"><userinput remap="install">mkdir -v /tools/lib && 169 ln -sv lib /tools/lib64</userinput></screen> 155 170 156 171 <para>Install the package:</para> -
chapter05/binutils-pass2.xml
r989524c rb3f1ebb3 51 51 <para>Prepare Binutils for compilation:</para> 52 52 53 <screen ><userinput remap="configure">CC=$LFS_TGT-gcc \53 <screen arch="default"><userinput remap="configure">CC=$LFS_TGT-gcc \ 54 54 AR=$LFS_TGT-ar \ 55 55 RANLIB=$LFS_TGT-ranlib \ … … 60 60 --with-lib-path=/tools/lib \ 61 61 --with-sysroot</userinput></screen> 62 63 <screen arch="multilib"><userinput remap="configure">CC=$LFS_TGT-gcc \ 64 AR=$LFS_TGT-ar \ 65 RANLIB=$LFS_TGT-ranlib \ 66 ../configure \ 67 --prefix=/tools \ 68 --disable-nls \ 69 --disable-werror \ 70 --with-lib-path=/tools/lib:/tools/lib32:/tools/libx32 \ 71 --with-sysroot \ 72 --enable-64-bit-bfd \ 73 --enable-multilib</userinput></screen> 62 74 63 75 <variablelist> … … 73 85 </varlistentry> 74 86 75 <varlistentry >87 <varlistentry arch="default"> 76 88 <term><parameter>--with-lib-path=/tools/lib</parameter></term> 77 89 <listitem> … … 79 91 search path during the compilation of Binutils, resulting in 80 92 <filename class="directory">/tools/lib</filename> being passed 93 to the linker. This prevents the linker from searching through 94 library directories on the host.</para> 95 </listitem> 96 </varlistentry> 97 98 <varlistentry arch="multilib"> 99 <term><parameter>--with-lib-path=/tools/lib:...</parameter></term> 100 <listitem> 101 <para>This tells the configure script to specify the library 102 search path during the compilation of Binutils, resulting in 103 <filename class="directory">/tools/lib</filename>, 104 <filename class="directory">/tools/lib32</filename> and 105 <filename class="directory">/tools/libx32</filename> being passed 81 106 to the linker. This prevents the linker from searching through 82 107 library directories on the host.</para> … … 94 119 </varlistentry> 95 120 121 <varlistentry arch="multilib"> 122 <term><parameter>--enable-64-bit-bfd</parameter></term> 123 <listitem> 124 <para>TODO</para> 125 </listitem> 126 </varlistentry> 127 128 <varlistentry arch="multilib"> 129 <term><parameter>--enable-multilib</parameter></term> 130 <listitem> 131 <para>TODO</para> 132 </listitem> 133 </varlistentry> 134 96 135 </variablelist> 97 136 … … 107 146 the next chapter:</para> 108 147 109 <screen ><userinput remap="adjust">make -C ld clean148 <screen arch="default"><userinput remap="adjust">make -C ld clean 110 149 make -C ld LIB_PATH=/usr/lib:/lib 150 cp -v ld/ld-new /tools/bin</userinput></screen> 151 152 <screen arch="multilib"><userinput remap="adjust">make -C ld clean 153 make -C ld LIB_PATH=/usr/lib:/lib:/usr/lib32:/lib32:/usr/libx32:/libx32 111 154 cp -v ld/ld-new /tools/bin</userinput></screen> 112 155 -
chapter05/chapter05.xml
r989524c rb3f1ebb3 21 21 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libstdc++.xml"/> 22 22 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils-pass2.xml"/> 23 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zlib.xml"/> 23 24 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass2.xml"/> 24 25 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tcl.xml"/> -
chapter05/gcc-pass1.xml
r989524c rb3f1ebb3 44 44 <title>Installation of Cross GCC</title> 45 45 46 <para>GCC now requires the GMP, MPFR and MPC packages. As these packages may 47 not be included in your host distribution, they will be built with 48 GCC. Unpack each package into the GCC source directory and rename the 49 resulting directories so the GCC build procedures will automatically 50 use them:</para> 46 <para arch="default">GCC now requires the GMP, MPFR, and MPC packages. As 47 these packages may not be included in your host distribution, they will be 48 built with GCC. Unpack each package into the GCC source directory and 49 rename the resulting directories so the GCC build procedures will 50 automatically use them:</para> 51 52 <para arch="multilib">GCC now requires the GMP, ISL, MPFR, and MPC packages. 53 As these packages may not be included in your host distribution, they will 54 be built with GCC. Unpack each package into the GCC source directory and 55 rename the resulting directories so the GCC build procedures will 56 automatically use them:</para> 51 57 52 58 <note><para>There are frequent misunderstandings about this chapter. The … … 56 62 proceed with the instructions below.</para></note> 57 63 58 <screen ><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz64 <screen arch="default"><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz 59 65 mv -v mpfr-&mpfr-version; mpfr 60 66 tar -xf ../gmp-&gmp-version;.tar.xz … … 62 68 tar -xf ../mpc-&mpc-version;.tar.gz 63 69 mv -v mpc-&mpc-version; mpc</userinput></screen> 70 <screen arch="multilib"><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz 71 mv -v mpfr-&mpfr-version; mpfr 72 tar -xf ../gmp-&gmp-version;.tar.xz 73 mv -v gmp-&gmp-version; gmp 74 tar -xf ../mpc-&mpc-version;.tar.gz 75 mv -v mpc-&mpc-version; mpc 76 tar -xf ../isl-&isl-version;.tar.xz 77 mv -v isl-&isl-version; isl</userinput></screen> 64 78 65 79 <para>The following command will change the location of GCC's default … … 72 86 do 73 87 cp -uv $file{,.orig} 74 sed -e 's@/lib\(64\)\?\(32\)\? /ld@/tools&@g' \88 sed -e 's@/lib\(64\)\?\(32\)\?\(x32\)\?/ld@/tools&@g' \ 75 89 -e 's@/usr@/tools@g' $file.orig > $file 76 90 echo ' … … 98 112 inadvertently run twice.</para> 99 113 100 <para >Finally, on x86_64 hosts, set the default directory name for101 64-bit libraries to <quote>lib</quote>:</para>102 103 <screen ><userinput remap="pre">case $(uname -m) in114 <para arch="default">Finally, on x86_64 hosts, set the default directory 115 name for 64-bit libraries to <quote>lib</quote>:</para> 116 117 <screen arch="default"><userinput remap="pre">case $(uname -m) in 104 118 x86_64) 105 119 sed -e '/m64=/s/lib64/lib/' \ … … 108 122 esac</userinput></screen> 109 123 124 <screen arch="multilib"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \ 125 -i.orig gcc/config/i386/t-linux64 126 cat > gcc/config/i386/t-linux64 <<"EOF" 127 comma=, 128 MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) 129 MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) 130 MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu) 131 MULTILIB_OSDIRNAMES+= m32=../lib32$(call if_multiarch,:i386-linux-gnu) 132 MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) 133 EOF</userinput></screen> 134 110 135 <!-- 111 136 <para>GCC doesn't detect stack protection correctly, which causes problems … … 121 146 <screen><userinput remap="pre">sed -i 's/if \((code.*))\)/if (\1 \&\& \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen> 122 147 --> 148 149 <!-- Following patch might be obsolete with gcc >= 8.2.1 --> 150 <!-- see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86724 --> 151 <!-- Fix applied in ch5-gcc-pass{1,2}, ch6-gcc --> 152 <para arch="multilib">Fix an issue with isl-&isl-version;:</para> 153 154 <screen arch="multilib"><userinput remap="pre">sed -e "/#include <isl\/schedule_node.h>/ a#include <isl/id.h>\n#include <isl/space.h>" \ 155 -i gcc/graphite.h</userinput></screen> 156 123 157 <para>The GCC documentation recommends building GCC 124 158 in a dedicated build directory:</para> … … 129 163 <para>Prepare GCC for compilation:</para> 130 164 131 <screen ><userinput remap="configure">../configure \165 <screen arch="default"><userinput remap="configure">../configure \ 132 166 --target=$LFS_TGT \ 133 167 --prefix=/tools \ … … 151 185 --disable-libstdcxx \ 152 186 --enable-languages=c,c++</userinput></screen> 187 188 <screen arch="multilib"><userinput remap="configure">../configure \ 189 --target=$LFS_TGT \ 190 --prefix=/tools \ 191 --with-glibc-version=2.11 \ 192 --with-sysroot=$LFS \ 193 --with-newlib \ 194 --without-headers \ 195 --with-local-prefix=/tools \ 196 --with-native-system-header-dir=/tools/include \ 197 --disable-nls \ 198 --disable-shared \ 199 --enable-multilib \ 200 --with-multilib-list=m32,m64,mx32 \ 201 --disable-decimal-float \ 202 --disable-threads \ 203 --disable-libatomic \ 204 --disable-libgomp \ 205 --disable-libmpx \ 206 --disable-libquadmath \ 207 --disable-libssp \ 208 --disable-libvtv \ 209 --disable-libstdcxx \ 210 --enable-languages=c,c++</userinput></screen> 211 153 212 <variablelist> 154 213 <title>The meaning of the configure options:</title> … … 220 279 </varlistentry> 221 280 222 <varlistentry >281 <varlistentry arch="default"> 223 282 <term><parameter>--disable-multilib</parameter></term> 224 283 <listitem> 225 284 <para>On x86_64, LFS does not yet support a multilib configuration. 226 285 This switch is harmless for x86.</para> 286 </listitem> 287 </varlistentry> 288 289 <varlistentry arch="multilib"> 290 <term><parameter>--enable-multilib, 291 --with-multilib-list=m32,m64,mx32</parameter></term> 292 <listitem> 293 <para>LFS now supports a multilib configuration. Enable it for the 294 32bit, the 64-bit, and the mixed mode.</para> 227 295 </listitem> 228 296 </varlistentry> -
chapter05/gcc-pass2.xml
r989524c rb3f1ebb3 74 74 do 75 75 cp -uv $file{,.orig} 76 sed -e 's@/lib\(64\)\?\(32\)\? /ld@/tools&@g' \76 sed -e 's@/lib\(64\)\?\(32\)\?\(x32\)\?/ld@/tools&@g' \ 77 77 -e 's@/usr@/tools@g' $file.orig > $file 78 78 echo ' … … 84 84 done</userinput></screen> 85 85 86 <para >If building on x86_64, change the default directory name for 64-bit87 libraries to <quote>lib</quote>:</para>88 89 <screen ><userinput remap="pre">case $(uname -m) in86 <para arch="default">If building on x86_64, change the default directory 87 name for 64-bit libraries to <quote>lib</quote>:</para> 88 89 <screen arch="default"><userinput remap="pre">case $(uname -m) in 90 90 x86_64) 91 91 sed -e '/m64=/s/lib64/lib/' \ … … 94 94 esac</userinput></screen> 95 95 96 <para>As in the first build of GCC it requires the GMP, MPFR and MPC 97 packages. Unpack the tarballs and move them into the required directory 98 names:</para> 99 100 <screen><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz 96 <para arch="multilib">Change the default directory name for 64-bit 97 libraries to <quote>lib</quote>:</para> 98 99 <screen arch="multilib"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \ 100 -i.orig gcc/config/i386/t-linux64 101 cat > gcc/config/i386/t-linux64 <<"EOF" 102 comma=, 103 MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) 104 MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) 105 MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu) 106 MULTILIB_OSDIRNAMES+= m32=../lib32$(call if_multiarch,:i386-linux-gnu) 107 MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32) 108 EOF</userinput></screen> 109 110 <para arch="default">As in the first build of GCC it requires the GMP, 111 MPFR, and MPC packages. Unpack the tarballs and move them into the 112 required directory names:</para> 113 114 <para arch="multilib">As in the first build of GCC it requires the GMP, 115 ISL, MPFR, and MPC packages. Unpack the tarballs and move them into the 116 required directory names:</para> 117 118 <screen arch="default"><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz 101 119 mv -v mpfr-&mpfr-version; mpfr 102 120 tar -xf ../gmp-&gmp-version;.tar.xz … … 104 122 tar -xf ../mpc-&mpc-version;.tar.gz 105 123 mv -v mpc-&mpc-version; mpc</userinput></screen> 106 <!-- 107 <para>As in the first build of GCC, fix a problem identified upstream:</para> 108 109 <screen><userinput remap="pre">sed -i 's/if \((code.*))\)/if (\1 \&\& \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen> 110 --> 124 <screen arch="multilib"><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz 125 mv -v mpfr-&mpfr-version; mpfr 126 tar -xf ../gmp-&gmp-version;.tar.xz 127 mv -v gmp-&gmp-version; gmp 128 tar -xf ../mpc-&mpc-version;.tar.gz 129 mv -v mpc-&mpc-version; mpc 130 tar -xf ../isl-&isl-version;.tar.xz 131 mv -v isl-&isl-version; isl</userinput></screen> 132 133 <!-- Following patch might be obsolete with gcc >= 8.2.1 --> 134 <para arch="multilib">Fix an issue with isl-&isl-version;:</para> 135 136 <screen arch="multilib"><userinput remap="pre">sed -e "/#include <isl\/schedule_node.h>/ a#include <isl/id.h>\n#include <isl/space.h>" \ 137 -i gcc/graphite.h</userinput></screen> 138 111 139 <para>Create a separate build directory again:</para> 112 140 … … 119 147 <para>Now prepare GCC for compilation:</para> 120 148 121 <screen ><userinput remap="configure">CC=$LFS_TGT-gcc \149 <screen arch="default"><userinput remap="configure">CC=$LFS_TGT-gcc \ 122 150 CXX=$LFS_TGT-g++ \ 123 151 AR=$LFS_TGT-ar \ … … 130 158 --disable-libstdcxx-pch \ 131 159 --disable-multilib \ 160 --disable-bootstrap \ 161 --disable-libgomp</userinput></screen> 162 163 <screen arch="multilib"><userinput remap="configure">CC=$LFS_TGT-gcc \ 164 CXX=$LFS_TGT-g++ \ 165 AR=$LFS_TGT-ar \ 166 RANLIB=$LFS_TGT-ranlib \ 167 ../configure \ 168 --prefix=/tools \ 169 --with-local-prefix=/tools \ 170 --with-native-system-header-dir=/tools/include \ 171 --enable-languages=c,c++ \ 172 --disable-libstdcxx-pch \ 173 --enable-multilib \ 174 --with-multilib-list=m32,m64,mx32 \ 175 --with-system-zlib \ 132 176 --disable-bootstrap \ 133 177 --disable-libgomp</userinput></screen> … … 200 244 <screen><computeroutput>[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]</computeroutput></screen> 201 245 202 <para>Note that the dynamic linker will be /tools/lib/ld-linux.so.2 203 for 32-bit machines.</para> 246 247 <para arch="multilib">Repeat the test for 32-bit:</para> 248 249 <screen arch="multilib"><userinput>cc -m32 dummy.c 250 readelf -l a.out | grep ': /tools'</userinput></screen> 251 252 <para arch="multilib">In this case, the output shoud be:</para> 253 254 <screen arch="multilib"><computeroutput>[Requesting program interpreter: /tools/lib/ld-linux.so.2]</computeroutput></screen> 255 256 <para arch="multilib">Repeat the test for x32-bit:</para> 257 258 <screen arch="multilib"><userinput>cc -mx32 dummy.c 259 readelf -l a.out | grep ': /tools'</userinput></screen> 260 261 <para arch="multilib">In this case, the output shoud be:</para> 262 263 <screen arch="multilib"><computeroutput>[Requesting program interpreter: /tools/lib/ld-linux-x32.so.2]</computeroutput></screen> 264 265 <para arch="default">Note that the dynamic linker will be 266 /tools/lib/ld-linux.so.2 for 32-bit machines.</para> 204 267 205 268 <para>If the output is not shown as above or there was no output at all, -
chapter05/glibc.xml
r989524c rb3f1ebb3 83 83 </varlistentry> 84 84 85 <varlistentry arch="multilib"> 86 <term><parameter>--enable-multi-arch</parameter></term> 87 <listitem> 88 <para>Enables glibc for multiarch environments.</para> 89 </listitem> 90 </varlistentry> 91 85 92 <varlistentry> 86 93 <term><parameter>--with-headers=/tools/include</parameter></term> … … 185 192 </sect2> 186 193 194 <sect2 arch="multilib" role="installation"> 195 <title>Installation of Glibc 32-bit</title> 196 197 <para>Clean the build directory for redoing glibc for 32-bit:</para> 198 <screen><userinput remap="pre">mkdir ../build32 199 cd ../build32</userinput></screen> 200 201 <para>Rebuild glibc for 32-bit:</para> 202 <screen><userinput remap="configure">echo slibdir=/tools/lib32 > configparms 203 BUILD_CC="gcc -m32" \ 204 CC="${LFS_TGT}-gcc -m32" \ 205 CXX="${LFS_TGT}-g++ -m32" \ 206 AR="${LFS_TGT}-ar" \ 207 RANLIB="${LFS_TGT}-ranlib" \ 208 ../configure --prefix=/tools \ 209 --build=$(../scripts/config.guess) \ 210 --host=${LFS_TGT32} \ 211 --enable-kernel=&min-kernel; \ 212 --enable-multi-arch \ 213 --libdir=/tools/lib32 \ 214 --libexecdir=/tools/lib32 \ 215 --with-headers=/tools/include \ 216 --with-binutils=/tools/bin \ 217 libc_cv_forced_unwind=yes \ 218 libc_cv_c_cleanup=yes</userinput></screen> 219 220 <para>Now compile the 32-bit version of glibc:</para> 221 <screen><userinput remap="make">make</userinput></screen> 222 223 <para>Install 32-bit version of glibc:</para> 224 <screen><userinput remap="install">make install_root="${PWD}/DESTDIR" install 225 install -vdm755 /tools/lib32 226 cp -Rv DESTDIR/tools/lib32/* /tools/lib32 227 install -vm644 DESTDIR/tools/include/gnu/{lib-names,stubs}-32.h \ 228 /tools/include/gnu/ 229 ln -svf /tools/lib32/ld-linux.so.2 /tools/lib/ 230 cd ..</userinput></screen> 231 232 </sect2> 233 234 <sect2 arch="multilib" role="installation"> 235 <title>Installation of Glibc x32-bit</title> 236 237 <para>Create a build directory for redoing glibc for x32-bit:</para> 238 <screen><userinput remap="pre">mkdir build32x 239 cd build32x</userinput></screen> 240 241 <para>Rebuild glibc for x32-bit:</para> 242 <screen><userinput remap="configure">echo slibdir=/tools/libx32 > configparms 243 BUILD_CC="gcc -mx32" \ 244 CC="${LFS_TGT}-gcc -mx32" \ 245 CXX="${LFS_TGT}-g++ -mx32" \ 246 AR="${LFS_TGT}-ar" \ 247 RANLIB="${LFS_TGT}-ranlib" \ 248 ../configure --prefix=/tools \ 249 --build=$(../scripts/config.guess) \ 250 --host=${LFS_TGTX32} \ 251 --enable-kernel=&min-kernel; \ 252 --enable-multi-arch \ 253 --libdir=/tools/libx32 \ 254 --libexecdir=/tools/libx32 \ 255 --with-headers=/tools/include \ 256 --with-binutils=/tools/bin \ 257 libc_cv_forced_unwind=yes \ 258 libc_cv_c_cleanup=yes</userinput></screen> 259 260 <para>Now compile the x32-bit version of glibc:</para> 261 <screen><userinput remap="make">make</userinput></screen> 262 263 <para>Install x32-bit version of glibc:</para> 264 <screen><userinput remap="install">make install_root="${PWD}/DESTDIR" install 265 install -vdm755 /tools/libx32 266 cp -Rv DESTDIR/tools/libx32/* /tools/libx32 267 install -vm644 DESTDIR/tools/include/gnu/lib-names-x32.h \ 268 /tools/include/gnu/ 269 [ -e DESTDIR/tools/include/gnu/stubs-x32.h ] \ 270 && install -vm644 DESTDIR/tools/include/gnu/stubs-x32.h /tools/include/gnu/ \ 271 || ln -v /tools/include/gnu/stubs-64.h /tools/include/gnu/stubs-x32.h 272 ln -svf /tools/libx32/ld-linux-x32.so.2 /tools/lib/</userinput></screen> 273 <!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is 274 just a "brute force" workaraound - by copying the stubs-64.h file. --> 275 276 <caution> 277 <para>At this point, it is imperative to stop and ensure that the basic 278 functions (compiling and linking) of the new toolchain are working as 279 expected. To perform a sanity check, run the following commands:</para> 280 281 <screen><userinput>echo 'int main(){}' > dummy.c 282 $LFS_TGT-gcc -m32 dummy.c 283 readelf -l a.out | grep ': /tools'</userinput></screen> 284 285 <para>If everything is working correctly, there should be no errors, 286 and the output of the last command will be of the form:</para> 287 288 <screen><computeroutput>[Requesting program interpreter: /tools/lib/ld-linux.so.2]</computeroutput></screen> 289 290 <para>Redo test for x32-ABI:</para> 291 292 <screen><userinput>echo 'int main(){}' > dummy.c 293 $LFS_TGT-gcc -mx32 dummy.c 294 readelf -l a.out | grep ': /tools'</userinput></screen> 295 296 <para>Output should be like:</para> 297 298 <screen><computeroutput>[Requesting program interpreter: /tools/lib/ld-linux-x32.so.2]</computeroutput></screen> 299 300 <para>If the output is not shown as above or there was no output at all, 301 then something is wrong. Investigate and retrace the steps to find out 302 where the problem is and correct it. This issue must be resolved before 303 continuing on.</para> 304 305 <para>Once all is well, clean up the test files:</para> 306 307 <screen><userinput>rm -v dummy.c a.out</userinput></screen> 308 309 </caution> 310 </sect2> 311 187 312 <sect2 role="content"> 188 313 <title/> -
chapter05/ncurses.xml
r989524c rb3f1ebb3 113 113 </sect2> 114 114 115 <sect2 arch="multilib" role="installation"> 116 <title>Installation of Ncurses - 32 bit</title> 117 118 <para>Prepare Ncurses for compilation:</para> 119 120 <screen><userinput remap="configure">make distclean && 121 CC="${LFS_TGT}-gcc -m32" \ 122 ./configure --prefix=/tools \ 123 --libdir=/tools/lib32 \ 124 --with-shared \ 125 --without-debug \ 126 --without-ada \ 127 --enable-widec \ 128 --enable-overwrite \ 129 --host="${LFS_TGT32}"</userinput></screen> 130 131 <para>Compile the package:</para> 132 133 <screen><userinput remap="make">make</userinput></screen> 134 135 <para>To test the results, issue:</para> 136 137 <screen><userinput remap="test">make check</userinput></screen> 138 139 <para>Install the package:</para> 140 141 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR_32 install && 142 cp -Rv DESTDIR_32/tools/lib32/* /tools/lib32</userinput></screen> 143 144 </sect2> 145 146 <sect2 arch="multilib" role="installation"> 147 <title>Installation of Ncurses - x32 bit</title> 148 149 <para>Repeat for the x32-ABI:</para> 150 151 <screen><userinput remap="configure">make distclean && 152 CC="${LFS_TGT}-gcc -mx32" \ 153 ./configure --prefix=/tools \ 154 --libdir=/tools/libx32 \ 155 --with-shared \ 156 --without-debug \ 157 --without-ada \ 158 --enable-widec \ 159 --enable-overwrite \ 160 --host="${LFS_TGTX32}"</userinput></screen> 161 162 <screen><userinput remap="make">make</userinput></screen> 163 164 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR_x32 install && 165 cp -Rv DESTDIR_x32/tools/libx32/* /tools/libx32</userinput></screen> 166 167 </sect2> 168 115 169 <sect2 role="content"> 116 170 <title/> -
chapter05/stripping.xml
r989524c rb3f1ebb3 16 16 debugging symbols. Remove those symbols with:</para> 17 17 18 <screen><userinput>strip --strip-debug /tools/lib/* 18 <screen arch="default"><userinput>strip --strip-debug /tools/lib/* 19 /usr/bin/strip --strip-unneeded /tools/{,s}bin/*</userinput></screen> 20 21 <screen arch="multilib"><userinput>strip --strip-debug /tools/lib{,{,x}32}/* 19 22 /usr/bin/strip --strip-unneeded /tools/{,s}bin/*</userinput></screen> 20 23 … … 34 37 <para>Remove unneeded files:</para> 35 38 36 <screen><userinput>find /tools/{lib,libexec} -name \*.la -delete</userinput></screen> 39 <screen arch="default"><userinput>find /tools/{lib,libexec} -name \*.la -delete</userinput></screen> 40 41 <screen arch="multilib"><userinput>find /tools/{lib{,{,x}32},libexec} -name \*.la -delete</userinput></screen> 37 42 38 43 <para>At this point, you should have at least 3 GB of free space in -
chapter05/util-linux.xml
r989524c rb3f1ebb3 122 122 </sect2> 123 123 124 <sect2 arch="multilib" role="installation"> 125 <title>Installation of Util-Linux - 32 bit</title> 126 127 <para>Prepare Util-Linux for compilation:</para> 128 129 <screen><userinput remap="configure">make distclean && 130 CC="${LFS_TGT}-gcc -m32" \ 131 ./configure \ 132 --prefix=/tools \ 133 --libdir=/tools/lib32 \ 134 --without-python \ 135 --disable-makeinstall-chown \ 136 --without-systemdsystemunitdir \ 137 --without-ncurses \ 138 --host="${LFS_TGT32}" \ 139 PKG_CONFIG=""</userinput></screen> 140 141 <para>Compile the package:</para> 142 143 <screen><userinput remap="make">make</userinput></screen> 144 145 <para>To test the results, issue:</para> 146 147 <screen><userinput remap="test">make check</userinput></screen> 148 149 <para>Install the package:</para> 150 151 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR_32 install && 152 cp -Rv DESTDIR_32/tools/lib32/* /tools/lib32</userinput></screen> 153 154 </sect2> 155 156 <sect2 arch="multilib" role="installation"> 157 <title>Installation of Util-Linux - x32 bit</title> 158 159 <para>Repeat for the x32-ABI:</para> 160 161 <screen><userinput remap="configure">make distclean && 162 CC="${LFS_TGT}-gcc -mx32" \ 163 ./configure \ 164 --prefix=/tools \ 165 --libdir=/tools/libx32 \ 166 --without-python \ 167 --disable-makeinstall-chown \ 168 --without-systemdsystemunitdir \ 169 --without-ncurses \ 170 --host="${LFS_TGTX32}" \ 171 PKG_CONFIG=""</userinput></screen> 172 173 <screen><userinput remap="make">make</userinput></screen> 174 175 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR_x32 install && 176 cp -Rv DESTDIR_x32/tools/libx32/* /tools/libx32</userinput></screen> 177 178 </sect2> 179 124 180 </sect1> -
chapter05/xz.xml
r989524c rb3f1ebb3 64 64 </sect2> 65 65 66 <sect2 arch="multilib" role="installation"> 67 <title>Installation of Xz - 32 bit</title> 68 69 <para>Prepare Xz for compilation:</para> 70 71 <screen><userinput remap="configure">make distclean && 72 CC="${LFS_TGT}-gcc -m32" \ 73 ./configure \ 74 --prefix=/tools \ 75 --libdir=/tools/lib32 \ 76 --host="${LFS_TGT32}"</userinput></screen> 77 78 <para>Compile the package:</para> 79 80 <screen><userinput remap="make">make</userinput></screen> 81 82 <para>To test the results, issue:</para> 83 84 <screen><userinput remap="test">make check</userinput></screen> 85 86 <para>Install the package:</para> 87 88 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR_32 install && 89 cp -Rv DESTDIR_32/tools/lib32/* /tools/lib32</userinput></screen> 90 91 </sect2> 92 93 <sect2 arch="multilib" role="installation"> 94 <title>Installation of Xz - x32 bit</title> 95 96 <para>Repeat for the x32-ABI:</para> 97 98 <screen><userinput remap="configure">make distclean && 99 CC="${LFS_TGT}-gcc -mx32" \ 100 ./configure \ 101 --prefix=/tools \ 102 --libdir=/tools/libx32 \ 103 --host="${LFS_TGTX32}"</userinput></screen> 104 105 <screen><userinput remap="make">make</userinput></screen> 106 107 <screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR_x32 install && 108 cp -Rv DESTDIR_x32/tools/libx32/* /tools/libx32</userinput></screen> 109 110 </sect2> 111 66 112 <sect2 role="content"> 67 113 <title/>
Note:
See TracChangeset
for help on using the changeset viewer.