Changeset 943f225


Ignore:
Timestamp:
01/21/2024 04:27:45 PM (3 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
12.1, 12.1-rc1, multilib, trunk, xry111/arm64, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.1, xry111/mips64el, xry111/update-glibc
Children:
0253841d
Parents:
d282f88
git-author:
Xi Ruoyao <xry111@…> (01/19/2024 04:57:51 AM)
git-committer:
Xi Ruoyao <xry111@…> (01/21/2024 04:27:45 PM)
Message:

ncurses: Use symlinks instead of linker scripts

The effect will not change, but with symlinks ld can save some time
invoking open(), read(), etc. syscalls and parsing the linker scripts.

Note that I've also removed "libcursesw" symlink because this library
has never existed. Instead libcurses.so is created as a symlink
direct to libncursesw.so.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chapter06/ncurses.xml

    rd282f88 r943f225  
    157157
    158158<screen><userinput remap="install">make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
    159 echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so
     159ln -sv libncursesw.so $LFS/usr/lib/libncurses.so
    160160sed -e 's/^#if.*XOPEN.*$/#if 1/' \
    161161    -i $LFS/usr/include/curses.h</userinput></screen>
     
    179179
    180180      <varlistentry>
    181         <term><command>echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so</command></term>
     181        <term><command>ln -sv libncursesw.so $LFS/usr/lib/libncurses.so</command></term>
    182182        <listitem>
    183183          <para>The <filename>libncurses.so</filename> library is needed by
    184           a few packages we will build soon. We create this small linker
    185           script, as this is what is done in <xref
    186           linkend="chapter-building-system"/>.</para>
     184          a few packages we will build soon. We create this symlink to use
     185          <filename>libncursesw.so</filename> as a replacement.</para>
    187186        </listitem>
    188187      </varlistentry>
  • chapter08/ncurses.xml

    rd282f88 r943f225  
    145145
    146146    <para>Many applications still expect the linker to be able to find
    147     non-wide-character Ncurses libraries. Trick such applications into linking with
    148     wide-character libraries by means of symlinks and linker scripts:</para>
     147    non-wide-character Ncurses libraries. Trick such applications into
     148    linking with wide-character libraries by means of symlinks
     149    (note that the <filename class='extension'>.so</filename> links are
     150    only safe with <filename>curses.h</filename> edited to always use the
     151    wide-character ABI):</para>
    149152
    150153<screen><userinput remap="install">for lib in ncurses form panel menu ; do
    151     rm -vf                    /usr/lib/lib${lib}.so
    152     echo "INPUT(-l${lib}w)" &gt; /usr/lib/lib${lib}.so
    153     ln -sfv ${lib}w.pc        /usr/lib/pkgconfig/${lib}.pc
     154    ln -sfv lib${lib}w.so /usr/lib/lib${lib}.so
     155    ln -sfv ${lib}w.pc    /usr/lib/pkgconfig/${lib}.pc
    154156done</userinput></screen>
    155157
     
    158160    buildable:</para>
    159161
    160 <screen><userinput remap="install">rm -vf                     /usr/lib/libcursesw.so
    161 echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so
    162 ln -sfv libncurses.so      /usr/lib/libcurses.so</userinput></screen>
     162<screen><userinput remap="install">ln -sfv libncursesw.so /usr/lib/libcurses.so</userinput></screen>
    163163
    164164    <para>If desired, install the Ncurses documentation:</para>
     
    212212        </seg>
    213213        <seg>
    214            libcursesw.so (symlink and linker script to libncursesw.so),
     214           libcurses.so (symlink),
     215           libform.so (symlink),
    215216           libformw.so,
     217           libmenu.so (symlink),
    216218           libmenuw.so,
     219           libncurses.so (symlink),
    217220           libncursesw.so,
    218221           libncurses++w.so,
    219            libpanelw.so, and their non-wide-character counterparts without "w"
    220               in the library names.</seg>
     222           libpanel.so (symlink),
     223           and libpanelw.so,
     224        </seg>
    221225        <seg>
    222226           /usr/share/tabset,
Note: See TracChangeset for help on using the changeset viewer.