Re: Two small libltdl patches.

2008-08-26 Thread Ralf Wildenhues
Hi Peter,

* Peter O'Gorman wrote on Sat, Aug 23, 2008 at 11:59:00PM CEST:
 
 On systems without argz we were exporting unmangled symbols argz_count
 and argz_add from libltdl. Not really a good idea. Rather than mangle
 the names, since we do not use either function, they were removed.

 Subject: [PATCH] Remove unnecessary global argz functions.
 
 * libltdl/argz.c (argz_add,argz_count): Remove.

* Peter O'Gorman wrote on Mon, Aug 25, 2008 at 04:43:57AM CEST:
 
 I just went back and re-read the argz threads on bug-libtool. The two
 functions were added back in February, the June thread then decided that
 libtool could keep its own argz and only have the functions it needs,
 while gnulib's could evolve along glibc's.

ACK.

 Now that I look at the patch again, I see that I forgot to remove the
 functions from argz_.h :)
 
 So, with the functions also removed from the header, ok?

Yes, certainly.  I think a NEWS entry would be good, too, as well as
a test so we don't regress again.  What do you think of this?  You
can squash it into your patch when you commit.

The test doesn't work on many systems (only those that need argz.c,
and only those without leading underscore in symbol names) and skips
resp. doesn't expose a failure elsewhere, but I think that should be
sufficient.

Thanks,
Ralf

* NEWS: Update.
* tests/ltdl-api.at: New file.
* Makefile.am: Adjust.

diff --git a/NEWS b/NEWS
index e0d1062..c85f741 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,9 @@ New in 2.2.??: 2008-08-??: git version 2.2.5a, Libtool team:
 
   - Several testsuite issues have been fixed, thanks to user feedback.
 
+  - Fix 2.2 regression that caused argz symbols to be exported from
+libltdl unrenamed on systems that do not have working argz.
+
 New in 2.2.4: 2008-05-04: git version 2.2.3a, Libtool team:
 
 * New features:
diff --git a/Makefile.am b/Makefile.am
index 0085c7f..1417e84 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -454,6 +454,7 @@ TESTSUITE_AT= tests/testsuite.at \
  tests/am-subdir.at \
  tests/lt_dlexit.at \
  tests/lt_dladvise.at \
+ tests/ltdl-api.at \
  tests/need_lib_prefix.at \
  tests/standalone.at \
  tests/subproject.at \
diff --git a/tests/ltdl-api.at b/tests/ltdl-api.at
new file mode 100644
index 000..b811ae3
--- /dev/null
+++ b/tests/ltdl-api.at
@@ -0,0 +1,36 @@
+# ltdl-api.at -- test libltdl API-*- Autotest -*-
+#
+#   Copyright (C) 2008 Free Software Foundation, Inc.
+#   Written by Ralf Wildenhues, 2008.
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+AT_SETUP([ltdl API])
+AT_KEYWORDS([libltdl])
+
+# Ensure that no symbols from argz are unrenamed.
+eval `$LIBTOOL --config | $EGREP '^(NM|global_symbol_pipe|objext)='`
+argz_o=$abs_top_builddir/libltdl/argz.$objext
+AT_CHECK([test -f $argz_o || exit 77])
+AT_CHECK([eval $NM \\$argz_o\ | $global_symbol_pipe],
+[], [stdout], [ignore])
+AT_CHECK([grep ^T argz_ stdout], [1])
+
+AT_CLEANUP




Re: Two small libltdl patches.

2008-08-26 Thread Ralf Wildenhues
Hi Peter,

* Peter O'Gorman wrote on Sat, Aug 23, 2008 at 11:59:00PM CEST:
 Subject: [PATCH] Allow for extensions other than .a for preloaded modules.
 
 * libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define LT_LIBEXT.
 * libltdl/ltdl.c (lt_dladvise_preload): Use it.
 Reported by Ralf Wildenhues.

OK, thanks.  Does this need a NEWS entry?  I'm not sure.

Cheers,
Ralf




Re: Two small libltdl patches.

