Changeset b3f1ebb3 for chapter05/gcc-pass2.xml
- Timestamp:
- 03/31/2021 10:41:31 AM (4 years ago)
- Branches:
- ml-11.0, multilib, xry111/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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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,
Note:
See TracChangeset
for help on using the changeset viewer.