Ticket #1098 (new task)

Opened 2 years ago

Last modified 6 months ago

Remove extra /lib64, /libx32 references from ldconfig for Pure64

Reported by: chris@… Owned by: clfs-commits@…
Priority: trivial Milestone: CLFS Standard 3.1.0
Component: BOOK Version:
Keywords: Cc: berzerkula@…, jonathan@…, chris@…, cross-lfs@…

Description

ldconfig still has references to other dynamic linker locations in /lib64 and /libx32. These can be removed with this command:

sed -e 's/lib64/lib/' -e '/ld-linux\(-x32\|\.so\)/d' -i sysdeps/unix/sysv/linux/x86_64/ldconfig.h

Also it add those dirs to its default search locations, with these lines:

      add_system_dir (SLIBDIR);
      if (strcmp (SLIBDIR, LIBDIR))
        add_system_dir (LIBDIR);

Apparently LIBDIR and/or SLIBDIR is set elsewhere, but I couldn't find where. I'd prefer if we can find where it's getting those from, but if not, those lines can just be removed:

sed -e '/LIBDIR/d' -i elf/ldconfig.c

Change History

comment:1 Changed 21 months ago by chris@…

  • Priority changed from major to minor
  • Milestone set to CLFS Standard 3.1.0

comment:2 Changed 21 months ago by chris@…

  • Priority changed from minor to trivial

After some further testing, it seems that sed which removes the LIBDIR lines causes ldconfig to basically do nothing, as it's left with no directories at all in its search path. A much better solution to prevent the extra dirs from being added to ldconfig's search path is to use this command:

sed -i '/\/lib64/,+10d' ${srcdir}/sysdeps/unix/sysv/linux/x86_64/dl-cache.h

comment:3 Changed 6 months ago by kb0iic

So with the sed Chris provided we have this with glibc 2.25:

Temp system pure 64bit:

/tools/sbin/ldconfig: Can't stat /tools/lib64: No such file or directory
/tools/sbin/ldconfig: Can't stat /tools/libx32: No such file or directory

Final system pure 64bit:

/sbin/ldconfig: Can't stat /opt/lib: No such file or directory
/sbin/ldconfig: Can't stat /lib64: No such file or directory
/sbin/ldconfig: Can't stat /libx32: No such file or directory
/sbin/ldconfig: Can't stat /usr/lib64: No such file or directory
/sbin/ldconfig: Can't stat /usr/libx32: No such file or directory

comment:4 Changed 6 months ago by chris@…

I use these commands for the final-system Pure64 Glibc:

sed -i 's/memcpy.*dir.*/&\nadd_dir (path); \\\n} while (0)\n#define unused_var \\/' sysdeps/unix/sysv/linux/x86_64/dl-cache.h
sed -e 's/lib64/lib/' -e '/ld-linux\(-x32\|\.so\)/d' -i sysdeps/unix/sysv/linux/x86_64/ldconfig.h
Note: See TracTickets for help on using tickets.