Changeset b39aae0
- Timestamp:
- 03/02/2022 01:04:45 PM (15 months ago)
- Branches:
- 11.2, 11.2-rc1, 11.3, 11.3-rc1, bdubbs/gcc13, multilib, s6-init, trunk, xry111/arm64, xry111/clfs-ng, xry111/glibc-2.37, xry111/kcfg-revise, xry111/pip3, xry111/queue-11.3, xry111/rust-wip-20221008
- Children:
- 6cad449
- Parents:
- fe09af0 (diff), 259b8e0 (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. - Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/libstdc++.xml
rfe09af0 rb39aae0 6 6 ]> 7 7 8 <sect1 id="ch-tools-libstdcpp -pass1" role="wrap">9 <?dbhtml filename="gcc-libstdc++ -pass1.html"?>8 <sect1 id="ch-tools-libstdcpp" role="wrap"> 9 <?dbhtml filename="gcc-libstdc++.html"?> 10 10 11 11 <sect1info condition="script"> … … 15 15 </sect1info> 16 16 17 <title>Libstdc++ from GCC-&gcc-version; , Pass 1</title>17 <title>Libstdc++ from GCC-&gcc-version;</title> 18 18 19 <indexterm zone="ch-tools-libstdcpp -pass1">19 <indexterm zone="ch-tools-libstdcpp"> 20 20 <primary sortas="a-GCC">GCC</primary> 21 21 <secondary>tools, libstdc++ pass 1</secondary> -
chapter06/gcc-pass2.xml
rfe09af0 rb39aae0 63 63 ;; 64 64 esac</userinput></screen> 65 <!--66 <para>Fix an issue with GCC-10.1 when building with a cross67 compiler:</para>68 65 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/& -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 71 78 <para>Create a separate build directory again:</para> 72 79 73 80 <screen><userinput remap="pre">mkdir -v build 74 81 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 82 82 83 <para>Before starting to build GCC, remember to unset any environment … … 88 89 --build=$(../config.guess) \ 89 90 --host=$LFS_TGT \ 91 --target=$LFS_TGT \ 92 LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \ 90 93 --prefix=/usr \ 91 CC_FOR_TARGET=$LFS_TGT-gcc \92 94 --with-build-sysroot=$LFS \ 93 95 --enable-initfini-array \ … … 100 102 --disable-libssp \ 101 103 --disable-libvtv \ 102 --disable-libstdcxx \103 104 --enable-languages=c,c++</userinput></screen> 104 105 … … 107 108 108 109 <varlistentry> 109 <term><parameter>- with-build-sysroot=$LFS</parameter></term>110 <term><parameter>--with-build-sysroot=$LFS</parameter></term> 110 111 <listitem> 111 112 <para>Normally, using <parameter>--host</parameter> ensures that … … 116 117 needed to have them find the needed files in <filename 117 118 class="directory">$LFS</filename>, and not on the host.</para> 119 </listitem> 120 </varlistentry> 121 122 <varlistentry> 123 <term><parameter>--target=$LFS_TGT</parameter></term> 124 <listitem> 125 <para>As we are cross-compiling GCC, it's impossible to build 126 target libraries (<filename class="libraryfile">libgcc</filename> 127 and <filename class="libraryfile">libstdc++</filename>) with the 128 compiled GCC binaries because these binaries won't run on the 129 host distro. GCC building system will attempt to use the 130 C and C++ compilers on the host distro as a workaround by default. 131 It's not supported to build GCC target libraries with a different 132 version of GCC, so using host compilers may cause building 133 failure. This parameter ensures to build the libraries with GCC 134 pass 1 and prevent the issue.</para> 135 </listitem> 136 </varlistentry> 137 138 <varlistentry> 139 <term><parameter>LDFLAGS_FOR_TARGET=...</parameter></term> 140 <listitem> 141 <para>Allow <filename class="libraryfile">libstdc++</filename> to 142 use shared <filename class="libraryfile">libgcc</filename> being 143 built in this pass, instead of the static version built in GCC 144 pass 1. This is needed for supporting C++ exception 145 handling.</para> 118 146 </listitem> 119 147 </varlistentry> -
chapter07/chapter07.xml
rfe09af0 rb39aae0 18 18 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingdirs.xml"/> 19 19 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="createfiles.xml"/> 20 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libstdc++-pass2.xml"/>21 20 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gettext.xml"/> 22 21 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bison.xml"/> -
chapter08/gcc.xml
rfe09af0 rb39aae0 198 198 some sanity checks:</para> 199 199 200 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 201 href="adjusting.xml" 202 xpointer="xpointer(//*[@os='a'])"/> 203 204 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 205 href="adjusting.xml" 206 xpointer="xpointer(//*[@os='b'])"/> 207 208 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 209 href="adjusting.xml" 210 xpointer="xpointer(//*[@os='c'])"/> 211 212 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 213 href="adjusting.xml" 214 xpointer="xpointer(//*[@os='d'])"/> 215 216 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 217 href="adjusting.xml" 218 xpointer="xpointer(//*[@os='e'])"/> 219 220 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 221 href="adjusting.xml" 222 xpointer="xpointer(//*[@os='f'])"/> 200 <screen><userinput>echo 'int main(){}' > dummy.c 201 cc dummy.c -v -Wl,--verbose &> dummy.log 202 readelf -l a.out | grep ': /lib'</userinput></screen> 203 204 <para>There should be no errors, 205 and the output of the last command will be (allowing for 206 platform-specific differences in the dynamic linker name):</para> 207 208 <screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen> 209 210 <para>Now make sure that we're setup to use the correct start files:</para> 211 212 <screen><userinput>grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log</userinput></screen> 213 214 <para>The output of the last command should be:</para> 223 215 224 216 <screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded … … 233 225 <filename class="directory">/usr/lib</filename> directory.</para> 234 226 235 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 236 href="adjusting.xml" 237 xpointer="xpointer(//*[@os='g'])"/> 227 <para>Verify that the compiler is searching for the correct header 228 files:</para> 238 229 239 230 <screen><userinput>grep -B4 '^ /usr/include' dummy.log</userinput></screen> 240 231 241 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 242 href="adjusting.xml" 243 xpointer="xpointer(//*[@os='h'])"/> 232 <para>This command should return the following output:</para> 244 233 245 234 <screen><computeroutput>#include <...> search starts here: … … 252 241 different than the above, depending on your system architecture.</para> 253 242 254 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 255 href="adjusting.xml" 256 xpointer="xpointer(//*[@os='i'])"/> 257 258 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 259 href="adjusting.xml" 260 xpointer="xpointer(//*[@os='j'])"/> 261 262 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 263 href="adjusting.xml" 264 xpointer="xpointer(//*[@os='k'])"/> 243 <para>Next, verify that the new linker is being used with the correct search paths:</para> 244 245 <screen><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen> 246 247 <para>References to paths that have components with '-linux-gnu' should 248 be ignored, but otherwise the output of the last command should be:</para> 265 249 266 250 <screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64") … … 285 269 SEARCH_DIR("/usr/lib");</computeroutput></screen> 286 270 287 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 288 href="adjusting.xml" 289 xpointer="xpointer(//*[@os='l'])"/> 290 291 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 292 href="adjusting.xml" 293 xpointer="xpointer(//*[@os='m'])"/> 294 295 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 296 href="adjusting.xml" 297 xpointer="xpointer(//*[@os='n'])"/> 298 299 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 300 href="adjusting.xml" 301 xpointer="xpointer(//*[@os='o'])"/> 302 303 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 304 href="adjusting.xml" 305 xpointer="xpointer(//*[@os='p'])"/> 306 307 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 308 href="adjusting.xml" 309 xpointer="xpointer(//*[@os='q'])"/> 310 311 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 312 href="adjusting.xml" 313 xpointer="xpointer(//*[@os='r'])"/> 314 315 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 316 href="adjusting.xml" 317 xpointer="xpointer(//*[@os='s'])"/> 318 319 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 320 href="adjusting.xml" 321 xpointer="xpointer(//*[@os='t'])"/> 322 323 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 324 href="adjusting.xml" 325 xpointer="xpointer(//*[@os='u'])"/> 326 327 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 328 href="adjusting.xml" 329 xpointer="xpointer(//*[@os='v'])"/> 271 <para>Next make sure that we're using the correct libc:</para> 272 273 <screen><userinput>grep "/lib.*/libc.so.6 " dummy.log</userinput></screen> 274 275 <para>The output of the last command should be:</para> 276 277 <screen><computeroutput>attempt to open /usr/lib/libc.so.6 succeeded</computeroutput></screen> 278 279 <para>Make sure GCC is using the correct dynamic linker:</para> 280 281 <screen><userinput>grep found dummy.log</userinput></screen> 282 283 <para>The output of the last command should be (allowing for 284 platform-specific differences in dynamic linker name):</para> 285 286 <screen><computeroutput>found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2</computeroutput></screen> 287 288 <para>If the output does not appear as shown above or is not received 289 at all, then something is seriously wrong. Investigate and retrace the 290 steps to find out where the problem is and correct it. <!--The most likely 291 reason is that something went wrong with the specs file adjustment.--> Any 292 issues will need to be resolved before continuing with the process.</para> 293 294 <para>Once everything is working correctly, clean up the test files:</para> 295 296 <screen><userinput>rm -v dummy.c a.out dummy.log</userinput></screen> 330 297 331 298 <para>Finally, move a misplaced file:</para> -
chapter08/iproute2.xml
rfe09af0 rb39aae0 62 62 <para>Compile the package:</para> 63 63 64 <screen><userinput remap="make">make </userinput></screen>64 <screen><userinput remap="make">make NETNS_RUN_DIR=/run/netns</userinput></screen> 65 65 66 66 <para>This package does not have a working test suite.</para> -
chapter08/tcl.xml
rfe09af0 rb39aae0 64 64 cd unix 65 65 ./configure --prefix=/usr \ 66 --mandir=/usr/share/man \ 67 $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)</userinput></screen> 68 69 <variablelist> 70 <title>The meaning of the configure options:</title> 71 72 <varlistentry> 73 <term><parameter>$([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)</parameter></term> 74 <listitem> 75 <para>The construct <parameter>$(<shell command>)</parameter> 76 is replaced by the output of the shell command. Here this output is 77 empty if running on a 32 bit machine, and is 78 <parameter>--enable-64bit</parameter> if running on a 64 bit machine. 79 </para> 80 </listitem> 81 </varlistentry> 82 83 </variablelist> 66 --mandir=/usr/share/man</userinput></screen> 84 67 85 68 <para>Build the package:</para>
Note:
See TracChangeset
for help on using the changeset viewer.