Ignore:
Timestamp:
03/17/2022 02:28:37 PM (2 years ago)
Author:
Thomas Trepl (Moody) <thomas@…>
Branches:
multilib
Children:
02c702c
Parents:
5ffa04b (diff), cc2c231 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Automatic merge of trunk into multilib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter06/gcc-pass2.xml

    r5ffa04b rd9bec1e  
    6565esac</userinput></screen>
    6666
    67     <para arch="ml_32,ml_x32,ml_all">Change the default directory name for
     67    <para arch="ml_32,ml_x32,ml_all">Change the default directory name for the
    6868    libraries:</para>
    6969
     
    7171    -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \
    7272    -i.orig gcc/config/i386/t-linux64</userinput></screen>
    73 <!--
    74 <screen><userinput remap="pre">patch -Np1 -i ../&gcc-cross-patch;</userinput></screen>
    75 -->
     73
     74    <!-- https://gcc.gnu.org/PR100017 -->
     75    <para>Fix an issue causing failure cross-compiling libstdc++:</para>
     76
     77<screen><userinput remap="pre">sed 's/gnu++17/&amp; -nostdinc++/' \
     78    -i libstdc++-v3/src/c++17/Makefile.in</userinput></screen>
     79
     80    <para>Override the building rule of libgcc and libstdc++ headers, to
     81    allow building these libraries with POSIX threads support:</para>
     82
     83<screen><userinput remap="pre">sed '/thread_header =/s/@.*@/gthr-posix.h/' \
     84    -i libgcc/Makefile.in libstdc++-v3/include/Makefile.in</userinput></screen>
     85
    7686    <para>Create a separate build directory again:</para>
    7787
    7888<screen><userinput remap="pre">mkdir -v build
    7989cd       build</userinput></screen>
    80 
    81     <para>Create a symlink that allows libgcc to be built with posix threads
    82     support:</para>
    83 
    84 <screen><userinput remap="pre">mkdir -pv $LFS_TGT/libgcc
    85 ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h</userinput></screen>
    8690
    8791    <para>Before starting to build GCC, remember to unset any environment
     
    9397    --build=$(../config.guess)                     \
    9498    --host=$LFS_TGT                                \
     99    --target=$LFS_TGT                              \
     100    LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc      \
    95101    --prefix=/usr                                  \
    96     CC_FOR_TARGET=$LFS_TGT-gcc                     \
    97102    --with-build-sysroot=$LFS                      \
    98103    --enable-initfini-array                        \
     
    105110    --disable-libssp                               \
    106111    --disable-libvtv                               \
    107     --disable-libstdcxx                            \
    108112    --enable-languages=c,c++</userinput></screen>
    109113<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure"
     
    133137
    134138      <varlistentry>
    135         <term><parameter>-with-build-sysroot=$LFS</parameter></term>
     139        <term><parameter>--with-build-sysroot=$LFS</parameter></term>
    136140        <listitem>
    137141          <para>Normally, using <parameter>--host</parameter> ensures that
     
    146150
    147151      <varlistentry>
     152        <term><parameter>--target=$LFS_TGT</parameter></term>
     153        <listitem>
     154          <para>As we are cross-compiling GCC, it's impossible to build
     155          target libraries (<filename class="libraryfile">libgcc</filename>
     156          and <filename class="libraryfile">libstdc++</filename>) with the
     157          compiled GCC binaries because these binaries won't run on the
     158          host distro.  GCC building system will attempt to use the
     159          C and C++ compilers on the host distro as a workaround by default.
     160          It's not supported to build GCC target libraries with a different
     161          version of GCC, so using host compilers may cause building
     162          failure.  This parameter ensures to build the libraries with GCC
     163          pass 1 and prevent the issue.</para>
     164        </listitem>
     165      </varlistentry>
     166
     167      <varlistentry>
     168        <term><parameter>LDFLAGS_FOR_TARGET=...</parameter></term>
     169        <listitem>
     170          <para>Allow <filename class="libraryfile">libstdc++</filename> to
     171          use shared <filename class="libraryfile">libgcc</filename> being
     172          built in this pass, instead of the static version built in GCC
     173          pass 1. This is needed for supporting C++ exception
     174          handling.</para>
     175        </listitem>
     176      </varlistentry>
     177
     178      <varlistentry>
    148179        <term><parameter>--enable-initfini-array</parameter></term>
    149180        <listitem>
Note: See TracChangeset for help on using the changeset viewer.