Changes in / [1ff846e2:079ced7]


Ignore:
Files:
4 added
32 edited

Legend:

Unmodified
Added
Removed
  • chapter02/hostreqs.xml

    r1ff846e2 r079ced7  
    4646
    4747    <listitem>
    48       <para><emphasis role="strong">Binutils-2.38</emphasis> (Versions
     48      <para><emphasis role="strong">Binutils-2.13.1</emphasis> (Versions
    4949      greater than &binutils-version; are not recommended as they have
    5050      not been tested)</para>
     
    7575
    7676    <listitem>
    77       <para><emphasis role="strong">GCC-12.2</emphasis> including the C++
     77      <!-- Pass 1 GCC FTBFS with GCC-5.1 because of
     78           https://gcc.gnu.org/PR65801. -->
     79      <para><emphasis role="strong">GCC-5.2</emphasis> including the C++
    7880      compiler, <command>g++</command> (Versions greater than &gcc-version; are
    7981      not recommended as they have not been tested). C and C++ standard
     
    9698      that version when building <application>glibc</application> in
    9799      <xref linkend="chapter-cross-tools"/> and
    98       <xref linkend="chapter-building-system"/>, and
    99       &min-kernel; is the oldest kernel release supported by Glibc for
    100       LoongArch.</para>
    101 
    102       <important>
    103         <para>
    104           If a Linux distribution on LoongArch provides a kernel older than
    105           &min-kernel;, it indicates the distribution is using a preliminary
    106           version of the kernel ABI.  The preliminary draft was rejected by
    107           the kernel maintainers and it's fundamentally incompatible with
    108           the packages we will built for LFS.  Such <quote>old-world</quote>
    109           distributions (for example, Loongnix) cannot be used as a host
    110           distro for building LFS.
    111         </para>
    112 
    113         <para>
    114           Do not attempt to update the kernel to &min-kernel; or later on
    115           a old-world distro because doing so will cause a boot failure.
    116           Use a <quote>new-world</quote> distribution providing Linux Kernel
    117           &min-kernel; or newer instead.  You may need to contact the vendor
    118           of your hardware to get a firmware update for booting a new-world
    119           distribution because the boot protocol of LoongArch is stabilized
    120           after the launch of the early LoongArch hardwares.
    121         </para>
    122       </important>
     100      <xref linkend="chapter-building-system"/>, so the workarounds for
     101      older kernels are not enabled and the compiled
     102      <application>glibc</application> is slightly faster and smaller.
     103      As at Feb 2024, &min-kernel; is the oldest kernel release still
     104      supported by the kernel developers.  Some kernel releases older than
     105      &min-kernel; may be still supported by third-party teams, but they
     106      are not considered official upstream kernel releases; read
     107      <ulink url='https://kernel.org/category/releases.html'/> for the
     108      details.</para>
     109
     110      <para>If the host kernel is earlier than &min-kernel; you will need to replace
     111      the kernel with a more up-to-date version. There are two ways
     112      you can go about this. First, see if your Linux vendor provides a &min-kernel;
     113      or later kernel package. If so, you may wish to install it. If your
     114      vendor doesn't offer an acceptable kernel package, or you would prefer not to
     115      install it, you can compile a kernel yourself. Instructions for
     116      compiling the kernel and configuring the boot loader (assuming the host
     117      uses GRUB) are located in <xref linkend="chapter-bootable"/>.</para>
    123118
    124119      <para>We require the host kernel to support UNIX 98 pseudo terminal
     
    233228ver_check Coreutils      sort     8.1 || bail "Coreutils too old, stop"
    234229ver_check Bash           bash     3.2
    235 ver_check Binutils       ld       2.38
     230ver_check Binutils       ld       2.13.1
    236231ver_check Bison          bison    2.7
    237232ver_check Diffutils      diff     2.8.1
    238233ver_check Findutils      find     4.2.31
    239234ver_check Gawk           gawk     4.0.1
    240 ver_check GCC            gcc      12.2
    241 ver_check "GCC (C++)"    g++      12.2
     235ver_check GCC            gcc      5.2
     236ver_check "GCC (C++)"    g++      5.2
    242237ver_check Grep           grep     2.5.1a
    243238ver_check Gzip           gzip     1.3.12
  • chapter04/addinguser.xml

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

    r1ff846e2 r079ced7  
    2222  <systemitem class="username">root</systemitem>:</para>
    2323
    24 <screen><userinput>mkdir -pv $LFS/{etc,lib64,var} $LFS/usr/{bin,lib,sbin}
     24<screen><userinput>mkdir -pv $LFS/{etc,var} $LFS/usr/{bin,lib,sbin}
    2525
    2626for i in bin lib sbin; do
    2727  ln -sv usr/$i $LFS/$i
    28 done</userinput></screen>
     28done
     29
     30case $(uname -m) in
     31  x86_64) mkdir -pv $LFS/lib64 ;;
     32esac</userinput></screen>
    2933
    3034  <para>Programs in <xref linkend="chapter-temporary-tools"/> will be compiled
  • chapter05/gcc-pass1.xml

    r1ff846e2 r079ced7  
    6363mv -v mpc-&mpc-version; mpc</userinput></screen>
    6464
    65     <para>Set the default directory name for
     65    <para>On x86_64 hosts, set the default directory name for
    6666    64-bit libraries to <quote>lib</quote>:</para>
    6767
    68 <screen><userinput remap="pre">sed -e 's/lib64/lib/' \
    69     -i.orig gcc/config/loongarch/{t-linux,linux.h}</userinput></screen>
     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 ;;
     73esac</userinput></screen>
    7074
    7175    <para>The GCC documentation recommends building GCC
     
    156160        <term><parameter>--disable-multilib</parameter></term>
    157161        <listitem>
    158           <para>On LoongArch, LFS does not support a multilib configuration.</para>
     162          <para>On x86_64, LFS does not support a multilib configuration.
     163          This switch is harmless for x86.</para>
    159164        </listitem>
    160165      </varlistentry>
  • chapter05/glibc.xml

    r1ff846e2 r079ced7  
    4444    <title>Installation of Glibc</title>
    4545
    46     <para>Create a compatibility symbolic link required for proper
     46    <para>First, create a symbolic link for LSB compliance. Additionally,
     47    for x86_64, create a compatibility symbolic link required for proper
    4748    operation of the dynamic library loader:</para>
    4849
    49 <screen><userinput remap="pre">ln -sfv ../lib/ld-linux-loongarch-lp64d.so.1 $LFS/lib64</userinput></screen>
     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    ;;
     56esac</userinput></screen>
    5057
    5158    <note>
     
    205212      and the output of the last command will be of the form:</para>
    206213
    207 <screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-loongarch-lp64d.so.1]</computeroutput></screen>
    208 <!--
     214<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
     215
    209216      <para>Note that for 32-bit machines, the interpreter name will be
    210217      <filename>/lib/ld-linux.so.2</filename>.</para>
    211 -->
     218
    212219      <para>If the output is not as shown above, or there is no output at all,
    213220      then something is wrong. Investigate and retrace the steps to find out
  • chapter06/gcc-pass2.xml

    r1ff846e2 r079ced7  
    5858mv -v mpc-&mpc-version; mpc</userinput></screen>
    5959
    60     <para>Set the default directory name for
    61     64-bit libraries to <quote>lib</quote>:</para>
     60    <para>If building on x86_64, change the default directory name for 64-bit
     61    libraries to <quote>lib</quote>:</para>
    6262
    63 <screen><userinput remap="pre">sed -e 's/lib64/lib/' \
    64     -i.orig gcc/config/loongarch/{t-linux,linux.h}</userinput></screen>
     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  ;;
     68esac</userinput></screen>
    6569
    6670    <para>Override the building rule of libgcc and libstdc++ headers, to
  • chapter06/m4.xml

    r1ff846e2 r079ced7  
    5353<screen><userinput remap="configure">./configure --prefix=/usr   \
    5454            --host=$LFS_TGT \
    55             --build=$(build-aux/config.guess) \
    56             sv_cv_stack_direction=-1          \
    57             sv_cv_stack_direction_msg="grows down"</userinput></screen>
     55            --build=$(build-aux/config.guess)</userinput></screen>
    5856
    5957    <para>Compile the package:</para>
  • chapter06/patch.xml

    r1ff846e2 r079ced7  
    4444    <title>Installation of Patch</title>
    4545
    46     &update-config-text;
    47 
    48 <screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
    49 
    5046    <para>Prepare Patch for compilation:</para>
    5147
  • chapter07/changingowner.xml

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

    r1ff846e2 r079ced7  
    4242    <title>Installation of Binutils</title>
    4343
    44     <!-- https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=029e52bac7f3a6dd8b39f7f3d298b73174da806b -->
    45     <para>First, fix an issue causing some packages fail to build with
    46     Link Time Optimization (LTO).  Note that some BLFS packages will be
    47     built with LTO enabled by default even if you don't enable it
    48     explicitly:</para>
    49 
    50 <screen><userinput remap="pre">for i in LO12 HI20 ADD; do
    51   sed -e '/DESC64_HI12/a\    case BFD_RELOC_LARCH_TLS_LE_'${i}'_R:' \
    52       -i gas/config/tc-loongarch.c
    53 done</userinput></screen>
    54 
    5544    <para>The Binutils documentation recommends building Binutils
    5645    in a dedicated build directory:</para>
     
    6352<screen><userinput remap="configure">../configure --prefix=/usr       \
    6453             --sysconfdir=/etc   \
     54             --enable-gold       \
    6555             --enable-ld=default \
    6656             --enable-plugins    \
     
    7666
    7767      <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>
     74
     75      <varlistentry>
    7876        <term><parameter>--enable-ld=default</parameter></term>
    7977        <listitem>
     
    113111          ultimately be located) is set to <filename
    114112          class="directory">$(exec_prefix)/$(target_alias)</filename>. For
    115           example, 64-bit LoongArch machines would expand that to <filename
    116           class="directory">/usr/loongarch64-unknown-linux-gnu</filename>. Because this is
     113          example, x86_64 machines would expand that to <filename
     114          class="directory">/usr/x86_64-pc-linux-gnu</filename>. Because this is
    117115          a custom system, this target-specific directory in <filename
    118116          class="directory">/usr</filename> is not required. <filename
     
    139137<screen><userinput remap="test">grep '^FAIL:' $(find -name '*.log')</userinput></screen>
    140138
     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
    141143 <!--    <para>Three tests in the gprofng suite are also known to fail.</para>-->
    142144
     
    160162
    161163      <seglistitem>
    162         <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, nm,
     164        <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, gprofng, ld, ld.bfd, ld.gold, nm,
    163165        objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
    164166        <seg>libbfd.so, libctf.so, libctf-nobfd.so, libgprofng.so,
     
    266268          <indexterm zone="ch-system-binutils ld">
    267269            <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>
    268281          </indexterm>
    269282        </listitem>
  • chapter08/check.xml

    r1ff846e2 r079ced7  
    4040  <sect2 role="installation">
    4141    <title>Installation of Check</title>
    42 
    43     &update-config-text;
    44 
    45 <screen><userinput remap="pre">tar &update-config-arg;</userinput></screen>
    4642
    4743    <para>Prepare Check for compilation:</para>
  • chapter08/expect.xml

    r1ff846e2 r079ced7  
    6767    GDBM, and of course Expect itself) will fail catastrophically, and other
    6868    subtle breakages may also happen.</para>
    69 
    70     &update-config-text;
    71 
    72 <screen><userinput remap="pre">tar -C tclconfig &update-config-arg;</userinput></screen>
    7369
    7470    <para>Now, make some changes to allow the package with gcc-14.1 or later:</para>
  • chapter08/flex.xml

    r1ff846e2 r079ced7  
    5151    This is not present, so we use an environment variable to skip this process.
    5252    Now, prepare Flex for compilation:</para> -->
    53 
    54     &update-config-text;
    55 
    56 <screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
    5753
    5854    <para>Prepare Flex for compilation:</para>
  • chapter08/gcc.xml

    r1ff846e2 r079ced7  
    4242    <title>Installation of GCC</title>
    4343
    44     <para>Set 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/loongarch/{t-linux,linux.h}</userinput></screen>
     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  ;;
     52esac</userinput></screen>
    4953
    5054    <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
     
    143147    <para>Now remove/fix several known test failures:</para>
    144148
    145 <screen><userinput remap="test">sed -e '/cpython/d'               -i ../gcc/testsuite/gcc.dg/plugin/plugin.exp</userinput></screen>
     149<screen><userinput remap="test">sed -e '/cpython/d'               -i ../gcc/testsuite/gcc.dg/plugin/plugin.exp
     150sed -e 's/no-pic /&amp;-no-pie /'     -i ../gcc/testsuite/gcc.target/i386/pr113689-1.c
     151sed -e 's/300000/(1|300000)/'     -i ../libgomp/testsuite/libgomp.c-c++-common/pr109062.c
     152sed -e 's/{ target nonpic } //' \
     153    -e '/GOTPCREL/d'              -i ../gcc/testsuite/gcc.target/i386/fentryname3.c</userinput></screen>
    146154
    147155    <para>Test the results as a non-privileged user, but do not stop at errors:</para>
     
    180188    if the hardware does not support AVX.</para>
    181189-->
    182 
    183     <!-- gen-vect-*: Likely https://gcc.gnu.org/PR113418
    184          pr108357.c: https://gcc.gnu.org/PR108357#c5
    185          update-threading.c: https://gcc.gnu.org/PR110628
    186          vect-117.c: https://gcc.gnu.org/PR113685
    187          pr64076: Binutils bug (ld crashes), needs a triage -->
    188     <para>The tests named
    189     <filename>gen-vect-11b.c</filename>,
    190     <filename>gen-vect-11c.c</filename>,
    191     <filename>gen-vect-26.c</filename>,
    192     <filename>gen-vect-28.c</filename>,
    193     <filename>pr64076</filename>,
    194     <filename>pr108357.c</filename>,
    195     <filename>update-threading.c</filename>,
    196     and <filename>vect-117.c</filename> are known to fail.</para>
    197 
    198190    <para>A few unexpected failures cannot always be avoided. In some cases
    199191    test failures depend on the specific hardware of the system.<!--The GCC developers
     
    245237  platform-specific differences in the dynamic linker name):</para>
    246238
    247 <screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-loongarch-lp64d.so.1]</computeroutput></screen>
     239<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
    248240
    249241  <para>Now make sure that we're set up to use the correct start files:</para>
     
    253245  <para>The output of the last command should be:</para>
    254246
    255 <screen><computeroutput>/usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/Scrt1.o succeeded
    256 /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
    257 /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
     247<screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/Scrt1.o succeeded
     248/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
     249/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
    258250
    259251  <para>Depending on your machine architecture, the above may differ slightly.
     
    272264
    273265<screen><computeroutput>#include &lt;...&gt; search starts here:
    274  /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/include
     266 /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include
    275267 /usr/local/include
    276  /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/include-fixed
     268 /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed
    277269 /usr/include</computeroutput></screen>
    278270
     
    287279  be ignored, but otherwise the output of the last command should be:</para>
    288280
    289 <screen><computeroutput>SEARCH_DIR("/usr/loongarch64-unknown-linux-gnu/lib64")
     281<screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
    290282SEARCH_DIR("/usr/local/lib64")
    291283SEARCH_DIR("/lib64")
    292284SEARCH_DIR("/usr/lib64")
    293 SEARCH_DIR("/usr/loongarch64-unknown-linux-gnu/lib")
     285SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
    294286SEARCH_DIR("/usr/local/lib")
    295287SEARCH_DIR("/lib")
    296288SEARCH_DIR("/usr/lib");</computeroutput></screen>
    297 <!--
     289
    298290   <para>A 32-bit system may use a few other directories. For example, here
    299291   is the output from an i686 machine:</para>
     
    307299SEARCH_DIR("/lib")
    308300SEARCH_DIR("/usr/lib");</computeroutput></screen>
    309 -->
     301
    310302  <para>Next make sure that we're using the correct libc:</para>
    311303
     
    323315  platform-specific differences in dynamic linker name):</para>
    324316
    325 <screen><computeroutput>found ld-linux-loongarch-lp64d.so.1 at /usr/lib/ld-linux-loongarch-lp64d.so.1</computeroutput></screen>
     317<screen><computeroutput>found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2</computeroutput></screen>
    326318
    327319  <para>If the output does not appear as shown above or is not received
  • chapter08/grub.xml

    r1ff846e2 r079ced7  
    4343    <note>
    4444      <para>
    45         On LoongArch systems, the following instruction builds GRUB for UEFI.
    46         But because LFS lacks the FreeType package and the Unifont data
    47         file, GRUB won't install any font for the boot loader and
    48         the GRUB boot menu will be displayed using a coarse font or in a
    49         smaller region on the screen.
    50         If wanted, after the LFS system is finished, install
    51         <ulink url="&blfs-book;general/freetype.html">FreeType</ulink>
    52         and then install the GRUB compoents not installed from LFS following
    53         <ulink url="&blfs-book;postlfs/grub-efi.html">the BLFS
    54         instruction</ulink>, but remove the <option>--target=x86_64</option>
    55         option and skip the command to install the
    56         <filename class='directory'>/usr/lib/grub/x86_64-efi</filename>
    57         directory.
    58       </para>
    59       <para>
    60         If your system firmware does not support UEFI, you need to skip the
    61         content of this page and try to figure out how to boot your system.
     45        If your system has UEFI support and you wish to boot LFS with UEFI,
     46        you need to install GRUB with UEFI support (and its dependencies) by
     47        following the instructions on
     48        <ulink url="&blfs-book;postlfs/grub-efi.html">the BLFS page</ulink>.
     49        You may skip this package, or install this package and the BLFS
     50        GRUB for UEFI package without conflict (the BLFS page provides
     51        instructions for both cases).
    6252      </para>
    6353    </note>
  • chapter08/libcap.xml

    r1ff846e2 r079ced7  
    6060          <para>This parameter sets the library directory to
    6161          <filename>/usr/lib</filename> rather than
    62           <filename>/usr/lib64</filename> on 64-bit LoongArch.</para>
     62          <filename>/usr/lib64</filename> on x86_64. It has no effect on
     63          x86.</para>
    6364        </listitem>
    6465      </varlistentry>
  • chapter08/libffi.xml

    r1ff846e2 r079ced7  
    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/LoongArch-Options.html'>
    80           the LoongArch options in the GCC manual</ulink>.</para>
     79          url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/x86-Options.html'>
     80          the x86 options in the GCC manual</ulink>.</para>
    8181        </listitem>
    8282      </varlistentry>
  • chapter08/patch.xml

    r1ff846e2 r079ced7  
    4242  <sect2 role="installation">
    4343    <title>Installation of Patch</title>
    44 
    45     &update-config-text;
    46 
    47 <screen><userinput remap="pre">tar -C build-aux &update-config-arg;</userinput></screen>
    4844
    4945    <para>Prepare Patch for compilation:</para>
  • chapter08/python.xml

    r1ff846e2 r079ced7  
    9090    automatically re-run failed tests.  If a test failed but then passed
    9191    when re-run, it should be considered as passed.</para>
    92 
    93     <!-- https://github.com/python/cpython/pull/120227
    94          The typical page size of LoongArch Linux is 16 KiB so this issu
    95          can be triggered.  -->
    96     <para>One test named <literal>test.test_asyncio.test_sendfile</literal>
    97     is known to fail depending on the version and configuration of the host
    98     kernel.</para>
    9992
    10093    <para>Install the package:</para>
  • chapter08/stripping.xml

    r1ff846e2 r079ced7  
    5050  rationale for using the <command>install</command> command here.)</para>
    5151
    52   <note><para>The ELF loader's name may vary on different systems.
    53   The construct below selects the
     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
    5454  correct name for the current architecture, excluding anything ending
    5555  with <literal>g</literal>, in case the commands below have already been
  • chapter08/udev.xml

    r1ff846e2 r079ced7  
    6666cd       build
    6767
    68 CFLAGS+=" -Wno-format-overflow" \
    6968meson setup ..                  \
    7069      --prefix=/usr             \
  • chapter08/util-linux.xml

    r1ff846e2 r079ced7  
    122122       does not have the option <option>CONFIG_CRYPTO_USER_API_HASH</option>
    123123       enabled or does not have any options providing a SHA256 implementation
    124        (for example, <option>CONFIG_CRYPTO_SHA256</option>)
    125        enabled. In addition, the lsfd: inotify test will
     124       (for example, <option>CONFIG_CRYPTO_SHA256</option>, or
     125       <option>CONFIG_CRYPTO_SHA256_SSSE3</option> if the CPU supports
     126       Supplemental SSE3) enabled. In addition, the lsfd: inotify test will
    126127       fail if the kernel option <option>CONFIG_NETLINK_DIAG</option> is not
    127128       enabled.
     
    151152        eject, fallocate, fdisk, fincore, findfs, findmnt, flock, fsck,
    152153        fsck.cramfs, fsck.minix, fsfreeze, fstrim, getopt, hardlink, hexdump, hwclock,
    153         ionice, ipcmk, ipcrm, ipcs, irqtop, isosize, kill, last,
     154        i386 (link to setarch), ionice, ipcmk, ipcrm, ipcs, irqtop, isosize, kill, last,
    154155        lastb (link to last), ldattach, linux32 (link to setarch), linux64 (link to setarch),
    155156        logger, look, losetup, lsblk, lscpu, lsipc, lsirq, lsfd, lslocks, lslogins,
     
    160161        swapoff, swapon, switch_root, taskset, uclampset, ul,
    161162        umount, uname26 (link to setarch), unshare, utmpdump, uuidd, uuidgen, uuidparse,
    162         wall, wdctl, whereis, wipefs, and zramctl</seg>
     163        wall, wdctl, whereis, wipefs, x86_64 (link to setarch), and zramctl</seg>
    163164        <seg>libblkid.so, libfdisk.so, libmount.so,
    164165        libsmartcols.so, and libuuid.so</seg>
     
    543544      </varlistentry>
    544545
     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
    545556      <varlistentry id="ionice">
    546557        <term><command>ionice</command></term>
     
    12941305      </varlistentry>
    12951306
     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
    12961317      <varlistentry id="zramctl">
    12971318        <term><command>zramctl</command></term>
  • chapter10/grub.xml

    r1ff846e2 r079ced7  
    1919  <note>
    2020    <para>
    21       This section assume your system has UEFI support and you wish to boot
    22       LFS with UEFI.
    23       If your system does not support UEFI or you don't want to use it,
    24       you'll need to figure out how to configure the booting process of
    25       the system on your own.
     21      If your system has UEFI support and you wish to boot LFS with UEFI,
     22      you should skip the instructions in this page but still learn the
     23      syntax of <filename>grub.cfg</filename> and the method to specify
     24      a partition in the file from this page, and configure GRUB with UEFI
     25      support using the instructions provided in
     26      <ulink url="&blfs-book;postlfs/grub-setup.html">the BLFS page</ulink>.
    2627    </para>
    2728  </note>
     
    3637    LILO.</para></warning>
    3738
    38     <para>Ensure that an emergency boot disk is ready to <quote>rescue</quote>
     39    <para> Ensure that an emergency boot disk is ready to <quote>rescue</quote>
    3940    the computer if the computer becomes unusable (un-bootable).  If you do not
    40     already have a boot device, you can create one.  To create a emergency
    41     boot device for UEFI, consult section <quote>Create an Emergency Boot
    42     Disk</quote> in
    43         <ulink url="&blfs-book;postlfs/grub-setup.html">the BLFS page</ulink>.</para>
    44 
    45   </sect2>
    46 
    47   <sect2>
    48     <title>Turn off Secure Boot</title>
    49 
    50     <para>LFS does not have the essential packages to support Secure Boot.
    51     To set up the boot process following the instructions in this section,
    52     Secure Boot must be turned off from the configuration interface of the
    53     firmware. Read the documentation provided by the manufacturer of your
    54     system to find out how.</para>
     41    already have a boot device, you can create one.  In order for the procedure
     42    below to work, you need to jump ahead to BLFS and install
     43    <userinput>xorriso</userinput> from the <ulink
     44    url="&blfs-book;multimedia/libisoburn.html">
     45    libisoburn</ulink> package.</para>
     46
     47<screen role="nodump"><userinput>cd /tmp
     48grub-mkrescue --output=grub-img.iso
     49xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso</userinput></screen>
     50
    5551  </sect2>
    5652
     
    7874    <title>Setting Up the Configuration</title>
    7975
    80     <para>GRUB works by creating an EFI executable in the EFI System
    81     Partition (ESP).  You can find the ESP with:</para>
    82 
    83 <screen role="nodump"><userinput>fdisk -l | grep 'EFI System'</userinput></screen>
    84 
    85     <para>If no ESP exists on your hard drive (for example, you are building
    86     LFS on a fresh new system with a Live CD as the host distro), read
    87     <ulink url="&blfs-book;postlfs/grub-setup.html">the BLFS page</ulink>
    88     for the instruction to create an ESP on your hard drive.</para>
    89 
    90     <para>If the ESP is not mounted at
    91     <filename class="directory">/boot/efi</filename> (in the chroot),
    92     mount it now:</para>
    93 
    94 <screen role="nodump"><userinput>mkdir -pv /boot/efi
    95 mount /boot/efi</userinput></screen>
    96 
    97     <note>
    98       <para>The path to the device node is intentionally omitted in the
    99       command.  We expect the entry for mounting the ESP to
    100       <filename class="directory">/boot/efi</filename> is already in
    101       <filename>/etc/fstab</filename>.  Add the entry before running the
    102       command if you forgot to create an entry for the ESP in
    103       <xref linkend="ch-bootable-fstab"/>.</para>
    104     </note>
     76    <para>GRUB works by writing data to the first physical track of the
     77    hard disk.  This area is not part of any file system.  The programs
     78    there access GRUB modules in the boot partition.  The default location
     79    is /boot/grub/.</para>
    10580
    10681    <para>The location of the boot partition is a choice of the user that
     
    127102
    128103    <para>Install the GRUB files into <filename
    129     class="directory">/boot/grub</filename> and the GRUB EFI executable into
    130     <filename>/boot/efi/EFI/BOOT/BOOTLOONGARCH64.EFI</filename>:</para>
     104    class="directory">/boot/grub</filename> and set up the boot track:</para>
    131105
    132106    <warning>
    133       <para>The following command will overwrite
    134       <filename>BOOTLOONGARCH64.EFI</filename>. Do not run the command if
    135       this is not desired, for example, if it contains a third party boot
    136       manager.  You can backup it with <command>cp</command> as it's a
    137       regular file.</para>
     107      <para>The following command will overwrite the current boot loader. Do not
     108      run the command if this is not desired, for example, if using a third party
     109      boot manager to manage the Master Boot Record (MBR).</para>
    138110    </warning>
    139111
    140 <screen role="nodump"><userinput>grub-install --removable</userinput></screen>
     112<screen role="nodump"><userinput>grub-install /dev/sda</userinput></screen>
    141113
    142114    <note>
    143       <para>
    144         <parameter>--removable</parameter> may seem strange here.  The UEFI
    145         firmware searches EFI executables for boot loaders in a hardcoded
    146         path, <filename>EFI/BOOT/BOOTLOONGARCH64.EFI</filename> in the ESP, and other
    147         boot loader paths listed in the EFI variables.  We've not installed
    148         the utilities for manipulating EFI variables so we need to install
    149         the EFI executable into the hardcoded path.  The hardcoded path is
    150         usually used by removable devices (for example, USB thumb devices)
    151         so the <command>grub-install</command> option for this purpose is
    152         named <parameter>--removable</parameter>.
    153       </para>
    154       <para>
    155         UEFI implementation usually prefers the boot loaders with paths
    156         recorded in an EFI variable, to the boot loader with the hardcoded
    157         search path.  You may need to invoke the boot device selection menu
    158         or setting interface of your EFI firmware on next boot to explicitly
    159         select the bootloader.
    160       </para>
    161       <para>
    162         Some UEFI implementation may completely skip the hardcoded path if
    163         there are other boot loaders in the same hard drive with paths
    164         recorded in an EFI variable.  Then you need to create an EFI
    165         variable for the newly installed boot loader.  Install
    166         <ulink url="&blfs-book;postlfs/efibootmgr.html">efibootmgr</ulink>,
    167         and follow
    168         <ulink url="&blfs-book;postlfs/grub-setup.html">the BLFS
    169         instruction</ulink> to run the <command>grub-install</command>
    170         command without the <parameter>--removable</parameter> option then.
    171       </para>
     115      <para>If the system has been booted using UEFI,
     116      <command>grub-install</command> will try to install files for the
     117      <emphasis>x86_64-efi</emphasis> target, but those files
     118      have not been installed in <xref linkend="chapter-building-system"/>.
     119      If this is the case, add <option>--target i386-pc</option> to the
     120      command above.</para>
    172121    </note>
    173122
     
    187136insmod ext2
    188137set root=(hd0,2)
    189 
    190 insmod all_video
    191138
    192139menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" {
  • chapter10/kernel.xml

    r1ff846e2 r079ced7  
    141141      <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    142142        href="kernel/systemd.xml"/>
     143   
     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"/>
    143160
    144161      <para>If the partition for the LFS system is in a NVME SSD (i. e. the
     
    257274
    258275      <varlistentry>
    259         <term><parameter>Enable the generic EFI decompressor</parameter></term>
    260         <listitem>
    261           <para>Create the bootable image as an EFI application that carries
    262           the actual kernel image in compressed form.  It can make the
    263           bootable image 50% smaller.</para>
    264         </listitem>
    265       </varlistentry>
    266 
    267       <varlistentry>
    268276        <term>
    269277          <parameter>
     
    278286          enabled, you should enable these two options as well or you'll see
    279287          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>
    280300        </listitem>
    281301      </varlistentry>
     
    336356    the filename should be <emphasis>vmlinuz</emphasis> to be compatible with
    337357    the automatic setup of the boot process described in the next section.  The
    338     following command assumes a LoongArch platform with an EFI boot loader
    339     (for example, GRUB built in &ch-final;):</para>
    340 
    341 <screen><userinput remap="install">cp -iv arch/loongarch/boot/vmlinuz.efi /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen>
     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>
    342361
    343362    <para><filename>System.map</filename> is a symbol file for the kernel.
  • chapter10/kernel/kernel-config.py

    r1ff846e2 r079ced7  
    2424if_stack = []
    2525
    26 expand_var_mp = { 'SRCARCH': 'loongarch' }
     26expand_var_mp = { 'SRCARCH': 'x86' }
    2727main_dep = {}
    2828
     
    171171            if line.startswith('source') or line.startswith('\tsource'):
    172172                sub = expand_var(line.strip().split()[1].strip('"'))
    173                 # Ugly.  TODO: remove once this is resolved in kernel.
    174                 if file[:4] == 'arch' and sub == 'drivers/firmware/Kconfig':
    175                     continue
    176173                r += load_kconfig(sub)
    177174            elif line.startswith('config') or line.startswith('menu'):
  • chapter10/kernel/systemd.xml

    r1ff846e2 r079ced7  
    1818  [ ] <emphasis role='blue'>C</emphasis>onfigure standard kernel features (expert users) ---&gt;            [EXPERT]
    1919
    20 <emphasis role='blue'>K</emphasis>ernel type and options ---&gt;
    21   [*] <emphasis role='blue'>R</emphasis>elocatable kernel                                           [RELOCATABLE]
    22   [*]   <emphasis role='blue'>R</emphasis>andomize the address of the kernel (KASLR)             [RANDOMIZE_BASE]
     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]
    2323
    2424<emphasis role='blue'>G</emphasis>eneral architecture-dependent options ---&gt;
  • chapter10/kernel/sysv.toml

    r1ff846e2 r079ced7  
    1515DRM=' *M'
    1616
    17 EFI_ZBOOT='*'
    18 
    1917revision='sysv'
    2018
  • chapter10/kernel/sysv.xml

    r1ff846e2 r079ced7  
    1515  [ ] <emphasis role='blue'>C</emphasis>onfigure standard kernel features (expert users) ---&gt;            [EXPERT]
    1616
    17 <emphasis role='blue'>K</emphasis>ernel type and options ---&gt;
    18   [*] <emphasis role='blue'>R</emphasis>elocatable kernel                                           [RELOCATABLE]
    19   [*]   <emphasis role='blue'>R</emphasis>andomize the address of the kernel (KASLR)             [RANDOMIZE_BASE]
     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]
    2020
    2121<emphasis role='blue'>G</emphasis>eneral architecture-dependent options ---&gt;
     
    2929    [*]   <emphasis role='blue'>A</emphasis>utomount devtmpfs at /dev, after the kernel mounted the rootfs
    3030                                                           ...  [DEVTMPFS_MOUNT]
    31   <emphasis role='blue'>F</emphasis>irmware Drivers ---&gt;
    32     <emphasis role='blue'>E</emphasis>FI (Extensible Firmware Interface) Support ---&gt;
    33       [*] <emphasis role='blue'>E</emphasis>nable the generic EFI decompressor                        [EFI_ZBOOT]
    3431  <emphasis role='blue'>G</emphasis>raphics support ---&gt;
    3532    &lt; /*/M&gt; <emphasis role='blue'>D</emphasis>irect Rendering Manager (XFree86 4.1.0 and higher DRI support) ---&gt;
  • general.ent

    r1ff846e2 r079ced7  
    9393<!ENTITY secadv          "&lfs-root;lfs/advisories/">
    9494
    95 <!ENTITY min-kernel      "5.19">
     95<!-- 4.19 EOL is Dec 2024
     96     so for LFS 12.3 we may consider moving to 5.4 -->
     97<!ENTITY min-kernel      "4.19">
    9698
    9799<!--
     
    140142<!ENTITY % patches-entities SYSTEM "patches.ent">
    141143%patches-entities;
    142 
    143 <!ENTITY update-config-text
    144   "<para>Update the auxilary scripts of the building system to allow
    145    building this package for LoongArch:</para>">
    146 
    147 <!-- Use "tar &update-config-arg" or "tar -C build-aux update-config-arg"
    148      We cannot append -C build-aux after these arguments because -C only
    149      affects options that follow.  -->
    150 <!ENTITY update-config-arg
    151   "-xvf ../autoconf-&autoconf-version;.tar.xz --strip-components=2 \
    152     autoconf-&autoconf-version;/build-aux/config.{guess,sub}">
  • git-version.sh

    r1ff846e2 r079ced7  
    5252full_date="$month $day$suffix, $year"
    5353
    54 sha="$(git describe --abbrev=1 --match='xry111/loongarch-r*')"
    55 rev=$(echo "$sha" | sed 's/-g[^-]*$//; s|^xry111/||')
     54sha="$(git describe --abbrev=1)"
     55rev=$(echo "$sha" | sed 's/-g[^-]*$//')
    5656version="$rev"
    5757versiond="$rev-systemd"
  • prologue/architecture.xml

    r1ff846e2 r079ced7  
    1111  <title>LFS Target Architectures</title>
    1212
    13 <para>The primary target architectures of this LFS edition are LoongArch
    14 CPUs.
    15 <!--On the other hand, the instructions in this book are
    16 also known to work, with some modifications, with the Power PC and ARM
    17 CPUs. -->
    18 To build a system that utilizes one of these CPUs, the main prerequisite, in
     13<para>The primary target architectures of LFS are the AMD/Intel x86 (32-bit)
     14and x86_64 (64-bit) CPUs.  On the other hand, the instructions in this book are
     15also known to work, with some modifications, with the Power PC and ARM CPUs. To
     16build a system that utilizes one of these alternative CPUs, the main prerequisite, in
    1917addition to those on the next page, is an existing Linux system such as an
    20 earlier LFS installation, Loong Arch Linux, CLFS for LoongArch, Gentoo,
    21 Slackware, or other distribution that targets LoongArch.</para>
     18earlier LFS installation, Ubuntu, Red Hat/Fedora, SuSE, or some other distribution
     19that targets that architecture. (Note that a 32-bit
     20distribution can be installed and used as a host system on a 64-bit AMD/Intel
     21computer.)</para>
    2222
    23 <para>The build that results from this LFS edition is a
    24 <quote>pure</quote> lp64d system. That is, it supports executables with
    25 the lp64d ABI
     23<para>The gain from building on a 64-bit system, as
     24compared to a 32-bit system, is minimal.
     25For example, in a test build of LFS-9.1 on a Core i7-4790 CPU based system,
     26using 4 cores, the following statistics were measured:</para>
     27
     28<screen><computeroutput>Architecture Build Time     Build Size
     2932-bit       239.9 minutes  3.6 GB
     3064-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
     34server, or a firewall, a 32-bit CPU may be good enough. On the other
     35hand, several packages in BLFS now need more than 4 GB of RAM to be built
     36and/or to run; if you plan to use LFS as a desktop, the LFS authors
     37recommend 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
    2641only. Building a <quote>multi-lib</quote> system requires compiling many
    27 applications multiple times, once for each ABI to be supported.
     42applications twice, once for a 32-bit system and once for a 64-bit system.
    2843This is not directly supported in LFS because it would interfere with the
    2944educational objective of providing the minimal instructions needed for a
     
    3146of LFS, accessible at <ulink
    3247url="https://www.linuxfromscratch.org/~thomas/multilib/index.html"/>. But
    33 the multilib edition is for x86_64, and multilib is an advanced topic
    34 anyway.</para>
     48that's an advanced topic.</para>
    3549
    3650</sect1>
  • prologue/bookinfo.xml

    r1ff846e2 r079ced7  
    5050    Linus Torvalds.</para>
    5151
    52     <para><trademark class='registered'>LoongArch</trademark> is a
    53     registered trademark of Loongson Technology Co., Ltd.</para>
    5452  </legalnotice>
    5553
Note: See TracChangeset for help on using the changeset viewer.