Changeset b39aae0


Ignore:
Timestamp:
03/02/2022 01:04:45 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/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
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.
Message:

Merge tag 'xry111/lfs-next/for-trunk-20220302' into trunk

Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • chapter05/libstdc++.xml

    rfe09af0 rb39aae0  
    66]>
    77
    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"?>
    1010
    1111  <sect1info condition="script">
     
    1515  </sect1info>
    1616
    17   <title>Libstdc++ from GCC-&gcc-version;, Pass 1</title>
     17  <title>Libstdc++ from GCC-&gcc-version;</title>
    1818
    19   <indexterm zone="ch-tools-libstdcpp-pass1">
     19  <indexterm zone="ch-tools-libstdcpp">
    2020    <primary sortas="a-GCC">GCC</primary>
    2121    <secondary>tools, libstdc++ pass 1</secondary>
  • chapter06/gcc-pass2.xml

    rfe09af0 rb39aae0  
    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
     
    8889    --build=$(../config.guess)                     \
    8990    --host=$LFS_TGT                                \
     91    --target=$LFS_TGT                              \
     92    LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc      \
    9093    --prefix=/usr                                  \
    91     CC_FOR_TARGET=$LFS_TGT-gcc                     \
    9294    --with-build-sysroot=$LFS                      \
    9395    --enable-initfini-array                        \
     
    100102    --disable-libssp                               \
    101103    --disable-libvtv                               \
    102     --disable-libstdcxx                            \
    103104    --enable-languages=c,c++</userinput></screen>
    104105
     
    107108
    108109      <varlistentry>
    109         <term><parameter>-with-build-sysroot=$LFS</parameter></term>
     110        <term><parameter>--with-build-sysroot=$LFS</parameter></term>
    110111        <listitem>
    111112          <para>Normally, using <parameter>--host</parameter> ensures that
     
    116117          needed to have them find the needed files in <filename
    117118          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>
    118146        </listitem>
    119147      </varlistentry>
  • chapter07/chapter07.xml

    rfe09af0 rb39aae0  
    1818  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingdirs.xml"/>
    1919  <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"/>
    2120  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gettext.xml"/>
    2221  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bison.xml"/>
  • chapter08/gcc.xml

    rfe09af0 rb39aae0  
    198198    some sanity checks:</para>
    199199
    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(){}' &gt; dummy.c
     201cc dummy.c -v -Wl,--verbose &amp;&gt; dummy.log
     202readelf -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>
    223215
    224216<screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded
     
    233225  <filename class="directory">/usr/lib</filename> directory.</para>
    234226
    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>
    238229
    239230<screen><userinput>grep -B4 '^ /usr/include' dummy.log</userinput></screen>
    240231
    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>
    244233
    245234<screen><computeroutput>#include &lt;...&gt; search starts here:
     
    252241   different than the above, depending on your system architecture.</para>
    253242
    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>
    265249
    266250<screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
     
    285269SEARCH_DIR("/usr/lib");</computeroutput></screen>
    286270
    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>
    330297
    331298    <para>Finally, move a misplaced file:</para>
  • chapter08/iproute2.xml

    rfe09af0 rb39aae0  
    6262    <para>Compile the package:</para>
    6363
    64 <screen><userinput remap="make">make</userinput></screen>
     64<screen><userinput remap="make">make NETNS_RUN_DIR=/run/netns</userinput></screen>
    6565
    6666    <para>This package does not have a working test suite.</para>
  • chapter08/tcl.xml

    rfe09af0 rb39aae0  
    6464cd unix
    6565./configure --prefix=/usr           \
    66             --mandir=/usr/share/man \
    67             $([ "$(uname -m)" = x86_64 ] &amp;&amp; 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 ] &amp;&amp; echo --enable-64bit)</parameter></term>
    74         <listitem>
    75           <para>The construct <parameter>$(&lt;shell command&gt;)</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>
    8467
    8568    <para>Build the package:</para>
Note: See TracChangeset for help on using the changeset viewer.