Changeset 0ebda11 for chapter05


Ignore:
Timestamp:
05/14/2021 10:47:43 AM (3 years ago)
Author:
Thomas Trepl (Moody) <thomas@…>
Branches:
ml-11.0, multilib
Children:
2606939
Parents:
51c01bff
Message:

Remove entities for multilib pathes
Add usage of libc_cv_rtlddir

Location:
chapter05
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chapter05/gcc-pass1.xml

    r51c01bff r0ebda11  
    7979
    8080<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
    81     -e '/m32=/s/m32=.*/m32=..\&lib-m32;$(call if_multiarch,:i386-linux-gnu)/' \
     81    -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \
    8282    -i.orig gcc/config/i386/t-linux64
    8383</userinput></screen>
  • chapter05/glibc.xml

    r51c01bff r0ebda11  
    8484      --enable-kernel=&min-kernel;                \
    8585      --with-headers=$LFS/usr/include    \
    86       libc_cv_slibdir=/usr/lib</userinput></screen>
     86      libc_cv_slibdir=/usr/lib           \
     87      libc_cv_rtlddir=/usr/lib</userinput></screen>
    8788<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure                             \
    8889      --prefix=/usr                      \
     
    9293      --with-headers=$LFS/usr/include    \
    9394      --enable-multi-arch                \
    94       libc_cv_slibdir=/usr/lib</userinput></screen>
     95      libc_cv_slibdir=/usr/lib           \
     96      libc_cv_rtlddir=/usr/lib</userinput></screen>
    9597
    9698    <variablelist>
     
    130132          <para>This ensures that the library is installed in /usr/lib instead
    131133          of the default /lib64 on 64 bit machines.</para>
     134        </listitem>
     135      </varlistentry>
     136
     137      <varlistentry>
     138        <term><parameter>libc_cv_rtlddir=/usr/lib</parameter></term>
     139        <listitem>
     140          <para>Fix hardcoded path to the executable loader in the
     141            <command>ldd</command> script.</para>
    132142        </listitem>
    133143      </varlistentry>
     
    197207    </variablelist>
    198208
     209    <!--
     210      The /usr which gets removed from the RTLDLIST by the sed
     211      below is set by the libc_cv_rtlddir=/usr/lib above. When
     212      changing the libc_cv_rtlddir to /lib, the content of the
     213      ldd script does not need to be patched, but some other
     214      symlinks created by glibc itself will be not that correct
     215      and needs to be fixed by other symlinks.
     216
     217      First setting /usr and than removing /usr seems strange,
     218      but it looks like that libc_cv_rtlddir has more effect than
     219      only the pathes in ldd (it has influence on which symlinks
     220      to the loader are created where) and makes the handling
     221      in a multilib environment much easier.
     222      To me, it feels better to go the way with adding/removing
     223      /usr than to introduce a symlink hell.
     224     
     225      Another option to get ldd working properly is to set a
     226      symlink as "ln -svf lib /usr/lib64" but it has been reported
     227      that we used that already years ago but dropped it since
     228      libtool will complain sometimes with "library has been moved"
     229      warnings.
     230      Don't know if this is still the case - if not, this one
     231      symlink seems to be the cleanest way and the sed on ldd will
     232      be obsolete.
     233    -->
     234    <para>Fix hardcoded path to the executable loader in
     235    <command>ldd</command> script:</para>
     236
     237<screen><userinput remap="install">sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd</userinput></screen>
     238
    199239    <caution>
    200240      <para>At this point, it is imperative to stop and ensure that the basic
     
    246286
    247287    <para>Now recompile for m32. The extracted source can be
    248     reused but needs to cleaned before installing the m32
     288    reused but needs to be cleaned before installing the m32
    249289    version of Glibc.</para>
    250290
     
    266306      --with-headers=$LFS/usr/include    \
    267307      --enable-multi-arch                \
    268       --libdir=&usr-lib-m32;                \
    269       --libexecdir=&usr-lib-m32;            \
    270       libc_cv_slibdir=&usr-lib-m32;</userinput></screen>
     308      --libdir=/usr/lib32                \
     309      --libexecdir=/usr/lib32            \
     310      libc_cv_slibdir=/usr/lib32           \
     311      libc_cv_rtlddir=/usr/lib32</userinput></screen>
    271312
    272313    <para>Compile the package:</para>
     
    277318
    278319<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
    279 cp -a DESTDIR&usr-lib-m32; $LFS/usr/
     320cp -a DESTDIR/usr/lib32 $LFS/usr/
    280321install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
    281322               $LFS/usr/include/gnu/
    282 ln -svf ..&lib-m32;/ld-linux.so.2 $LFS/lib/ld-linux.so.2</userinput></screen>
     323ln -svf ../lib32/ld-linux.so.2 $LFS/lib/ld-linux.so.2</userinput></screen>
     324
    283325
    284326    <caution>
     
    317359
    318360    <para>Now recompile for mx32. The extracted source can be
    319     reused but needs to cleaned before installing the mx32
     361    reused but needs to be cleaned before installing the mx32
    320362    version of Glibc.</para>
    321363
     
    337379      --with-headers=$LFS/usr/include    \
    338380      --enable-multi-arch                \
    339       --libdir=&usr-lib-mx32;               \
    340       --libexecdir=&usr-lib-mx32;           \
    341       libc_cv_slibdir=&usr-lib-mx32;</userinput></screen>
     381      --libdir=/usr/libx32               \
     382      --libexecdir=/usr/libx32           \
     383      libc_cv_slibdir=/usr/libx32           \
     384      libc_cv_rtlddir=/usr/libx32</userinput></screen>
    342385
    343386    <para>Compile the package:</para>
     
    348391
    349392<screen><userinput remap="install">make DESTDIR=$PWD/DESTDIR install
    350 cp -a DESTDIR&usr-lib-mx32; $LFS/usr/
     393cp -a DESTDIR/usr/libx32 $LFS/usr/
    351394install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-x32.h \
    352395               $LFS/usr/include/gnu/
    353 ln -svf ..&lib-mx32;/ld-linux-x32.so.2 $LFS/lib/ld-linux-x32.so.2</userinput></screen>
     396ln -svf ../libx32/ld-linux-x32.so.2 $LFS/lib/ld-linux-x32.so.2</userinput></screen>
    354397
    355398    <caution>
Note: See TracChangeset for help on using the changeset viewer.