checks using DESTDIR in libtool-1.5.22+ ?

2007-01-24 Thread Michael Haubenwallner
Hi,

Using DESTDIR during 'make install' is very common for binary-packagers.
I've seen some problems on various platforms (mostly hpux and aix),
which do not appear when installing without DESTDIR.

So, am I missing something here, or are there no libtool-checks using
DESTDIR installs at all ?

I mean sth. like this:

 1. $ configure ...
 2. $ make
 3. $ make install DESTDIR=./_image
 4. $ make clean
 5. copy _image/$prefix to $prefix
 6. remove _image
 7. run the installed executables from $prefix

The two cleanup steps (4 and 6) are to check that the installed binaries
do not depend on libs in build- or image-dir.

Thanks,
/haubi/



___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: [patch] Dangling Pointer in libltdl

2007-01-24 Thread Dave Brolley

Hi Ralf and thanks for looking at this!

 Thanks for the bug report.

 * Dave Brolley wrote on Thu, Jan 18, 2007 at 07:39:23PM CET:
 / /
 / The attached patch fixes a problem with a dangling pointer in 
lt_dlexit /
 / withing libltdl. The problem is that lt_dlclose is recursively 
called /
 / (via unload_deplibs) in order to close dependent libraries. One 
of these /

 / might be (and was for me!) the one pointed to by 'cur'./

 I have trouble reproducing this bug easily. Which system does it happen
 on?

It happened in a cygwin 1.6.9 environment on Windows XP Home edition.

 How does the graph formed by modules/libraries and
 interdependencies (linking against/dlopening) look like?

The linked list looked at the time like this:

lib1 - lib2 - lib3 - lib4 - etc.

What happed was that 'cur' was at the head of the list (pointing at 
lib1). 'tmp' was then set to 'cur' and 'cur' was advanced to point to 
lib2. At this point lt_dlclose was called using 'tmp' to close lib1. 
This call determined that lib2 and lib3 were dependent libraries and 
they were closed (and removed from the list) by recursive calls to 
lt_dlclose. This left 'cur' pointing to unallocated memory which 
eventually caused a crash.


 In what order
 are things opened/linked against, which ones are closed explicitly, for
 this to trigger? Do you mix calls to lt_dlopen with direct calls to
 dlopen? Do you mix libraries created with libtool with libraries
 created without?

These questions will take some time to sort out. Hopefully you can 
create a test case using the information I've given above in the mean 
time. The application in question is Red Hat's SID simulator 
(sources.redhat.com). Given time, I should be able to come up with a 
test case if necessary.


 / @@ -283,10 +283,19 @@ lt_dlexit (void)/
 / {/
 / ++errors;/
 / }/
 / }/
 / }/
 / + /* Make sure that the handle pointed to by 'cur' still exists./
 / + lt_dlclose recursively closes dependent libraries which removes/
 / + them from the linked list. One of these might be the one/
 / + pointed to by 'cur'. *//
 / + for (tmp = handles; tmp; tmp = tmp-next)/
 / + if (tmp == cur)/
 / + break;/
 / + if (! tmp)/
 / + cur = handles;/

 If the description is correct, the whole addition could go in the true
 branch of the `if (tmp-info.ref_count = level)' test, no?

You are correct. I have attached a new patch which corrects this and 
also corrects a problem with my previous patch. My previous patch causes 
an infinite loop in the case that a resident library is in the linked 
list. In this case 'cur' gets reset to 'handles' when the end of the 
list is reached because 'tmp' ends up being NULL in my new loop. Because 
of the resident library, 'handles' is not NULL and the list is traversed 
repeatedly ad-infinitum. The fix is to make sure that 'cur' is not NULL 
before searching for it in the list.


Thanks,
Dave

2007-01-24  Dave Brolley  [EMAIL PROTECTED]

* libltdl/ltdl.c (lt_dlexit): Make sure that 'cur' is not NULL before
checking that it is still in the list.

Index: libltdl/ltdl.c
===
RCS file: /sources/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.245
diff -c -p -r1.245 ltdl.c
*** libltdl/ltdl.c  13 Oct 2006 14:11:18 -  1.245
--- libltdl/ltdl.c  24 Jan 2007 21:52:46 -
*** lt_dlexit (void)
*** 283,288 
--- 283,300 
{
  ++errors;
}
+ /* Make sure that the handle pointed to by 'cur' still 
exists.
+lt_dlclose recursively closes dependent libraries 
which removes
+them from the linked list.  One of these might be the 
one
+pointed to by 'cur'.  */
+ if (cur)
+   {
+ for (tmp = handles; tmp; tmp = tmp-next)
+   if (tmp == cur)
+ break;
+ if (! tmp)
+   cur = handles;
+   }
}
}
}
___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: libtool, gettext, and HP-UX ia64 shared libraries

2007-01-24 Thread Ralf Wildenhues
Hello Bob,

Apologies for the enormous delay.  :-(

* Bob Proulx wrote on Sat, Jan 20, 2007 at 07:50:04PM CET:
  A while ago I raised an issue trying to build coreutils on HP-UX ia64.
  
http://lists.gnu.org/archive/html/bug-gnu-utils/2006-08/msg00083.html
 Let me keep this issue alive and kicking.  Libtool is still broken on
 HP-UX ia64.  But with this change it works.  I just don't know enough
 about libtool to suggest where libtool would need to be modified in
 order to make this a proper fix.
 
  Adding -L ../intl/.libs allows this to succeed.  This following
  command successfully links the test-names program.
  
cc -g -o .libs/test-names test-names.o libuniname.a -L ../intl/.libs 
  ../gnulib-lib/.libs/libgettextlib.so 
  /usr/local/build/coreutils/src/gettext-0.16.1/gettext-tools/intl/.libs/libintl.so
   -lc -Wl,+b -Wl,/usr/local/build/coreutils/lib
  
  Adding a -L path option seems to be required here.

Nope.  I think we fixed this issue in HEAD and branch-1-5 already, but
after 1.5.22.  I think the 2006-06-12 patch [1] on branch-1-5 is the
one you're looking for.  The important difference in your case is that
when creating gettext-tools/gnulib-lib/libgettext.la, in the link
command for .libs/libgettextlib-0.16.1.so, the argument
  +b /tmp/build/gettext-tools/intl/.libs:/prefix/lib

is correctly prefixed with `-Wl,':
  -Wl,+b -Wl,/tmp/build/gettext-tools/intl/.libs:/prefix/lib

I've tested now that with 
  gmake LIBTOOL=/path/to/build-of-libtool-branch-1-5/libtool

the build of gettext-0.16.1 successfully completes on HP-UX ia64.

Yay, another bugger down on the way to 1.5.24 ...

Cheers,
Ralf

[1] http://lists.gnu.org/archive/html/libtool-patches/2006-06/msg6.html


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool