Opened 9 years ago

Last modified 8 years ago

#1098 new task

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 (4)

comment:1 by chris@…, 9 years ago

Milestone: CLFS Standard 3.1.0
Priority: majorminor

comment:2 by chris@…, 9 years ago

Priority: minortrivial

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 by William Harrington, 8 years ago

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 by chris@…, 8 years ago

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.