Changeset 964103c


Ignore:
Timestamp:
03/02/2022 01:15:18 PM (9 months ago)
Author:
Xi Ruoyao <xry111@…>
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.
Message:

Merge branch 'trunk' into xry111/clfs-ng

Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • chapter01/changelog.xml

    ra5da281 r964103c  
    4242
    4343    <listitem>
     44      <para>2022-03-02</para>
     45      <itemizedlist>
     46        <listitem>
     47          <para>[xry111] - Build libstdc++ in GCC pass 2, and remove the
     48          seperate libstdc++ pass 2.</para>
     49        </listitem>
     50        <listitem>
     51          <para>[xry111] - Remove unneeded
     52          <parameter>--enable-64bit</parameter> for tcl.</para>
     53        </listitem>
     54      </itemizedlist>
     55    </listitem>
     56
     57    <listitem>
    4458      <para>2022-03-01</para>
    4559      <itemizedlist>
  • chapter05/libstdc++.xml

    ra5da281 r964103c  
    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

    ra5da281 r964103c  
    6363    -i.orig gcc/config/i386/t-linux64</userinput></screen>
    6464
    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>
    6867
    69 <screen><userinput remap="pre">patch -Np1 -i ../&gcc-cross-patch;</userinput></screen>
    70 -->
     68<screen><userinput remap="pre">sed 's/gnu++17/&amp; -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
    7177    <para>Create a separate build directory again:</para>
    7278
    7379<screen><userinput remap="pre">mkdir -v build
    7480cd       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>
    8181
    8282    <para>Before starting to build GCC, remember to unset any environment
     
    8888    --build=$(../config.guess)                     \
    8989    --host=$LFS_TGT                                \
     90    --target=$LFS_TGT                              \
     91    LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc      \
    9092    --prefix=/usr                                  \
    91     CC_FOR_TARGET=$LFS_TGT-gcc                     \
    9293    --with-build-sysroot=$LFS                      \
    9394    --enable-initfini-array                        \
     
    100101    --disable-libssp                               \
    101102    --disable-libvtv                               \
    102     --disable-libstdcxx                            \
    103103    --enable-languages=c,c++</userinput></screen>
    104104
     
    107107
    108108      <varlistentry>
    109         <term><parameter>-with-build-sysroot=$LFS</parameter></term>
     109        <term><parameter>--with-build-sysroot=$LFS</parameter></term>
    110110        <listitem>
    111111          <para>Normally, using <parameter>--host</parameter> ensures that
     
    116116          needed to have them find the needed files in <filename
    117117          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>
    118145        </listitem>
    119146      </varlistentry>
  • chapter07/chapter07.xml

    ra5da281 r964103c  
    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

    ra5da281 r964103c  
    196196    some sanity checks:</para>
    197197
    198     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    199     href="adjusting.xml"
    200     xpointer="xpointer(//*[@os='a'])"/>
    201 
    202     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    203     href="adjusting.xml"
    204     xpointer="xpointer(//*[@os='b'])"/>
    205 
    206     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    207     href="adjusting.xml"
    208     xpointer="xpointer(//*[@os='c'])"/>
    209 
    210     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    211     href="adjusting.xml"
    212     xpointer="xpointer(//*[@os='d'])"/>
    213 
    214     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    215     href="adjusting.xml"
    216     xpointer="xpointer(//*[@os='e'])"/>
    217 
    218     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    219     href="adjusting.xml"
    220     xpointer="xpointer(//*[@os='f'])"/>
     198<screen><userinput>echo 'int main(){}' &gt; dummy.c
     199cc dummy.c -v -Wl,--verbose &amp;&gt; dummy.log
     200readelf -l a.out | grep ': /lib'</userinput></screen>
     201
     202  <para>There should be no errors,
     203  and the output of the last command will be (allowing for
     204  platform-specific differences in the dynamic linker name):</para>
     205
     206<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
     207
     208  <para>Now make sure that we're setup to use the correct start files:</para>
     209
     210<screen><userinput>grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log</userinput></screen>
     211
     212  <para>The output of the last command should be:</para>
    221213
    222214<screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded
     
    231223  <filename class="directory">/usr/lib</filename> directory.</para>
    232224
    233     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    234     href="adjusting.xml"
    235     xpointer="xpointer(//*[@os='g'])"/>
     225  <para>Verify that the compiler is searching for the correct header
     226  files:</para>
    236227
    237228<screen><userinput>grep -B4 '^ /usr/include' dummy.log</userinput></screen>
    238229
    239     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    240     href="adjusting.xml"
    241     xpointer="xpointer(//*[@os='h'])"/>
     230  <para>This command should return the following output:</para>
    242231
    243232<screen><computeroutput>#include &lt;...&gt; search starts here:
     
    250239   different than the above, depending on your system architecture.</para>
    251240
    252     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    253     href="adjusting.xml"
    254     xpointer="xpointer(//*[@os='i'])"/>
    255 
    256     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    257     href="adjusting.xml"
    258     xpointer="xpointer(//*[@os='j'])"/>
    259 
    260     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    261     href="adjusting.xml"
    262     xpointer="xpointer(//*[@os='k'])"/>
     241  <para>Next, verify that the new linker is being used with the correct search paths:</para>
     242
     243<screen><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen>
     244
     245  <para>References to paths that have components with '-linux-gnu' should
     246  be ignored, but otherwise the output of the last command should be:</para>
    263247
    264248<screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
     
    283267SEARCH_DIR("/usr/lib");</computeroutput></screen>
    284268
    285     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    286     href="adjusting.xml"
    287     xpointer="xpointer(//*[@os='l'])"/>
    288 
    289     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    290     href="adjusting.xml"
    291     xpointer="xpointer(//*[@os='m'])"/>
    292 
    293     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    294     href="adjusting.xml"
    295     xpointer="xpointer(//*[@os='n'])"/>
    296 
    297     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    298     href="adjusting.xml"
    299     xpointer="xpointer(//*[@os='o'])"/>
    300 
    301     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    302     href="adjusting.xml"
    303     xpointer="xpointer(//*[@os='p'])"/>
    304 
    305     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    306     href="adjusting.xml"
    307     xpointer="xpointer(//*[@os='q'])"/>
    308 
    309     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    310     href="adjusting.xml"
    311     xpointer="xpointer(//*[@os='r'])"/>
    312 
    313     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    314     href="adjusting.xml"
    315     xpointer="xpointer(//*[@os='s'])"/>
    316 
    317     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    318     href="adjusting.xml"
    319     xpointer="xpointer(//*[@os='t'])"/>
    320 
    321     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    322     href="adjusting.xml"
    323     xpointer="xpointer(//*[@os='u'])"/>
    324 
    325     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    326     href="adjusting.xml"
    327     xpointer="xpointer(//*[@os='v'])"/>
     269  <para>Next make sure that we're using the correct libc:</para>
     270
     271<screen><userinput>grep "/lib.*/libc.so.6 " dummy.log</userinput></screen>
     272
     273  <para>The output of the last command should be:</para>
     274
     275<screen><computeroutput>attempt to open /usr/lib/libc.so.6 succeeded</computeroutput></screen>
     276
     277  <para>Make sure GCC is using the correct dynamic linker:</para>
     278
     279<screen><userinput>grep found dummy.log</userinput></screen>
     280
     281  <para>The output of the last command should be (allowing for
     282  platform-specific differences in dynamic linker name):</para>
     283
     284<screen><computeroutput>found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2</computeroutput></screen>
     285
     286  <para>If the output does not appear as shown above or is not received
     287  at all, then something is seriously wrong. Investigate and retrace the
     288  steps to find out where the problem is and correct it. <!--The most likely
     289  reason is that something went wrong with the specs file adjustment.--> Any
     290  issues will need to be resolved before continuing with the process.</para>
     291
     292  <para>Once everything is working correctly, clean up the test files:</para>
     293
     294<screen><userinput>rm -v dummy.c a.out dummy.log</userinput></screen>
    328295
    329296    <para>Finally, move a misplaced file:</para>
  • chapter08/iproute2.xml

    ra5da281 r964103c  
    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

    ra5da281 r964103c  
    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.