Ignore:
Timestamp:
04/01/2019 05:00:45 PM (5 years ago)
Author:
Thomas Trepl <thomas@…>
Branches:
multilib-10.1
Children:
7d9f881
Parents:
1fa2099
Message:

First apply of multilib-patch of April 1st, 2019

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@11566 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter05/gcc-pass2.xml

    r1fa2099 r8eb3fe4  
    7474do
    7575  cp -uv $file{,.orig}
    76   sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' \
     76  sed -e 's@/lib\(64\)\?\(32\)\?\(x32\)\?/ld@/tools&amp;@g' \
    7777      -e 's@/usr@/tools@g' $file.orig &gt; $file
    7878  echo '
     
    8484done</userinput></screen>
    8585
    86     <para>If building on x86_64, change the default directory name for 64-bit
    87     libraries to <quote>lib</quote>:</para>
    88 
    89 <screen><userinput remap="pre">case $(uname -m) in
     86    <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
    9090  x86_64)
    9191    sed -e '/m64=/s/lib64/lib/' \
     
    9494esac</userinput></screen>
    9595
    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
     101cat > gcc/config/i386/t-linux64 &lt;&lt;"EOF"
     102comma=,
     103MULTILIB_OPTIONS    = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
     104MULTILIB_DIRNAMES   = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
     105MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu)
     106MULTILIB_OSDIRNAMES+= m32=../lib32$(call if_multiarch,:i386-linux-gnu)
     107MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
     108EOF</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
    101119mv -v mpfr-&mpfr-version; mpfr
    102120tar -xf ../gmp-&gmp-version;.tar.xz
     
    104122tar -xf ../mpc-&mpc-version;.tar.gz
    105123mv -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 \&amp;\&amp; \!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
     125mv -v mpfr-&mpfr-version; mpfr
     126tar -xf ../gmp-&gmp-version;.tar.xz
     127mv -v gmp-&gmp-version; gmp
     128tar -xf ../mpc-&mpc-version;.tar.gz
     129mv -v mpc-&mpc-version; mpc
     130tar -xf ../isl-&isl-version;.tar.xz
     131mv -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 &lt;isl\/schedule_node.h&gt;/ a#include &lt;isl/id.h&gt;\n#include &lt;isl/space.h&gt;" \
     137    -i gcc/graphite.h</userinput></screen>
     138
    111139    <para>Create a separate build directory again:</para>
    112140
     
    119147    <para>Now prepare GCC for compilation:</para>
    120148
    121 <screen><userinput remap="configure">CC=$LFS_TGT-gcc                                    \
     149<screen arch="default"><userinput remap="configure">CC=$LFS_TGT-gcc                                    \
    122150CXX=$LFS_TGT-g++                                   \
    123151AR=$LFS_TGT-ar                                     \
     
    130158    --disable-libstdcxx-pch                        \
    131159    --disable-multilib                             \
     160    --disable-bootstrap                            \
     161    --disable-libgomp</userinput></screen>
     162
     163<screen arch="multilib"><userinput remap="configure">CC=$LFS_TGT-gcc                                    \
     164CXX=$LFS_TGT-g++                                   \
     165AR=$LFS_TGT-ar                                     \
     166RANLIB=$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                             \
    132176    --disable-bootstrap                            \
    133177    --disable-libgomp</userinput></screen>
     
    200244<screen><computeroutput>[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
    201245
    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
     250readelf -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
     259readelf -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>
    204267
    205268    <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.