Changes in / [75c9760:7b85e11]


Ignore:
Files:
6 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • chapter04/addinguser.xml

    r75c9760 r7b85e11  
    8181  <systemitem class="username">lfs</systemitem> the owner:</para>
    8282
    83 <screen><userinput>chown -v lfs $LFS/{usr{,/*},lib,var,etc,bin,sbin,tools}
    84 case $(uname -m) in
    85   x86_64) chown -v lfs $LFS/lib64 ;;
    86 esac</userinput></screen>
     83<screen><userinput>chown -v lfs $LFS/{usr{,/*},lib*,var,etc,bin,sbin,tools}</userinput></screen>
    8784
    8885<note><para>In some host systems, the following <command>su</command> command does not complete
  • chapter04/creatingminlayout.xml

    r75c9760 r7b85e11  
    2828done
    2929
    30 case $(uname -m) in
    31   x86_64) mkdir -pv $LFS/lib64 ;;
    32 esac</userinput></screen>
     30mkdir -pv $LFS/lib64</userinput></screen>
    3331
    3432  <para>Programs in <xref linkend="chapter-temporary-tools"/> will be compiled
  • chapter04/settingenviron.xml

    r75c9760 r7b85e11  
    4444LFS=/mnt/lfs
    4545LC_ALL=POSIX
    46 LFS_TGT=$(uname -m)-lfs-linux-gnu
     46LFS_TGT=mips64el-lfs-linux-gnuabi64
    4747PATH=/usr/bin
    4848if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
  • chapter05/binutils-pass1.xml

    r75c9760 r7b85e11  
    149149        <term><parameter>--enable-default-hash-style=gnu</parameter></term>
    150150        <listitem>
    151           <para>By default, the linker would generate both the GNU-style
    152           hash table and the classic ELF hash table for shared libraries and
    153           dynamically linked executables.  The hash tables are only intended
    154           for a dynamic linker to perform symbol lookup.  On LFS the dynamic
    155           linker (provided by the Glibc package) will always use the
    156           GNU-style hash table which is faster to query.  So the classic
    157           ELF hash table is completely useless.  This makes the linker
    158           only generate the GNU-style hash table by default, so we can avoid
    159           wasting time to generate the classic ELF hash table when we build
    160           the packages, or wasting disk space to store it.</para>
     151          <para>By default, the linker would generate the classic ELF hash
     152          table for shared libraries and dynamically linked executables
     153          because the GNU-style hash table is incompatible with the MIPS o32
     154          ABI. The hash tables are only intended for a dynamic linker to
     155          perform symbol lookup.  On LFS the dynamic linker (provided by the
     156          Glibc package) supports the GNU-style hash table, and this LFS
     157          edition does not support the o32 ABI.  So this is used to make the
     158          linker generate the GNU-style hash table instead of the classic
     159          ELF hash table by default, as the GNU-style hash table is faster
     160          to query.</para>
    161161        </listitem>
    162162      </varlistentry>
  • chapter05/gcc-pass1.xml

    r75c9760 r7b85e11  
    6363mv -v mpc-&mpc-version; mpc</userinput></screen>
    6464
    65     <para>On x86_64 hosts, set the default directory name for
     65    <para>On 64-bit MIPS hosts, set the default directory name for
    6666    64-bit libraries to <quote>lib</quote>:</para>
    6767
    68 <screen><userinput remap="pre">case $(uname -m) in
    69   x86_64)
    70     sed -e '/m64=/s/lib64/lib/' \
    71         -i.orig gcc/config/i386/t-linux64
    72  ;;
    73 esac</userinput></screen>
     68<screen><userinput remap="pre">sed -e 's/lib64/lib/' \
     69    -i.orig gcc/config/mips/{mips.h,t-linux64}</userinput></screen>
    7470
    7571    <para>The GCC documentation recommends building GCC
     
    7874<screen><userinput remap="pre">mkdir -v build
    7975cd       build</userinput></screen>
     76
     77    <para>Probe the NaN encoding of the CPU:</para>
     78
     79<screen><userinput remap="pre">cat > nan2008.c &lt;&lt; \EOF
     80<literal>#include &lt;stdio.h&gt;
     81int main()
     82{
     83  int x;
     84  asm("cfc1\t%0,$31":"=r"(x));
     85  return !(x &amp; 1 &lt;&lt; 18);
     86}</literal>
     87EOF
     88gcc nan2008.c -o nan2008
     89if ./nan2008; then
     90  NAN_SWITCH=--with-nan=2008
     91fi</userinput></screen>
    8092
    8193    <para>Prepare GCC for compilation:</para>
     
    8496    --target=$LFS_TGT         \
    8597    --prefix=$LFS/tools       \
     98    --with-arch=mips64r2      \
    8699    --with-glibc-version=&glibc-version; \
    87100    --with-sysroot=$LFS       \
     
    100113    --disable-libvtv          \
    101114    --disable-libstdcxx       \
    102     --enable-languages=c,c++</userinput></screen>
     115    --enable-languages=c,c++  \
     116    $NAN_SWITCH</userinput></screen>
    103117    <variablelist>
    104118      <title>The meaning of the configure options:</title>
     119
     120      <varlistentry>
     121        <term><parameter>--with-arch=mips64r2</parameter></term>
     122        <listitem>
     123          <para>Set the default value of <option>-march=</option> to
     124          mips64r2.  Most distros use it as the baseline for the MIPS port,
     125          so we are doing the same.  You may change it if your CPU is not
     126          compatible with mips64r2 (for example, mips3 or mips64r6), or
     127          your CPU is stronger than mips64r2 and you don't care about the
     128          compatibility with mips64r2, but we've not tested any setting
     129          other than mips64r2.</para>
     130        </listitem>
     131      </varlistentry>
    105132
    106133      <varlistentry>
     
    160187        <term><parameter>--disable-multilib</parameter></term>
    161188        <listitem>
    162           <para>On x86_64, LFS does not support a multilib configuration.
    163           This switch is harmless for x86.</para>
     189          <para>On 64-bit MIPS, LFS does not support a multilib configuration.</para>
    164190        </listitem>
    165191      </varlistentry>
     
    184210          <para>This option ensures that only the C and C++ compilers are built.
    185211          These are the only languages needed now.</para>
     212        </listitem>
     213      </varlistentry>
     214
     215      <varlistentry>
     216        <term><parameter>$NAN_SWITCH</parameter></term>
     217        <listitem>
     218          <para>If the CPU encodes NaN (Not a Number) values following
     219          IEEE 754-2008 (indicated by the 16th bit of FCSR), this variable
     220          will be set to <option>--with-nan=2008</option> so GCC will be
     221          configured to use the IEEE 754-2008 encoding for NaN values as
     222                  the default.  If this option is not properly set to match the CPU,
     223                  many Glibc and Python tests will fail because of the wrong NaN
     224                  encoding.</para>
    186225        </listitem>
    187226      </varlistentry>
  • chapter05/glibc.xml

    r75c9760 r7b85e11  
    4444    <title>Installation of Glibc</title>
    4545
    46     <para>First, create a symbolic link for LSB compliance. Additionally,
    47     for x86_64, create a compatibility symbolic link required for proper
     46    <para>Create a compatibility symbolic link required for proper
    4847    operation of the dynamic library loader:</para>
    4948
    50 <screen><userinput remap="pre">case $(uname -m) in
    51     i?86)   ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
    52     ;;
    53     x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
    54             ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
    55     ;;
    56 esac</userinput></screen>
     49<screen><userinput remap="pre">if $LFS_TGT-gcc -v 2>&amp;1 | grep nan=2008 &amp;>/dev/null; then
     50  ln -sfv ../lib/ld-linux-mipsn8.so.1 $LFS/lib64
     51else
     52  ln -sfv ../lib/ld.so.1 $LFS/lib64
     53fi</userinput></screen>
    5754
    5855    <note>
     
    207204
    208205<screen><userinput>echo 'int main(){}' | $LFS_TGT-gcc -xc -
    209 readelf -l a.out | grep ld-linux</userinput></screen>
     206readelf -l a.out | grep /ld</userinput></screen>
    210207
    211208      <para>If everything is working correctly, there should be no errors,
    212209      and the output of the last command will be of the form:</para>
    213210
    214 <screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
    215 
    216       <para>Note that for 32-bit machines, the interpreter name will be
    217       <filename>/lib/ld-linux.so.2</filename>.</para>
     211<screen><computeroutput>[Requesting program interpreter: /lib64/ld.so.1</computeroutput></screen>
     212
     213      <para>Note that if <parameter>--with-nan=2008</parameter> is used for
     214      GCC, the interpreter name will be
     215      <filename>/lib64/ld-linux-mipsn8.so.1</filename>.</para>
    218216
    219217      <para>If the output is not as shown above, or there is no output at all,
  • chapter06/gcc-pass2.xml

    r75c9760 r7b85e11  
    5858mv -v mpc-&mpc-version; mpc</userinput></screen>
    5959
    60     <para>If building on x86_64, change the default directory name for 64-bit
    61     libraries to <quote>lib</quote>:</para>
     60    <para>For building on 64-bit MIPS, change the default directory name for
     61    64-bit libraries to <quote>lib</quote>:</para>
    6262
    63 <screen><userinput remap="pre">case $(uname -m) in
    64   x86_64)
    65     sed -e '/m64=/s/lib64/lib/' \
    66         -i.orig gcc/config/i386/t-linux64
    67   ;;
    68 esac</userinput></screen>
     63<screen><userinput remap="pre">sed -e 's/lib64/lib/' \
     64    -i.orig gcc/config/mips/{mips.h,t-linux64}</userinput></screen>
    6965
    7066    <para>Override the building rule of libgcc and libstdc++ headers, to
     
    9086    LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc      \
    9187    --prefix=/usr                                  \
     88    --with-arch=mips64r2                           \
    9289    --with-build-sysroot=$LFS                      \
    9390    --enable-default-pie                           \
     
    10198    --disable-libssp                               \
    10299    --disable-libvtv                               \
    103     --enable-languages=c,c++</userinput></screen>
     100    --enable-languages=c,c++                       \
     101    $($LFS_TGT-gcc -v 2>&amp;1 | grep -o ..with-nan=2008)</userinput></screen>
    104102
    105103    <variablelist>
  • chapter07/changingowner.xml

    r75c9760 r7b85e11  
    3434  command:</para>
    3535
    36 <screen><userinput>chown --from lfs -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools}
    37 case $(uname -m) in
    38   x86_64) chown --from lfs -R root:root $LFS/lib64 ;;
    39 esac</userinput></screen>
     36<screen><userinput>chown --from lfs -R root:root $LFS/{usr,lib,lib64,var,etc,bin,sbin,tools}</userinput></screen>
    4037
    4138</sect1>
  • chapter08/binutils.xml

    r75c9760 r7b85e11  
    5252<screen><userinput remap="configure">../configure --prefix=/usr       \
    5353             --sysconfdir=/etc   \
    54              --enable-gold       \
    5554             --enable-ld=default \
    5655             --enable-plugins    \
     
    6463    <variablelist>
    6564      <title>The meaning of the new configure parameters:</title>
    66 
    67       <varlistentry>
    68         <term><parameter>--enable-gold</parameter></term>
    69         <listitem>
    70           <para>Build the gold linker and install it as ld.gold (alongside the
    71           default linker).</para>
    72         </listitem>
    73       </varlistentry>
    7465
    7566      <varlistentry>
     
    137128<screen><userinput remap="test">grep '^FAIL:' $(find -name '*.log')</userinput></screen>
    138129
    139     <para>Twelve tests fail in the gold test suite when the
    140     <option>--enable-default-pie</option> and
    141     <option>--enable-default-ssp</option> options are passed to GCC.</para>
    142 
    143130 <!--    <para>Three tests in the gprofng suite are also known to fail.</para>-->
     131
     132    <para>In the ld test suite 84 tests are known to fail because they
     133    are not designed compatible with either the n64 ABI or the
     134    <option>--enable-default-hash-style=gnu</option> option.  In the
     135    binutils test suite one test named <literal>readelf -S bintest</literal>
     136    is known to fail as well.</para>
    144137
    145138    <para>Install the package:</para>
     
    162155
    163156      <seglistitem>
    164         <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm,
     157        <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, nm,
    165158        objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
    166159        <seg>libbfd.so, libctf.so, libctf-nobfd.so, libgprofng.so,
     
    268261          <indexterm zone="ch-system-binutils ld">
    269262            <primary sortas="b-ld">ld</primary>
    270           </indexterm>
    271         </listitem>
    272       </varlistentry>
    273 
    274       <varlistentry id="ld.gold">
    275         <term><command>ld.gold</command></term>
    276         <listitem>
    277           <para>A cut down version of ld that only supports the
    278           elf object file format</para>
    279           <indexterm zone="ch-system-binutils ld.gold">
    280             <primary sortas="b-ld.gold">ld.gold</primary>
    281263          </indexterm>
    282264        </listitem>
  • chapter08/chapter08.xml

    r75c9760 r7b85e11  
    7676  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
    7777  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="groff.xml"/>
    78   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub.xml"/>
    7978  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
    8079  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iproute2.xml"/>
  • chapter08/gcc.xml

    r75c9760 r7b85e11  
    4242    <title>Installation of GCC</title>
    4343
    44     <para>If building on x86_64, change the default directory name for 64-bit
    45     libraries to <quote>lib</quote>:</para>
    46 
    47 <screen><userinput remap="pre">case $(uname -m) in
    48   x86_64)
    49     sed -e '/m64=/s/lib64/lib/' \
    50         -i.orig gcc/config/i386/t-linux64
    51   ;;
    52 esac</userinput></screen>
     44    <para>For building on 64-bit MIPS, change the default directory name for
     45    64-bit libraries to <quote>lib</quote>:</para>
     46
     47<screen><userinput remap="pre">sed -e 's/lib64/lib/' \
     48    -i.orig gcc/config/mips/{mips.h,t-linux64}</userinput></screen>
    5349
    5450    <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
     
    6864             --disable-bootstrap      \
    6965             --disable-fixincludes    \
    70              --with-system-zlib</userinput></screen>
     66             --with-arch=mips64r2     \
     67             --with-system-zlib       \
     68             $(cc -v 2>&amp;1 | grep -o .-with-nan=2008)</userinput></screen>
    7169
    7270    <para>GCC supports seven different computer languages, but the
     
    174172    url="&test-results;"/> and
    175173    <ulink url="https://gcc.gnu.org/ml/gcc-testresults/"/>.</para>
    176 <!--
    177     <para>
    178     Eight gcc tests (out of over 185,000):
    179     <!- - https://gcc.gnu.org/PR106375 - -><filename>pr56837.c</filename>
    180     and seven tests in the <filename class='directory'>analyzer</filename>
    181     directory are known to fail.
    182 
    183     <!- - https://gcc.gnu.org/PR109353 - ->
    184     One libstdc++ test (out of over 15000), <filename>copy.cc</filename>, is
    185     known to fail.
    186 
    187     For g++, 21 tests (out of approximately 250,000): 14
    188     <quote>AddressSanitizer*</quote>
    189     tests and 7 <filename>interception-malloc-test-1.C</filename> tests, are
    190     known to fail.
    191 
    192     Additionally, several tests in the
    193     <filename class='directory'>vect</filename> directory are known to fail
    194     if the hardware does not support AVX.</para>
    195 -->
     174
     175    <para>Hundreds of gcc and g++ tests can fail on MIPS systems, as MIPS
     176    is not a primary platform of GCC and many MIPS tests are not written
     177    with <option>--enable-default-pie</option> or
     178    <option>--enable-default-ssp</option> in mind.</para>
     179
     180    <para>In libstdc++ tests, the tests named
     181    <filename>abi_check</filename> and
     182    <filename>compare_exchange_padding.cc</filename> are known to fail.</para>
     183
    196184    <para>A few unexpected failures cannot always be avoided. In some cases
    197185    test failures depend on the specific hardware of the system.<!--The GCC developers
     
    243231  platform-specific differences in the dynamic linker name):</para>
    244232
    245 <screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
     233<screen><computeroutput>[Requesting program interpreter: /lib64/ld.so.1]</computeroutput></screen>
    246234
    247235  <para>Now make sure that we're set up to use the correct start files:</para>
     
    251239  <para>The output of the last command should be:</para>
    252240
    253 <screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/Scrt1.o succeeded
    254 /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
    255 /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
     241<screen><computeroutput>/usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/../../../../lib/Scrt1.o succeeded
     242/usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/../../../../lib/crti.o succeeded
     243/usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
    256244
    257245  <para>Depending on your machine architecture, the above may differ slightly.
     
    270258
    271259<screen><computeroutput>#include &lt;...&gt; search starts here:
    272  /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include
     260 /usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/include
    273261 /usr/local/include
    274  /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed
     262 /usr/lib/gcc/mips64el-unknown-linux-gnuabi64/&gcc-version;/include-fixed
    275263 /usr/include</computeroutput></screen>
    276264
     
    285273  be ignored, but otherwise the output of the last command should be:</para>
    286274
    287 <screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
     275<screen><computeroutput>SEARCH_DIR("/usr/mips64el-unknown-linux-gnuabi64/lib64")
    288276SEARCH_DIR("/usr/local/lib64")
    289277SEARCH_DIR("/lib64")
    290278SEARCH_DIR("/usr/lib64")
    291 SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
     279SEARCH_DIR("/usr/mips64el-unknown-linux-gnuabi64/lib")
    292280SEARCH_DIR("/usr/local/lib")
    293281SEARCH_DIR("/lib")
    294282SEARCH_DIR("/usr/lib");</computeroutput></screen>
    295 
     283<!--
    296284   <para>A 32-bit system may use a few other directories. For example, here
    297285   is the output from an i686 machine:</para>
     
    305293SEARCH_DIR("/lib")
    306294SEARCH_DIR("/usr/lib");</computeroutput></screen>
    307 
     295-->
    308296  <para>Next make sure that we're using the correct libc:</para>
    309297
     
    321309  platform-specific differences in dynamic linker name):</para>
    322310
    323 <screen><computeroutput>found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2</computeroutput></screen>
     311<screen><computeroutput>found ld.so.1 at /usr/lib/ld.so.1</computeroutput></screen>
    324312
    325313  <para>If the output does not appear as shown above or is not received
     
    354342
    355343        <seg>libasan.{a,so}, libatomic.{a,so}, libcc1.so, libgcc.a, libgcc_eh.a,
    356         libgcc_s.so, libgcov.a, libgomp.{a,so}, libhwasan.{a,so}, libitm.{a,so},
    357         liblsan.{a,so}, liblto_plugin.so,
     344        libgcc_s.so, libgcov.a, libgomp.{a,so},
     345        liblto_plugin.so,
    358346        libquadmath.{a,so}, libssp.{a,so}, libssp_nonshared.a,
    359         libstdc++.{a,so}, libstdc++exp.a, libstdc++fs.a, libsupc++.a, libtsan.{a,so},
     347        libstdc++.{a,so}, libstdc++exp.a, libstdc++fs.a, libsupc++.a,
    360348        and libubsan.{a,so}</seg>
    361349
     
    564552      </varlistentry>
    565553
    566       <varlistentry id="libhwasan">
    567         <term><filename class="libraryfile">libhwasan</filename></term>
    568         <listitem>
    569           <para>The Hardware-assisted Address Sanitizer runtime library</para>
    570           <indexterm zone="ch-system-gcc libhwasan">
    571             <primary sortas="c-libhwasan">libhwasan</primary>
    572           </indexterm>
    573         </listitem>
    574       </varlistentry>
    575 
    576       <varlistentry id="libitm">
    577         <term><filename class="libraryfile">libitm</filename></term>
    578         <listitem>
    579           <para>The GNU transactional memory library</para>
    580           <indexterm zone="ch-system-gcc libitm">
    581             <primary sortas="c-libitm">libitm</primary>
    582           </indexterm>
    583         </listitem>
    584       </varlistentry>
    585 
    586       <varlistentry id="liblsan">
    587         <term><filename class="libraryfile">liblsan</filename></term>
    588         <listitem>
    589           <para>The Leak Sanitizer runtime library</para>
    590           <indexterm zone="ch-system-gcc liblsan">
    591             <primary sortas="c-liblsan">liblsan</primary>
    592           </indexterm>
    593         </listitem>
    594       </varlistentry>
    595 
    596554      <varlistentry id="liblto_plugin">
    597555        <term><filename class="libraryfile">liblto_plugin</filename></term>
     
    668626      </varlistentry>
    669627
    670       <varlistentry id="libtsan">
    671         <term><filename class="libraryfile">libtsan</filename></term>
    672         <listitem>
    673           <para>The Thread Sanitizer runtime library</para>
    674           <indexterm zone="ch-system-gcc libtsan">
    675             <primary sortas="c-libtsan">libtsan</primary>
    676           </indexterm>
    677         </listitem>
    678       </varlistentry>
    679 
    680628      <varlistentry id="libubsan">
    681629        <term><filename class="libraryfile">libubsan</filename></term>
  • chapter08/glibc.xml

    r75c9760 r7b85e11  
    181181        <emphasis>nss/tst-nss-files-hosts-multi</emphasis> with ten times
    182182        the original timeout.</para>
     183      </listitem>
     184
     185      <listitem>
     186        <para>On MIPS, six elf audit tests, the test named
     187        <emphasis>elf/tst-ro-dynamic</emphasis>, and the test named
     188        <emphasis>elf/tst-sprof-basic</emphasis> are known to fail.</para>
     189      </listitem>
     190
     191      <!-- https://sourceware.org/pipermail/libc-alpha/2024-January/154221.html
     192           https://sourceware.org/glibc/wiki/Testing/Tests/stdlib/tst-arc4random-thread -->
     193      <listitem>
     194        <para>The <emphasis>stdlib/tst-arc4random-thread</emphasis>
     195        test is known to fail with some host kernel versions due to a
     196        kernel bug on MIPS.</para>
     197      </listitem>
     198
     199      <!-- https://sourceware.org/pipermail/libc-alpha/2024-February/154915.html -->
     200      <listitem>
     201        <para>Six <emphasis>math</emphasis> tests are known to fail due
     202        to outdated test data.</para>
    183203      </listitem>
    184204
     
    622642        pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace,
    623643        zdump, and zic</seg>
    624         <seg>ld-linux-x86-64.so.2, ld-linux.so.2,
     644        <seg>ld.so.1, ld-linux-mipsn8.so.1
    625645        libBrokenLocale.{a,so}, libanl.{a,so},
    626646        libc.{a,so}, libc_nonshared.a, libc_malloc_debug.so,
  • chapter08/gmp.xml

    r75c9760 r7b85e11  
    4141  <sect2 role="installation">
    4242    <title>Installation of GMP</title>
    43 
     43<!--
    4444    <note>
    4545      <para>If you are building for 32-bit x86, but you have a CPU which is
     
    5050<screen role="nodump"><userinput><parameter>ABI=32</parameter> ./configure ...</userinput></screen></para>
    5151    </note>
    52 
     52-->
    5353    <note>
    5454      <para>The default settings of GMP produce libraries optimized for
     
    6868            --enable-cxx     \
    6969            --disable-static \
     70            ABI=64           \
    7071            --docdir=/usr/share/doc/gmp-&gmp-version;</userinput></screen>
    7172
     
    7778        <listitem>
    7879          <para>This parameter enables C++ support</para>
     80        </listitem>
     81      </varlistentry>
     82
     83      <varlistentry>
     84        <term><parameter>ABI=64</parameter></term>
     85        <listitem>
     86          <para>This package defaults to use N32 ABI on 64-bit MIPS systems,
     87          but LFS expects 64-bit ABI.</para>
    7988        </listitem>
    8089      </varlistentry>
  • chapter08/libcap.xml

    r75c9760 r7b85e11  
    6060          <para>This parameter sets the library directory to
    6161          <filename>/usr/lib</filename> rather than
    62           <filename>/usr/lib64</filename> on x86_64. It has no effect on
    63           x86.</para>
     62          <filename>/usr/lib64</filename> on 64-bit MIPS.</para>
    6463        </listitem>
    6564      </varlistentry>
  • chapter08/libelf.xml

    r75c9760 r7b85e11  
    5959<screen><userinput remap="test">make check</userinput></screen>
    6060
     61    <para>Eight tests are known to fail due to incomplete MIPS
     62    support.</para>
     63
    6164    <para>Install only Libelf:</para>
    6265
  • chapter08/libffi.xml

    r75c9760 r7b85e11  
    7777          system, use the less capable system as a parameter. For details
    7878          about alternative system types, see <ulink
    79           url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/x86-Options.html'>
    80           the x86 options in the GCC manual</ulink>.</para>
     79          url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/MIPS-Options.html'>
     80          the MIPS options in the GCC manual</ulink>.</para>
    8181        </listitem>
    8282      </varlistentry>
  • chapter08/openssl.xml

    r75c9760 r7b85e11  
    5050    -i crypto/bn/rsaz_exp_x2.c</userinput></screen>
    5151-->
     52    <para>Remove an outdated compiler option causing build failure:</para>
     53
     54<screen><userinput remap="pre">sed 's/-mips3//' -i Configure</userinput></screen>
     55
    5256    <para>Prepare OpenSSL for compilation:</para>
    5357
     
    5559         --openssldir=/etc/ssl \
    5660         --libdir=lib          \
     61         linux64-mips64        \
    5762         shared                \
    5863         zlib-dynamic</userinput></screen>
  • chapter08/perl.xml

    r75c9760 r7b85e11  
    4747<screen><userinput remap="pre">patch -Np1 -i ../&perl-fix-patch;</userinput></screen>
    4848-->
     49    <para>Workaround an building issue on MIPS:</para>
     50
     51<screen><userinput remap="pre">sed 's@/bin/mips@/bin/false@g' -i Configure</userinput></screen>
     52
    4953    <para>This version of Perl builds the Compress::Raw::Zlib and
    5054    Compress::Raw::BZip2 modules. By
  • chapter08/pkgmgt.xml

    r75c9760 r7b85e11  
    377377    earlier versions.</para></note>
    378378
    379     <para>Finally, the new system has to be made bootable via <xref
    380     linkend="ch-bootable-grub"/>.</para>
     379    <para>Finally, the new system has to be made bootable by configuring
     380    a bootloader correctly.</para>
    381381
    382382  </sect2>
  • chapter08/stripping.xml

    r75c9760 r7b85e11  
    5050  rationale for using the <command>install</command> command here.)</para>
    5151
    52   <note><para>The ELF loader's name is ld-linux-x86-64.so.2 on 64-bit systems
    53   and ld-linux.so.2 on 32-bit systems.  The construct below selects the
    54   correct name for the current architecture, excluding anything ending
    55   with <literal>g</literal>, in case the commands below have already been
    56   run.</para></note>
     52  <note><para>The ELF loader's name may be platform specific.
     53  The contruct below selects the correct name for the current architecture,
     54  excluding anything ending with <literal>g</literal>, in case the commands
     55  below have already been run.</para></note>
    5756
    5857  <important>
     
    7170
    7271<!--<screen><userinput>save_lib="ld-2.25.so libc-2.25.so libpthread-2.25.so libthread_db-1.0.so"-->
    73 <screen><userinput>save_usrlib="$(cd /usr/lib; ls ld-linux*[^g])
     72<screen><userinput>save_usrlib="$(cd /usr/lib; ls ld*.so.*[^g])
    7473             libc.so.6
    7574             libthread_db.so.1
  • chapter08/systemd.xml

    r75c9760 r7b85e11  
    5454cd       build
    5555
     56CFLAGS+=" -Wno-format-overflow" \
    5657meson setup ..                \
    5758      --prefix=/usr           \
  • chapter08/util-linux.xml

    r75c9760 r7b85e11  
    129129    </para>
    130130
     131    <para>Two tests named <filename>fadvise/drop</filename> and
     132    <filename>fincore/count</filename> are known to fail if the page
     133    size of the host kernel is not 4 KB.</para>
     134
    131135    <para>Install the package:</para>
    132136
     
    152156        eject, fallocate, fdisk, fincore, findfs, findmnt, flock, fsck,
    153157        fsck.cramfs, fsck.minix, fsfreeze, fstrim, getopt, hardlink, hexdump, hwclock,
    154         i386 (link to setarch), ionice, ipcmk, ipcrm, ipcs, irqtop, isosize, kill, last,
     158        ionice, ipcmk, ipcrm, ipcs, irqtop, isosize, kill, last,
    155159        lastb (link to last), ldattach, linux32 (link to setarch), linux64 (link to setarch),
    156160        logger, look, losetup, lsblk, lscpu, lsipc, lsirq, lsfd, lslocks, lslogins,
    157         lsmem, lsns, mcookie, mesg, mkfs, mkfs.bfs, mkfs.cramfs, mkfs.minix, mkswap,
     161        lsmem, lsns, mcookie, mesg, mips (link to setarch), mips32 (link
     162        to setarch), mips64 (link to setarch), mkfs, mkfs.bfs, mkfs.cramfs,
     163        mkfs.minix, mkswap,
    158164        more, mount, mountpoint, namei, nsenter, partx, pivot_root, prlimit,
    159165        readprofile, rename, renice, resizepart, rev, rfkill, rtcwake, script,
     
    161167        swapoff, swapon, switch_root, taskset, uclampset, ul,
    162168        umount, uname26 (link to setarch), unshare, utmpdump, uuidd, uuidgen, uuidparse,
    163         wall, wdctl, whereis, wipefs, x86_64 (link to setarch), and zramctl</seg>
     169        wall, wdctl, whereis, wipefs, and zramctl</seg>
    164170        <seg>libblkid.so, libfdisk.so, libmount.so,
    165171        libsmartcols.so, and libuuid.so</seg>
     
    544550      </varlistentry>
    545551
    546       <varlistentry id="i386">
    547         <term><command>i386</command></term>
    548         <listitem>
    549           <para>A symbolic link to setarch</para>
    550           <indexterm zone="ch-system-util-linux i386">
    551             <primary sortas="b-i386">i386</primary>
    552           </indexterm>
    553         </listitem>
    554       </varlistentry>
    555 
    556552      <varlistentry id="ionice">
    557553        <term><command>ionice</command></term>
     
    820816          <indexterm zone="ch-system-util-linux mesg">
    821817            <primary sortas="b-mesg">mesg</primary>
     818          </indexterm>
     819        </listitem>
     820      </varlistentry>
     821
     822      <varlistentry id="mips">
     823        <term><command>mips</command></term>
     824        <listitem>
     825          <para>A symbolic link to setarch</para>
     826          <indexterm zone="ch-system-util-linux mips">
     827            <primary sortas="b-mips">mips</primary>
     828          </indexterm>
     829        </listitem>
     830      </varlistentry>
     831
     832      <varlistentry id="mips32">
     833        <term><command>mips32</command></term>
     834        <listitem>
     835          <para>A symbolic link to setarch</para>
     836          <indexterm zone="ch-system-util-linux mips32">
     837            <primary sortas="b-mips32">mips32</primary>
     838          </indexterm>
     839        </listitem>
     840      </varlistentry>
     841
     842      <varlistentry id="mips64">
     843        <term><command>mips64</command></term>
     844        <listitem>
     845          <para>A symbolic link to setarch</para>
     846          <indexterm zone="ch-system-util-linux mips64">
     847            <primary sortas="b-mips64">mips64</primary>
    822848          </indexterm>
    823849        </listitem>
     
    13051331      </varlistentry>
    13061332
    1307       <varlistentry id="x86_64">
    1308         <term><command>x86_64</command></term>
    1309         <listitem>
    1310           <para>A symbolic link to setarch</para>
    1311           <indexterm zone="ch-system-util-linux x86_64">
    1312             <primary sortas="b-x86_64">x86_64</primary>
    1313           </indexterm>
    1314         </listitem>
    1315       </varlistentry>
    1316 
    13171333      <varlistentry id="zramctl">
    13181334        <term><command>zramctl</command></term>
  • chapter09/symlinks.xml

    r75c9760 r7b85e11  
    3838      that have just one ethernet device of a particular type.  Laptops
    3939      often have two ethernet connections named eth0 and
    40       wlan0; such laptops can also use this method.  The command line
    41       is in the GRUB configuration file.
    42       See <xref linkend="grub-cfg" role='.'/></para>
     40      wlan0; such laptops can also use this method.</para>
    4341    </sect3>
    4442
  • chapter10/chapter10.xml

    r75c9760 r7b85e11  
    1515  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="fstab.xml"/>
    1616  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kernel.xml"/>
    17   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub.xml"/>
    1817
    1918</chapter>
  • chapter10/kernel.xml

    r75c9760 r7b85e11  
    142142        href="kernel/systemd.xml"/>
    143143   
    144       <para>Enable some additional features if you are building a 64-bit
    145       system.  If you are using menuconfig, enable them in the order of
    146       <parameter>CONFIG_PCI_MSI</parameter> first, then
    147       <parameter>CONFIG_IRQ_REMAP</parameter>, at last
    148       <parameter>CONFIG_X86_X2APIC</parameter> because an option only
    149       shows up after its dependencies are selected.</para>
    150 
    151       <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    152         href="kernel/x2apic.xml"/>
    153 
    154       <para>If you are building a 32-bit system running on a hardware
    155       with RAM more than 4GB, adjust the configuration so the kernel will
    156       be able to use up to 64GB physical RAM:</para>
    157 
    158       <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    159         href="kernel/highmem.xml"/>
    160 
    161144      <para>If the partition for the LFS system is in a NVME SSD (i. e. the
    162145      device node for the partition is <filename>/dev/nvme*</filename>
     
    286269          enabled, you should enable these two options as well or you'll see
    287270          a blank screen once the DRI driver is loaded.</para>
    288         </listitem>
    289       </varlistentry>
    290 
    291       <varlistentry>
    292         <term><parameter>Support x2apic</parameter></term>
    293         <listitem>
    294           <para>Support running the interrupt controller of 64-bit x86
    295           processors in x2APIC mode.  x2APIC may be enabled by firmware on
    296           64-bit x86 systems, and a kernel without this option enabled will
    297           panic on boot if x2APIC is enabled by firmware.  This option
    298           has no effect, but also does no harm if x2APIC is disabled by the
    299           firmware.</para>
    300271        </listitem>
    301272      </varlistentry>
     
    353324
    354325    <para>The path to the kernel image may vary depending on the platform being
    355     used. The filename below can be changed to suit your taste, but the stem of
    356     the filename should be <emphasis>vmlinuz</emphasis> to be compatible with
    357     the automatic setup of the boot process described in the next section.  The
    358     following command assumes an x86 architecture:</para>
    359 
    360 <screen><userinput remap="install">cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen>
     326    used. The filename below can be changed to suit your taste.</para>
     327
     328<screen><userinput remap="install">cp -iv vmlinuz /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen>
    361329
    362330    <para><filename>System.map</filename> is a symbol file for the kernel.
     
    375343
    376344<screen><userinput remap="install">cp -iv .config /boot/config-&linux-version;</userinput></screen>
     345
     346    <important>
     347      <para>At this point, you should install and/or configure your
     348      bootloader to boot the LFS system with the kernel just installed.
     349      The firmware interface of MIPS systems is not standardized so the
     350      detailed process will be board-specific.  You can reuse the bootloader
     351      from your host distro if possible.</para>
     352    </important>
    377353
    378354    <para>Install the documentation for the Linux kernel:</para>
  • chapter10/kernel/kernel-config.py

    r75c9760 r7b85e11  
    2424if_stack = []
    2525
    26 expand_var_mp = { 'SRCARCH': 'x86' }
     26expand_var_mp = { 'SRCARCH': 'mips' }
    2727main_dep = {}
    2828
  • chapter10/kernel/systemd.xml

    r75c9760 r7b85e11  
    1818  [ ] <emphasis role='blue'>C</emphasis>onfigure standard kernel features (expert users) ---&gt;            [EXPERT]
    1919
    20 <emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
    21   [*] <emphasis role='blue'>B</emphasis>uild a relocatable kernel                                   [RELOCATABLE]
    22   [*]   <emphasis role='blue'>R</emphasis>andomize the address of the kernel image (KASLR)       [RANDOMIZE_BASE]
     20<emphasis role='blue'>K</emphasis>ernel type ---&gt;
     21  [*] <emphasis role='blue'>R</emphasis>elocatable kernel                                           [RELOCATABLE]
     22  [*]   <emphasis role='blue'>R</emphasis>andomize the address of the kernel image               [RANDOMIZE_BASE]
    2323
    2424<emphasis role='blue'>G</emphasis>eneral architecture-dependent options ---&gt;
  • chapter10/kernel/sysv.xml

    r75c9760 r7b85e11  
    1515  [ ] <emphasis role='blue'>C</emphasis>onfigure standard kernel features (expert users) ---&gt;            [EXPERT]
    1616
    17 <emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
    18   [*] <emphasis role='blue'>B</emphasis>uild a relocatable kernel                                   [RELOCATABLE]
    19   [*]   <emphasis role='blue'>R</emphasis>andomize the address of the kernel image (KASLR)       [RANDOMIZE_BASE]
     17<emphasis role='blue'>K</emphasis>ernel type ---&gt;
     18  [*] <emphasis role='blue'>R</emphasis>elocatable kernel                                           [RELOCATABLE]
     19  [*]   <emphasis role='blue'>R</emphasis>andomize the address of the kernel image               [RANDOMIZE_BASE]
    2020
    2121<emphasis role='blue'>G</emphasis>eneral architecture-dependent options ---&gt;
  • git-version.sh

    r75c9760 r7b85e11  
    5454sha="$(git describe --abbrev=1)"
    5555rev=$(echo "$sha" | sed 's/-g[^-]*$//')
    56 version="$rev"
    57 versiond="$rev-systemd"
     56version="mips64el-$rev"
     57versiond="mips64el-$rev-systemd"
    5858
    5959if [ "$(git diff HEAD | wc -l)" != "0" ]; then
  • prologue/architecture.xml

    r75c9760 r7b85e11  
    1111  <title>LFS Target Architectures</title>
    1212
    13 <para>The primary target architectures of LFS are the AMD/Intel x86 (32-bit)
    14 and x86_64 (64-bit) CPUs.  On the other hand, the instructions in this book are
    15 also known to work, with some modifications, with the Power PC and ARM CPUs. To
     13<para>The primary target architectures of this LFS edition are the little
     14endian MIPS64 release 2 to 5 CPUs (the release 6 is not backward-compatible
     15with earlier releases).  On the other hand, the instructions
     16in this book are also known to work, with some modifications, for
     17MIPS CPUs with a different byte order, word size, or ISA version.  To
    1618build a system that utilizes one of these alternative CPUs, the main prerequisite, in
    1719addition to those on the next page, is an existing Linux system such as an
    1820earlier LFS installation, Ubuntu, Red Hat/Fedora, SuSE, or some other distribution
    19 that targets that architecture. (Note that a 32-bit
    20 distribution can be installed and used as a host system on a 64-bit AMD/Intel
    21 computer.)</para>
     21that targets that architecture.</para>
    2222
    23 <para>The gain from building on a 64-bit system, as
    24 compared to a 32-bit system, is minimal.
    25 For example, in a test build of LFS-9.1 on a Core i7-4790 CPU based system,
    26 using 4 cores, the following statistics were measured:</para>
    27 
    28 <screen><computeroutput>Architecture Build Time     Build Size
    29 32-bit       239.9 minutes  3.6 GB
    30 64-bit       233.2 minutes  4.4 GB</computeroutput></screen>
    31 
    32 <para>As you can see, on the same hardware, the 64-bit build is only 3% faster
    33 (and 22% larger) than the 32-bit build. If you plan to use LFS as a LAMP
    34 server, or a firewall, a 32-bit CPU may be good enough. On the other
    35 hand, several packages in BLFS now need more than 4 GB of RAM to be built
    36 and/or to run; if you plan to use LFS as a desktop, the LFS authors
    37 recommend building a 64-bit system.</para>
    38 
    39 <para>The default 64-bit build that results from LFS is a
    40 <quote>pure</quote> 64-bit system. That is, it supports 64-bit executables
     23<para>There are three widely-used ABIs for 64-bit MIPS programs.
     24The <quote>o32</quote> ABI is compatible with the ABI of the legacy 32-bit
     25MIPS programs and it's used for running those legacy 32-bit programs on a
     2664-bit MIPS CPU.  The <quote>n64</quote> ABI is designed for taking the full
     27advantage of 64-bit capability.  The <quote>n32</quote> ABI is similar to
     28n64 but using 32-bit pointers, mainly used for 64-bit devices with a small
     29amount of RAM. The default 64-bit build that results from LFS is a
     30<quote>pure</quote> n64 system. That is, it supports n64 executables
    4131only. Building a <quote>multi-lib</quote> system requires compiling many
    42 applications twice, once for a 32-bit system and once for a 64-bit system.
     32applications multiple times, each time for an ABI to be supported.
    4333This is not directly supported in LFS because it would interfere with the
    4434educational objective of providing the minimal instructions needed for a
     
    4636of LFS, accessible at <ulink
    4737url="https://www.linuxfromscratch.org/~thomas/multilib/index.html"/>. But
    48 that's an advanced topic.</para>
     38it's for x86_64, and anyway multilib is an advanced topic.</para>
    4939
    5040</sect1>
Note: See TracChangeset for help on using the changeset viewer.