- Timestamp:
- 03/02/2022 01:15:18 PM (2 years ago)
- Branches:
- xry111/clfs-ng
- Children:
- 727617d
- Parents:
- a5da281 (diff), 6cad449 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/gcc-pass2.xml
ra5da281 r964103c 63 63 -i.orig gcc/config/i386/t-linux64</userinput></screen> 64 64 65 <!-- 66 <para>Fix an issue with GCC-10.1 when building with a cross 67 compiler:</para> 65 <!-- https://gcc.gnu.org/PR100017 --> 66 <para>Fix an issue causing failure cross-compiling libstdc++:</para> 68 67 69 <screen><userinput remap="pre">patch -Np1 -i ../&gcc-cross-patch;</userinput></screen> 70 --> 68 <screen><userinput remap="pre">sed 's/gnu++17/& -nostdinc++/' \ 69 -i libstdc++-v3/src/c++17/Makefile.in</userinput></screen> 70 71 <para>Override the building rule of libgcc and libstdc++ headers, to 72 allow building these libraries with POSIX threads support:</para> 73 74 <screen><userinput remap="pre">sed '/thread_header =/s/@.*@/gthr-posix.h/' \ 75 -i libgcc/Makefile.in libstdc++-v3/include/Makefile.in</userinput></screen> 76 71 77 <para>Create a separate build directory again:</para> 72 78 73 79 <screen><userinput remap="pre">mkdir -v build 74 80 cd build</userinput></screen> 75 76 <para>Create a symlink that allows libgcc to be built with posix threads77 support:</para>78 79 <screen><userinput remap="pre">mkdir -pv $LFS_TGT/libgcc80 ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h</userinput></screen>81 81 82 82 <para>Before starting to build GCC, remember to unset any environment … … 88 88 --build=$(../config.guess) \ 89 89 --host=$LFS_TGT \ 90 --target=$LFS_TGT \ 91 LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \ 90 92 --prefix=/usr \ 91 CC_FOR_TARGET=$LFS_TGT-gcc \92 93 --with-build-sysroot=$LFS \ 93 94 --enable-initfini-array \ … … 100 101 --disable-libssp \ 101 102 --disable-libvtv \ 102 --disable-libstdcxx \103 103 --enable-languages=c,c++</userinput></screen> 104 104 … … 107 107 108 108 <varlistentry> 109 <term><parameter>- with-build-sysroot=$LFS</parameter></term>109 <term><parameter>--with-build-sysroot=$LFS</parameter></term> 110 110 <listitem> 111 111 <para>Normally, using <parameter>--host</parameter> ensures that … … 116 116 needed to have them find the needed files in <filename 117 117 class="directory">$LFS</filename>, and not on the host.</para> 118 </listitem> 119 </varlistentry> 120 121 <varlistentry> 122 <term><parameter>--target=$LFS_TGT</parameter></term> 123 <listitem> 124 <para>As we are cross-compiling GCC, it's impossible to build 125 target libraries (<filename class="libraryfile">libgcc</filename> 126 and <filename class="libraryfile">libstdc++</filename>) with the 127 compiled GCC binaries because these binaries won't run on the 128 host distro. GCC building system will attempt to use the 129 C and C++ compilers on the host distro as a workaround by default. 130 It's not supported to build GCC target libraries with a different 131 version of GCC, so using host compilers may cause building 132 failure. This parameter ensures to build the libraries with GCC 133 pass 1 and prevent the issue.</para> 134 </listitem> 135 </varlistentry> 136 137 <varlistentry> 138 <term><parameter>LDFLAGS_FOR_TARGET=...</parameter></term> 139 <listitem> 140 <para>Allow <filename class="libraryfile">libstdc++</filename> to 141 use shared <filename class="libraryfile">libgcc</filename> being 142 built in this pass, instead of the static version built in GCC 143 pass 1. This is needed for supporting C++ exception 144 handling.</para> 118 145 </listitem> 119 146 </varlistentry>
Note:
See TracChangeset
for help on using the changeset viewer.