Ignore:
Timestamp:
02/27/2022 03:36:55 PM (2 years ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
83c258f
Parents:
cbd0a9a
git-author:
Xi Ruoyao <xry111@…> (02/26/2022 05:09:05 PM)
git-committer:
Xi Ruoyao <xry111@…> (02/27/2022 03:36:55 PM)
Message:

fix GCC PR100017 and enable libstdc++ for pass 2

This is the issue preventing us from cross-compiling libstdc++ in
Chapter 6. By fixing this issue we can remove a seperate pass 2 for
libstdc++ and simplify the instruction.

The upstream fix will be released in 11.3 and 12.0, so we can remove the
first sed upgrading gcc next time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter06/gcc-pass2.xml

    rcbd0a9a r459d493  
    6363  ;;
    6464esac</userinput></screen>
    65 <!--
    66     <para>Fix an issue with GCC-10.1 when building with a cross
    67     compiler:</para>
    6865
    69 <screen><userinput remap="pre">patch -Np1 -i ../&gcc-cross-patch;</userinput></screen>
    70 -->
     66    <!-- https://gcc.gnu.org/PR100017 -->
     67    <para>Fix an issue causing failure cross-compiling libstdc++:</para>
     68
     69<screen><userinput remap="pre">sed 's/gnu++17/&amp; -nostdinc++/' \
     70    -i libstdc++-v3/src/c++17/Makefile.in</userinput></screen>
     71
     72    <para>Override the building rule of libgcc and libstdc++ headers, to
     73    allow building these libraries with POSIX threads support:</para>
     74
     75<screen><userinput remap="pre">sed '/thread_header =/s/@.*@/gthr-posix.h/' \
     76    -i libgcc/Makefile.in libstdc++-v3/include/Makefile.in</userinput></screen>
     77
    7178    <para>Create a separate build directory again:</para>
    7279
    7380<screen><userinput remap="pre">mkdir -v build
    7481cd       build</userinput></screen>
    75 
    76     <para>Create a symlink that allows libgcc to be built with posix threads
    77     support:</para>
    78 
    79 <screen><userinput remap="pre">mkdir -pv $LFS_TGT/libgcc
    80 ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h</userinput></screen>
    8182
    8283    <para>Before starting to build GCC, remember to unset any environment
     
    9091    --prefix=/usr                                  \
    9192    CC_FOR_TARGET=$LFS_TGT-gcc                     \
     93    CXX_FOR_TARGET=$LFS_TGT-g++                    \
     94    LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc      \
    9295    --with-build-sysroot=$LFS                      \
    9396    --enable-initfini-array                        \
     
    100103    --disable-libssp                               \
    101104    --disable-libvtv                               \
    102     --disable-libstdcxx                            \
    103105    --enable-languages=c,c++</userinput></screen>
    104106
Note: See TracChangeset for help on using the changeset viewer.