Changeset 460f575 for chapter08


Ignore:
Timestamp:
02/25/2022 08:47:36 PM (2 years ago)
Author:
William Harrington <kb0iic@…>
Branches:
arm
Children:
9c0b35a
Parents:
b0a6b0c
Message:

Initial LFS-ARM book.

Location:
chapter08
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • chapter08/adjusting.xml

    rb0a6b0c r460f575  
    5353  platform-specific differences in the dynamic linker name):</para>
    5454
    55 <screen os="c"><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
     55<screen os="c"><computeroutput>[Requesting program interpreter: /lib/ld-linux-aarch64.so.1]</computeroutput></screen>
    5656
    5757  <para>Note that on 64-bit systems <filename class="directory">/lib</filename> is
     
    6060
    6161  <note><para>On 32-bit systems the interpreter should be
    62   /lib/ld-linux.so.2.</para></note>
     62  /lib/ld-linux-armhf.so.3.</para></note>
    6363
    6464  <para os="d">Now make sure that we're setup to use the correct start files:</para>
     
    8080
    8181<screen><computeroutput>#include &lt;...&gt; search starts here:
    82  /tools/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include
     82 /tools/lib/gcc/aarch64-pc-linux-gnu/&gcc-version;/include
    8383 /tools/include
    84  /tools/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed
     84 /tools/lib/gcc/aarch64-pc-linux-gnu/&gcc-version;/include-fixed
    8585 /usr/include</computeroutput></screen>
    8686
    87   <note><para>On a 32 bit system, x86_64 is replaced with i686.</para></note>
     87  <note><para>On a 32 bit system, aarch64 is replaced with an ARM 32bit variant.</para></note>
    8888
    8989  <para os="i">Next, verify that the new linker is being used with the correct search paths:</para>
     
    112112  platform-specific differences in dynamic linker name):</para>
    113113
    114 <screen os="s"><computeroutput>found ld-linux-x86-64.so.2 at /usr/lib/ld-linux-x86-64.so.2</computeroutput></screen>
     114<screen os="s"><computeroutput>found ld-linux-aarch64.so.1 at /usr/lib/ld-linux-aarch64.so.1</computeroutput></screen>
    115115
    116116  <para os="t">If the output does not appear as shown above or is not received
  • chapter08/binutils.xml

    rb0a6b0c r460f575  
    7272find -name \*.1 -delete</userinput></screen>
    7373-->
    74 
    75     <para>
    76       Now make a fix identified upstream that affects building some packages:
    77      </para>
    78 
    79 <screen><userinput remap="pre">sed -e '/R_386_TLS_LE /i \   || (TYPE) == R_386_TLS_IE \\' \
    80     -i ./bfd/elfxx-x86.h</userinput></screen>
    81 
     74<!--
     75    <para>Now remove one test that prevents the tests from running
     76    to completion:</para>
     77
     78<screen><userinput remap="pre">sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in</userinput></screen>
     79-->
    8280    <para>The Binutils documentation recommends building Binutils
    8381    in a dedicated build directory:</para>
     
    153151          ultimately be located) is set to <filename
    154152          class="directory">$(exec_prefix)/$(target_alias)</filename>. For
    155           example, x86_64 machines would expand that to <filename
    156           class="directory">/usr/x86_64-pc-linux-gnu</filename>. Because this is
    157           a custom system, this target-specific directory in <filename
     153          example, aarch64 machines would expand that to <filename
     154          class="directory">/usr/aarch64-unknown-linux-gnu</filename>. Because
     155          this is a custom system, this target-specific directory in <filename
    158156          class="directory">/usr</filename> is not required. <filename
    159157          class="directory">$(exec_prefix)/$(target_alias)</filename> would be
  • chapter08/chapter08.xml

    rb0a6b0c r460f575  
    3535  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpfr.xml"/>
    3636  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpc.xml"/>
     37  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="isl.xml"/>
    3738  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="attr.xml"/>
    3839  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="acl.xml"/>
  • chapter08/expect.xml

    rb0a6b0c r460f575  
    5151    <para>Prepare Expect for compilation:</para>
    5252
    53 <screen><userinput remap="configure">./configure --prefix=/usr           \
    54             --with-tcl=/usr/lib     \
    55             --enable-shared         \
    56             --mandir=/usr/share/man \
    57             --with-tclinclude=/usr/include</userinput></screen>
     53<screen><userinput remap="configure">./configure --prefix=/usr                   \
     54            --with-tcl=/usr/lib            \
     55            --enable-shared                \
     56            --mandir=/usr/share/man        \
     57            --with-tclinclude=/usr/include \
     58            --build=$(uname -m)-unknown-linux-gnu</userinput></screen>
    5859
    5960    <variablelist>
     
    7475          <para>This explicitly tells Expect where to find Tcl's internal
    7576          headers.</para>
     77        </listitem>
     78      </varlistentry>
     79
     80      <varlistentry>
     81        <term><parameter>--build=$(uname -m)-uknown-linux-gnu</parameter></term>
     82        <listitem>
     83          <para>This tells Expect what the architecture build of the machine
     84          is for ARM.</para>
    7685        </listitem>
    7786      </varlistentry>
  • chapter08/findutils.xml

    rb0a6b0c r460f575  
    4747
    4848<screen><userinput remap="configure">case $(uname -m) in
    49     i?86)  TIME_T_32_BIT_OK=yes ./configure --prefix=/usr --localstatedir=/var/lib/locate ;;
    50     x86_64) ./configure --prefix=/usr --localstatedir=/var/lib/locate ;;
     49        arm) TIME_T_32_BIT_OK=yes ./configure --prefix=/usr --localstatedir=/var/lib/locate ;;
     50    aarch64) ./configure --prefix=/usr --localstatedir=/var/lib/locate ;;
    5151esac</userinput></screen>
    52 
    5352    <variablelist>
    5453      <title>The meaning of the configure options:</title>
  • chapter08/gcc.xml

    rb0a6b0c r460f575  
    5050    -i libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp</userinput></screen>
    5151
    52     <para>If building on x86_64, change the default directory name for 64-bit
     52    <para>If building on aarch64, change the default directory name for 64-bit
    5353    libraries to <quote>lib</quote>:</para>
    5454
    5555<screen><userinput remap="pre">case $(uname -m) in
    56   x86_64)
    57     sed -e '/m64=/s/lib64/lib/' \
    58         -i.orig gcc/config/i386/t-linux64
     56  aarch64)
     57    sed -e '/mabi.lp64=/s/lib64/lib/' \
     58        -i.orig gcc/config/aarch64/t-aarch64-linux
    5959  ;;
    6060esac</userinput></screen>
     
    222222    xpointer="xpointer(//*[@os='f'])"/>
    223223
    224 <screen><computeroutput>/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded
    225 /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
    226 /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
     224<screen><computeroutput>/usr/lib/gcc/aarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded
     225/usr/lib/gcc/aarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
     226/usr/lib/gcc/aarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
    227227
    228228  <para>Depending on your machine architecture, the above may differ slightly.
     
    244244
    245245<screen><computeroutput>#include &lt;...&gt; search starts here:
    246  /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include
     246 /usr/lib/gcc/aarch-64-unknown-linux-gnu/&gcc-version;/include
    247247 /usr/local/include
    248  /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed
     248 /usr/lib/gcc/aarch64-unknown-linux-gnu/&gcc-version;/include-fixed
    249249 /usr/include</computeroutput></screen>
    250250
     
    264264    xpointer="xpointer(//*[@os='k'])"/>
    265265
    266 <screen><computeroutput>SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
     266<screen><computeroutput>SEARCH_DIR("/usr/aarch64-unknown-linux-gnu/lib64")
    267267SEARCH_DIR("/usr/local/lib64")
    268268SEARCH_DIR("/lib64")
    269269SEARCH_DIR("/usr/lib64")
    270 SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
     270SEARCH_DIR("/usr/aarch64-unknown-linux-gnu/lib")
    271271SEARCH_DIR("/usr/local/lib")
    272272SEARCH_DIR("/lib")
     
    274274
    275275   <para>A 32-bit system may see a few different directories. For example, here
    276    is the output from an i686 machine:</para>
    277 
    278 <screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32")
    279 SEARCH_DIR("/usr/local/lib32")
    280 SEARCH_DIR("/lib32")
    281 SEARCH_DIR("/usr/lib32")
    282 SEARCH_DIR("/usr/i686-pc-linux-gnu/lib")
     276   is the output from a 32bit ARM  machine:</para>
     277
     278<screen><computeroutput>SEARCH_DIR("/usr/armv6l-unknown-linux-gnueabihf/lib")
    283279SEARCH_DIR("/usr/local/lib")
    284280SEARCH_DIR("/lib")
     
    352348        libgcc_s.so, libgcov.a, libgomp.{a,so}, libitm.{a,so},
    353349        liblsan.{a,so}, liblto_plugin.so,
    354         libquadmath.{a,so}, libssp.{a,so}, libssp_nonshared.a,
     350        libssp.{a,so}, libssp_nonshared.a,
    355351        libstdc++.{a,so}, libstdc++fs.a, libsupc++.a, libtsan.{a,so},
    356352        and libubsan.{a,so}</seg>
  • chapter08/glibc.xml

    rb0a6b0c r460f575  
    5050    -i sysdeps/unix/sysv/linux/mq_notify.c</userinput></screen>
    5151-->
     52
    5253    <para>Some of the Glibc programs use the non-FHS compliant
    5354    <filename class="directory">/var/db</filename> directory to store
     
    140141<!-- Use remap="make" here to work around a jhalfs issue. -->
    141142<!--<screen><userinput remap="make">case $(uname -m) in
    142   i?86)   ln -sfnv $PWD/elf/ld-linux.so.2        /lib ;;
    143   x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;;
     143  arm*)   ln -sfnv $PWD/elf/ld-linux-armhf.so.3        /lib ;;
     144  aarch64) ln -sfnv $PWD/elf/ld-linux-aarch64.so.1 /lib ;;
    144145esac</userinput></screen>
    145146
     
    434435
    435436    <para>By default, the dynamic loader (<filename
    436     class="libraryfile">/lib/ld-linux.so.2</filename>) searches through
     437    class="libraryfile">/lib/ld-linux-armhf.so.3
     438    /lib/ld-linux-aarch64.so.1</filename>) searches through
    437439    <filename class="directory">/lib</filename> and <filename
    438440    class="directory">/usr/lib</filename> for dynamic libraries that are
     
    483485        <seg>gencat, getconf, getent, iconv, iconvconfig, ldconfig,
    484486        ldd, lddlibc4,
    485         ld.so (symlink to ld-linux-x86-64.so.2 or ld-linux.so.2),
    486         locale, localedef, makedb, mtrace, nscd,
     487        locale, localedef, makedb, mtrace, ncsd,
    487488        pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace,
    488489        zdump, and zic</seg>
    489         <seg>ld-linux-x86-64.so.2, ld-linux.so.2,
     490        <seg>ld-linux-aarch64.so.1 or ld-linux{,-armhf}.so.3,
    490491        libBrokenLocale.{a,so}, libanl.{a,so},
    491492        libc.{a,so}, libc_nonshared.a, libc_malloc_debug.so,
  • chapter08/gmp.xml

    rb0a6b0c r460f575  
    4343
    4444    <note>
    45       <para>If you are building for 32-bit x86, but you have a CPU which is
     45      <para>If you are building for 32-bit arm, but you have a CPU which is
    4646      capable of running 64-bit code <emphasis>and</emphasis> you have specified
    4747      <envar>CFLAGS</envar> in the environment, the configure script will
     
    107107    applications using the gmp libraries with the message "Illegal
    108108    instruction".  In this case, gmp should be reconfigured with the option
    109     --build=x86_64-pc-linux-gnu and rebuilt.</para></caution>
     109    --build=aarch64-unknown-linux-gnu and rebuilt.</para></caution>
    110110
    111111    <para>Ensure that all 197 tests in the test suite passed.
  • chapter08/grub.xml

    rb0a6b0c r460f575  
    5151    </note>
    5252
     53    <note>
     54      <para>
     55        GRUB2 with EFI support can be used with some devices, like the
     56        Odroid-C2, and maybe others. Two stage loading is done where the
     57        first grub.cfg can be found by U-boot, and act as a pointer to
     58        the real grub.cfg with the menu. More info may be found at
     59        <ulink url="http://rglinuxtech.com/?p=2595">this page</ulink>.
     60      </para>
     61    </note>
     62
    5363    <para>Prepare GRUB for compilation:</para>
    5464
  • chapter08/libcap.xml

    rb0a6b0c r460f575  
    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 aarch64. It has no effect on
     63          arm.</para>
    6464        </listitem>
    6565      </varlistentry>
  • chapter08/libffi.xml

    rb0a6b0c r460f575  
    7070          system, use the less capable system as a parameter. For details
    7171          about alternative system types, see <ulink
    72           url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/x86-Options.html'>
    73           the x86 options in the GCC manual</ulink>.</para>
     72          url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/ARM-Options.html'>
     73          the ARM options in the GCC manual</ulink>.</para>
    7474        </listitem>
    7575      </varlistentry>
  • chapter08/readline.xml

    rb0a6b0c r460f575  
    5252    <para>Prepare Readline for compilation:</para>
    5353
    54 <screen><userinput remap="configure">./configure --prefix=/usr    \
     54    <screen><userinput remap="configure">./configure --prefix=/usr    \
     55            --disable-bracketed-paste-default \
    5556            --disable-static \
    5657            --with-curses    \
     
    6768               termcap library. It allows generating a correct
    6869               <filename>readline.pc</filename> file.</para>
     70        </listitem>
     71      </varlistentry>
     72
     73      <varlistentry>
     74        <term><parameter>--disable-bracketed-paste-default</parameter></term>
     75        <listitem>
     76          <para>Bracketed paste mode is enabled by default. Set this default
     77                  to off. Omit this configure option if bracketed paste is
     78                  desired.</para>
    6979        </listitem>
    7080      </varlistentry>
  • chapter08/stripping.xml

    rb0a6b0c r460f575  
    4141  rationale to use the <command>install</command> command here.</para>
    4242
    43   <note><para>The ELF loader's name is ld-linux-x86-64.so.2 on 64-bit systems
    44   and ld-linux.so.2 on 32-bit systems.  The contruct below selects the
     43  <note><para>The ELF loader's name is ld-linux-aarch64.so.1 on 64-bit systems
     44  and ld-linux-armhf.so.3 on 32-bit systems.  The contruct below selects the
    4545  correct name for the current architecture.</para></note>
    4646
     
    5151             libc.so.6
    5252             libthread_db.so.1
    53              libquadmath.so.&libquadmath-version;
    5453             libstdc++.so.&libstdcpp-version;
    5554             libitm.so.&libitm-version;
  • chapter08/tcl.xml

    rb0a6b0c r460f575  
    6565./configure --prefix=/usr           \
    6666            --mandir=/usr/share/man \
    67             $([ "$(uname -m)" = x86_64 ] &amp;&amp; echo --enable-64bit)</userinput></screen>
     67            $([ "$(uname -m)" = aarch64 ] &amp;&amp; echo --enable-64bit)</userinput></screen>
    6868
    6969    <variablelist>
     
    7171
    7272      <varlistentry>
    73         <term><parameter>$([ "$(uname -m)" = x86_64 ] &amp;&amp; echo --enable-64bit)</parameter></term>
     73        <term><parameter>$([ "$(uname -m)" = aarch64 ] &amp;&amp; echo --enable-64bit)</parameter></term>
    7474        <listitem>
    7575          <para>The construct <parameter>$(&lt;shell command&gt;)</parameter>
  • chapter08/util-linux.xml

    rb0a6b0c r460f575  
    512512      </varlistentry>
    513513
    514       <varlistentry id="i386">
    515         <term><command>i386</command></term>
    516         <listitem>
    517           <para>A symbolic link to setarch</para>
    518           <indexterm zone="ch-system-util-linux i386">
    519             <primary sortas="b-i386">i386</primary>
    520           </indexterm>
    521         </listitem>
    522       </varlistentry>
    523 
    524514      <varlistentry id="ionice">
    525515        <term><command>ionice</command></term>
     
    12601250      </varlistentry>
    12611251
    1262       <varlistentry id="x86_64">
    1263         <term><command>x86_64</command></term>
    1264         <listitem>
    1265           <para>A symbolic link to setarch</para>
    1266           <indexterm zone="ch-system-util-linux x86_64">
    1267             <primary sortas="b-x86_64">x86_64</primary>
    1268           </indexterm>
    1269         </listitem>
    1270       </varlistentry>
    1271 
    12721252      <varlistentry id="zramctl">
    12731253        <term><command>zramctl</command></term>
Note: See TracChangeset for help on using the changeset viewer.