Changeset d9bec1e for chapter06/gcc-pass2.xml
- Timestamp:
- 03/17/2022 02:28:37 PM (2 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/gcc-pass2.xml
r5ffa04b rd9bec1e 65 65 esac</userinput></screen> 66 66 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 68 68 libraries:</para> 69 69 … … 71 71 -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \ 72 72 -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/& -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 76 86 <para>Create a separate build directory again:</para> 77 87 78 88 <screen><userinput remap="pre">mkdir -v build 79 89 cd build</userinput></screen> 80 81 <para>Create a symlink that allows libgcc to be built with posix threads82 support:</para>83 84 <screen><userinput remap="pre">mkdir -pv $LFS_TGT/libgcc85 ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h</userinput></screen>86 90 87 91 <para>Before starting to build GCC, remember to unset any environment … … 93 97 --build=$(../config.guess) \ 94 98 --host=$LFS_TGT \ 99 --target=$LFS_TGT \ 100 LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \ 95 101 --prefix=/usr \ 96 CC_FOR_TARGET=$LFS_TGT-gcc \97 102 --with-build-sysroot=$LFS \ 98 103 --enable-initfini-array \ … … 105 110 --disable-libssp \ 106 111 --disable-libvtv \ 107 --disable-libstdcxx \108 112 --enable-languages=c,c++</userinput></screen> 109 113 <screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure" … … 133 137 134 138 <varlistentry> 135 <term><parameter>- with-build-sysroot=$LFS</parameter></term>139 <term><parameter>--with-build-sysroot=$LFS</parameter></term> 136 140 <listitem> 137 141 <para>Normally, using <parameter>--host</parameter> ensures that … … 146 150 147 151 <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> 148 179 <term><parameter>--enable-initfini-array</parameter></term> 149 180 <listitem>
Note:
See TracChangeset
for help on using the changeset viewer.