2008-08-26 Thread Peter O'Gorman
Ralf Wildenhues wrote:

 Yes, certainly.  I think a NEWS entry would be good, too, as well as
 a test so we don't regress again.  What do you think of this?  You
 can squash it into your patch when you commit.

Thanks.

 
 The test doesn't work on many systems (only those that need argz.c,
 and only those without leading underscore in symbol names) and skips
 resp. doesn't expose a failure elsewhere, but I think that should be
 sufficient.

I'd like this to fail for me on darwin (more likely to notice it), so I
will probably add:


 +AT_CHECK([eval $NM \\$argz_o\ | $global_symbol_pipe],
 +  [], [stdout], [ignore])
 +AT_CHECK([grep ^T argz_ stdout], [1])

+AT_CHECK([grep ^T _argz_ stdout], [1])

 +
 +AT_CLEANUP

This should be fine, because all global symbols exported from argz.o
must be lt__ prefixed.

Will commit with these changes later today.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: Two small libltdl patches.

2008-08-26 Thread Ralf Wildenhues
* Peter O'Gorman wrote on Tue, Aug 26, 2008 at 06:24:11PM CEST:
 Ralf Wildenhues wrote:
 
 I'd like this to fail for me on darwin (more likely to notice it), so I
 will probably add:
 
  +AT_CHECK([eval $NM \\$argz_o\ | $global_symbol_pipe],
  +[], [stdout], [ignore])
  +AT_CHECK([grep ^T argz_ stdout], [1])
 
 +AT_CHECK([grep ^T _argz_ stdout], [1])

Of course.  Good idea.

Thanks,
Ralf




Re: Two small libltdl patches.

2008-08-24 Thread Charles Wilson
Peter O'Gorman wrote:
 On systems without argz we were exporting unmangled symbols argz_count
 and argz_add from libltdl. Not really a good idea. Rather than mangle
 the names, since we do not use either function, they were removed.

But wasn't there a thread back in June where we explicitly added a bunch
of argz functions, so that (a) we would be using the same file as
gnulib, and (b) that file would have a complete argz implementation?

Doesn't your patch fork our copy again? (Or have I missed some
intervening decisions/development)?

--
Chuck




Re: Two small libltdl patches.

2008-08-24 Thread Bob Friesenhahn

On Sun, 24 Aug 2008, Charles Wilson wrote:


But wasn't there a thread back in June where we explicitly added a bunch
of argz functions, so that (a) we would be using the same file as
gnulib, and (b) that file would have a complete argz implementation?


I recall that it was decided that it was not necessary for the 
implementation to be identical to gnulib and that the code should not 
need to be updated unless it is found to be broken.


Bob
==
Bob Friesenhahn
[EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/





Re: Two small libltdl patches.

2008-08-24 Thread Charles Wilson
Peter O'Gorman wrote:
 So, with the functions also removed from the header, ok?

Fine by me -- but I can't give official approval. g

--
Chuck





Two small libltdl patches.

2008-08-23 Thread Peter O'Gorman
Hi,

On systems without argz we were exporting unmangled symbols argz_count
and argz_add from libltdl. Not really a good idea. Rather than mangle
the names, since we do not use either function, they were removed.

And as Ralf reported previously, preloaded modules can have the .lib
extension as well as .a.

Does not fail any unexpected tests on darwin or linux with these patches.

I'm thinking of just pushing these as obvious

Oh what the heck, not like I am going to have time to make a release in
the next couple of days anyway.

Ok to commit?

Peter
-- 
Peter O'Gorman
http://pogma.com
From 1fa70a57ef579ae717c504346a1aad13a03b30cc Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Sat, 23 Aug 2008 16:28:25 -0500
Subject: [PATCH] Remove unnecessary global argz functions.

* libltdl/argz.c (argz_add,argz_count): Remove.
Reported by Ralf Wildenhues [EMAIL PROTECTED].
---
 ChangeLog  |6 ++
 libltdl/argz.c |   28 
 2 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 13cc2af..567fbfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-23  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Remove unnecessary global argz functions.
+	* libltdl/argz.c (argz_add,argz_count): Remove.
+	Reported by Ralf Wildenhues [EMAIL PROTECTED].
+
 2008-08-22  Ralf Wildenhues  [EMAIL PROTECTED]
 
 	Initial support for Lahey Fortran on GNU/Linux.
diff --git a/libltdl/argz.c b/libltdl/argz.c
index f31ce17..8567723 100644
--- a/libltdl/argz.c
+++ b/libltdl/argz.c
@@ -76,14 +76,6 @@ argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len)
 }
 
 
