Subject: bug#8441: Updated patches: Re: bug#8441: Patches making libtool-2.4-1 build under GNU/Hurd

From: Svante Signell <[email-masked]>
Date: Fri, 08 Apr 2011 09:01:56 +0200

On Thu, 2011-04-07 at 20:24 +0200, Ralf Wildenhues wrote:
> * Svante Signell wrote on Thu, Apr 07, 2011 at 08:20:55PM CEST:
> > On Thu, 2011-04-07 at 20:06 +0200, Ralf Wildenhues wrote:
> > > > --- libtool-2.4/tests/cmdline_wrap.at.orig	2010-05-20 23:18:41.000000000 +0200
> > > > +++ libtool-2.4/tests/cmdline_wrap.at	2011-02-06 11:08:29.000000000 +0100
> > > > @@ -30,6 +30,9 @@
> 
> > > > +# Setting low max_cmd_len on "hurd-386" does not make sense"
> > > > +AT_CHECK([if test "$host_os" == "gnu" ; then exit 77; fi])
> > > 
> > > Please use = not ==, the former is Posix test, the latter bash-specific.
> > 
> > OK, do you want me to send an update?
>
> I can't speak for Kurt, I only help maintain upstream.  ;-)

Updated!

> > > Does this test actually fail on hurd-i386, or is this just because you
> > > consider it wasted time?  In the former case, please send the patch
> > > upstream but also show a cut-n-paste of the failing test log.
> > 
> > Yes, this test fails without the patch. I'll build an unpatched version
> > and submit the failing test log. BTW: Where is upstream, is
> > [email-masked] sufficient?
> 
> Sure, but you can just as well send a patch right to libtool-patches
> (first-post moderation, but subscribing is not required).

I tried libtool-patches, but I had to register to be able to submit
there. Comments are embedded in the patches.

The test fails without the patch, see below (partial info I found in the
tests/testsuite.log file on test 112):

(where to find the complete log if this test, in
tests/testsuite.dir/112/testsuite.lo or
tests/testsuite.dir/112/tests/testsuite.dir/testsuilt.log? Both files
are very large)

 112: cmdline_wrap.at:28 Run tests with low max_cmd_len
      recursive
112. cmdline_wrap.at:28: testing ...
./cmdline_wrap.at:43: $CONFIG_SHELL $abs_srcdir/testsuite -k libtool
$INNER_TESTSUITEFLAGS
stderr:
ERROR: 43 tests were run,
4 failed (3 expected failures).
10 tests were skipped.

# shlibpath_overrides_runpath is set to 'unknown' in libtool.m4
# and not defined under $host_os ="gnu"
# This patch make the tests/*demo* run.
--- libtool-2.4/libltdt/m4/libtool.m4.orig	2011-02-03 21:33:56.000000000 +0100
+++ libtool-2.4/libltdl/m4/libtool.m4	2011-02-03 21:43:46.000000000 +0100
@@ -2325,6 +2325,7 @@
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   ;;
 
# This test is broken for hurd-i386
# Skip for $host_os = "gnu", since max_cmd_len=-1 to indicate that
# max_cmd_len is not limited under GNU Hurd.
#
--- libtool-2.4/tests/cmdline_wrap.at.orig	2010-05-20 23:18:41.000000000 +0200
+++ libtool-2.4/tests/cmdline_wrap.at	2011-02-06 11:08:29.000000000 +0100
@@ -30,6 +30,9 @@
 m4_ifdef([AT_CAPTURE_FILE],
 [AT_CAPTURE_FILE([testsuite.log])])
 
+# Setting low max_cmd_len on "hurd-386" does not make sense"
+AT_CHECK([if test "$host_os" = "gnu" ; then exit 77; fi])
+
 sed 's,max_cmd_len=.*,max_cmd_len="24",' < $LIBTOOL > libtool
 chmod +x libtool
 LIBTOOL=`pwd`/libtool
## Do not link against deplibs.  This is not needed for shared libs
## on atleast ELF systems since those already know which libs they
## need themself.  This seems to break a few things and will be fixed
## in a better way in a future upstream version.

Index: libtool-2.4/libltdl/config/ltmain.m4sh
===================================================================
--- libtool-2.4.orig/libltdl/config/ltmain.m4sh	2011-03-27 21:50:31.000000000 +0000
+++ libtool-2.4/libltdl/config/ltmain.m4sh	2011-03-27 21:52:59.000000000 +0000
@@ -5322,7 +5322,10 @@
 	case $pass in
 	dlopen) libs="$dlfiles" ;;
 	dlpreopen) libs="$dlprefiles" ;;
-	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	link)
+	  libs="$deplibs %DEPLIBS%"
+	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+	  ;;
 	esac
       fi
       if test "$linkmode,$pass" = "lib,dlpreopen"; then
Index: libtool-2.4/libltdl/m4/libtool.m4
===================================================================
--- libtool-2.4.orig/libltdl/m4/libtool.m4	2010-09-22 08:41:19.000000000 +0000
+++ libtool-2.4/libltdl/m4/libtool.m4	2011-03-27 22:00:19.000000000 +0000
@@ -4499,6 +4499,9 @@
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -4562,6 +4565,9 @@
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -4961,6 +4967,7 @@
 	if test "$aix_use_runtimelinking" = yes; then
 	  shared_flag="$shared_flag "'${wl}-G'
 	fi
+	_LT_TAGVAR(link_all_deplibs, $1)=no
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then