Opened 17 years ago

Closed 17 years ago

#1770 closed defect (fixed)

Issue when reinstalling Readline

Reported by: manuel@… Owned by: lfs-book@…
Priority: normal Milestone: 6.2
Component: Book Version: SVN
Severity: minor Keywords:


Doing several LFS builds to test the ICA/farce support in jhalfs, I noticed that when reinstalling Readline the existent /lib/lib{history,readline}.so.5.1 libraries are renamed to /lib/lib{history,readline}.so.5.1.old AND the symliks /lib/lib{history,readline}.so.5 are changed to to point to that /lib/lib{history,readline}.so.5.1.old libraries instead to point to the newly installed /lib/lib{history,readline}.so.5.1 ones.

That meant that the symlinks /usr/lib/lib{history,readline}.so that we create pointing to ../../lib/lib{history,readline}.so.5 in fact will point also to that "old" libraries.

That has been confirmed by others folks. The lfs-dev thread start here:

I think that we should to add a similar note to the current one for Bzip2 saying that if reinstalling Readline a "rm -f /lib/lib{history,readline}.so.5*" must be performed before "make install"

Change History (13)

comment:1 by manuel@…, 17 years ago

To can have the /lib/lib{history,readline}.so.5 symlinks pointing to /lib/lib{history,readline}.so.5.1 after a reinstallation, in jhalfs-X I need to add the following commands after "make install":

rm -v /lib/lib{history,readline}.so.5 rm -v /lib/lib{history,readline}*old ln -sfv /lib/ ln -sfv /lib/

I can't reproduce the bug using DESTDIR for installation/reinstallation, thus not sure if it could be a jhalfs specific bug.

If no one can confirm the bug reinstallig Readline on a running system, please close this ticket as WORKFORME

comment:2 by dbn.lists@…, 17 years ago

This is not jhalfs specific, just sillyness by the readline developers. There are two places where this is enabled in the readline build files. First, the static library in

install-static: installdirs $(STATIC_LIBS) install-headers install-doc
        -$(MV) $(DESTDIR)$(libdir)/libreadline.a $(DESTDIR)$(libdir)/libreadline.old
        $(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a
        -test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libreadline.a
        -$(MV) $(DESTDIR)$(libdir)/libhistory.a $(DESTDIR)$(libdir)/libhistory.old

And, second, the shell script support/shlib-install:

        ${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
        if [ -f "$INSTALLDIR/$LIBNAME" ]; then

DESTDIR is not affected so long as $(DESTDIR)/lib/libreadline.* doesn't exist.

These two seds suppress that behavior:

sed -i '/MV.*old/d'
sed -i '/{OLDSUFF}/c:' support/shlib-install

The second one replaces the line with :, the do nothing command. This is necessary since they are wrapped in if;then statements that would be empty without them.

comment:3 by manuel@…, 17 years ago

This ticket isn't only about that the *old files will be created, but that when doing a Readline reinstallation with jhalfs I end having

/lib/ link to /lib/ /lib/ link to /lib/

Then I would to know if that also happens when reinstalling Readline following the book commands on a running LFS SVN system installed also by-the-book.

comment:4 by dbn.lists@…, 17 years ago

Looking at the source, I can't figure out how those links would happen. I'll see what happens when doing the build by the book and using the sed's on reinstall.

comment:5 by dbn.lists@…, 17 years ago

I can't confirm that behavior. I'm not seeing this link repeatedly doing by the book install:

/lib/ ->

It's coming out as expected as

/lib/ ->

Also as noted, I get:


comment:6 by tushar@…, 17 years ago

The incorrect symlinks are because of a bug in ldconfig. See <>.

comment:7 by manuel@…, 17 years ago

Priority: normallowest
Severity: minortrivial
Type: defectenhancement


That meant that the bug isn't in Readline, but a race condition in jhalfs generated by a latter package reinstallation that is issuing a plain "ldconfig" by their own.

Then IMHO no special notes are required in the book commands for Readline, except maybe, the possibility to delete the *old files after doing the reinstallation.

But that look like a very minor issue, thus I will close this bug in 2 days if there is no more comments.

comment:8 by dbn.lists@…, 17 years ago

Priority: lowestnormal
Severity: trivialminor
Type: enhancementdefect

With the seds, I can repeatedly install by the book and get the right libraries. I still can't confirm the behavior you're seeing.

And, running ldconfig (without -X) doesn't cause any problems since there is only one set of libraries. Thanks for the reminder, Tushar.

Without the seds, I do get the bad symlinks:

lrwxrwxrwx 1 root root 22 Apr 17 12:20 /lib/ ->

Since some Makefiles run ldconfig, it would be impossible to control those symlinks not being created. Issue the seds before you build readline and this is never an issue.

comment:9 by manuel@…, 17 years ago

I'm now doing a new jhalfs build with only the removal of the *old libraries.

If works, it might be an alternative to the seds for the book.

comment:10 by manuel@…, 17 years ago

Finished the build. A plain

rm -v /lib/lib{history,readline}*old

after "make install" will prevent also the creation of that wrong symlinks.

comment:11 by archaic@…, 17 years ago

So what's the plan? The seds or the library removal? I prefer the latter, but I prefer doing it before configure, not after make install.

comment:12 by manuel@…, 17 years ago

If the comment is place before configure, then the sed is the way to go.

comment:13 by archaic@…, 17 years ago

Resolution: fixed
Status: newclosed

Fixed in r7574.

Note: See TracTickets for help on using tickets.