-/* Add a string to the argz vector.  */
-error_t
-argz_add (char **pargz, size_t *pargz_len, const char *str)
-{
-  return argz_append (pargz, pargz_len, str, strlen (str) + 1);
-}
-
-
 error_t
 argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len)
 {
@@ -232,23 +224,3 @@ argz_stringify (char *argz, size_t argz_len, int sep)
 }
 }
 
-
-/* Count number of elements (null bytes) in argz vector.  */
-
-size_t
-argz_count (const char *argz, size_t argz_len)
-{
-  size_t count = 0;
-
-  assert ((argz  argz_len) || (!argz  !argz_len));
-
-  while (argz_len  0)
-{
-  size_t part_len = strlen (argz);
-  argz += part_len + 1;
-  argz_len -= part_len + 1;
-  count++;
-}
-
-  return count;
-}
-- 
1.5.4.1

From 38a2f1bcab8c64650b096830d1def5c6fb920c85 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Sat, 23 Aug 2008 16:31:17 -0500
Subject: [PATCH] Allow for extensions other than .a for preloaded modules.

* libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define LT_LIBEXT.
* libltdl/ltdl.c (lt_dladvise_preload): Use it.
Reported by Ralf Wildenhues.
---
 ChangeLog  |5 +
 libltdl/ltdl.c |   10 --
 libltdl/m4/ltdl.m4 |2 ++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 567fbfd..3dc46fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-08-23  Peter O'Gorman  [EMAIL PROTECTED]
 
+	Allow for extensions other than .a for preloaded modules.
+	* libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define LT_LIBEXT.
+	* libltdl/ltdl.c (lt_dladvise_preload): Use it.
+	Reported by Ralf Wildenhues.
+
 	Remove unnecessary global argz functions.
 	* libltdl/argz.c (argz_add,argz_count): Remove.
 	Reported by Ralf Wildenhues [EMAIL PROTECTED].
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 5a26565..6e19599 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -50,6 +50,10 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #  define LT_FILENAME_MAX	1024
 #endif
 
+#if !defined(LT_LIBEXT)
+#  define LT_LIBEXT a
+#endif
+
 /* This is the maximum symbol size that won't require malloc/free */
 #undef	LT_SYMBOL_LENGTH
 #define LT_SYMBOL_LENGTH	128
@@ -67,6 +71,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 
 static	const char	objdir[]		= LT_OBJDIR;
 static	const char	archive_ext[]		= LT_ARCHIVE_EXT;
+static  const char	libext[]		= LT_LIBEXT;
 #if defined(LT_MODULE_EXT)
 static	const char	shlib_ext[]		= LT_MODULE_EXT;
 #endif
@@ -1258,7 +1263,8 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
 
   if (vtable)
 	{
-	  archive_name = MALLOC (char, LT_STRLEN (name) + 3);
+	  /* name + . + libext + NULL */
+	  archive_name = MALLOC (char, LT_STRLEN (name) + LT_STRLEN (libext) + 2);
 	  *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle));
 
 	  if ((*phandle == NULL) || (archive_name == NULL))
@@ -1270,7 +1276,7 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
 
 	  /* Preloaded modules are always named according to their old
 	 archive name.  */
-	  sprintf (archive_name, %s.a, name);
+	  sprintf (archive_name, %s.%s, name, libext);
 
 	  if (tryall_dlopen (newhandle, archive_name, advise, vtable) == 0)
 	{
diff --git a/libltdl/m4/ltdl.m4 b/libltdl/m4/ltdl.m4
index