libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Libtool head test status


From: Ralf Wildenhues
Subject: Re: Libtool head test status
Date: Sat, 8 Mar 2008 12:49:12 +0100
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

This message needs some corrections:

* Ralf Wildenhues wrote on Sat, Mar 08, 2008 at 09:51:12AM CET:
> I went back to my w32 (XP home edition) system now and fixed most of the
> issues that I found.  With the patch below, the only failures I'm left at
> are 21 (link order of deplibs) and 64 (stresstest) on both Cygwin and
> MinGW (and 65 as followup failure).

On Cygwin, only 21 and 65 (low max_cmd_len) fail.  On MinGW, 21, 64, 65
fail.  On MinGW, the failure of 65 reveals one issue that is not just a
repetition of the failures of 21 and 64.  It goes like this:

You are on MinGW, compiling with gcc, have a link command line which is
too long to be executed in one go, and you have objects listed with
absolute path.  In this case, libtool will create a GNU ld linker script
with extension .lnkscript which contains the absolute file name of the
object(s) but not translated to w32 paths.  This causes the failure, as
ld does not understand /c/msys/.../foo.obj.

I'm still pondering whether to fix the issue in libtool or to make the
test weaker; I don't think this is particularly relevant for real
applications.

FWIW, here's the patch again but without mangling.  OK?

Cheers,
Ralf

> 2008-03-07  Ralf Wildenhues  <address@hidden>
> 
>       * tests/nonrecursive.at: Use -no-undefined for foo.la.
>       * tests/recursive.at: Likewise.
>       * tests/subproject.at: Likewise.
>       * tests/lt_dladvise.at: For systems where undefined symbols are
>       not allowed, to not try to load the module libdepend.
>       [ mingw ]: Add to list of such systems.
>       * tests/testsuite.at (_LT_AT_TRANSLATE_TEXT_OUTPUT): New macro,
>       to translate line ending of expout and experr files suitable for
>       host executables.
>       (LT_AT_CHECK, LT_AT_NOINST_EXEC_CHECK): Use it.
>       Report by Bob Friesenhahn.

Index: tests/lt_dladvise.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/lt_dladvise.at,v
retrieving revision 1.5
diff -u -r1.5 lt_dladvise.at
--- tests/lt_dladvise.at        1 Mar 2008 22:43:04 -0000       1.5
+++ tests/lt_dladvise.at        8 Mar 2008 11:42:55 -0000
@@ -173,8 +173,9 @@
       printf ("global: %d\n", moduletest (handle, "f", "i"));
 
       /* Don't attempt to load moddepend unless modglobal was successfully
-         loaded and the symglobal hint was taken.  */
-      if (info && info->is_symglobal)
+         loaded and the symglobal hint was taken, and the system allows to
+        to have undefined symbols.  */
+      if (info && info->is_symglobal && HAVE_UNDEFINED_SYMBOLS)
         {
           hint_ext ();
         }
@@ -285,10 +286,12 @@
 # ------------------------------------------------------------------------- #
 
 case $host_os in
-cygwin*)
+cygwin* | mingw*)
   # These hosts do not support linking without -no-undefined
+  CPPFLAGS="$CPPFLAGS -DHAVE_UNDEFINED_SYMBOLS=0"
   ;;
 *)
+  CPPFLAGS="$CPPFLAGS -DHAVE_UNDEFINED_SYMBOLS=1"
   dlopenable="$dlopen depend"
   $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c moddepend.c
   AT_CHECK([$LIBTOOL --mode=link $CC -module $CFLAGS $LDFLAGS -o libdepend.la \
@@ -317,8 +320,8 @@
     modules="${modules+$modules }$dlopen lib$module.la"
   done
 
-  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main main.$OBJEXT \
-           $modules $LIBLTDL], [], [ignore], [ignore])
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main main.$OBJEXT 
$modules $LIBLTDL],
+          [], [ignore], [ignore])
   LT_AT_NOINST_EXEC_CHECK([./main], [$modules], [], [expout], [])
 done
 
Index: tests/nonrecursive.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/nonrecursive.at,v
retrieving revision 1.11
diff -u -r1.11 nonrecursive.at
--- tests/nonrecursive.at       8 Jan 2008 05:07:41 -0000       1.11
+++ tests/nonrecursive.at       8 Mar 2008 11:42:55 -0000
@@ -64,7 +64,7 @@
 
 include ltdl/Makefile.inc
 
-foo_la_LDFLAGS         = -module -avoid-version
+foo_la_LDFLAGS         = -module -avoid-version -no-undefined
 foo_la_SOURCES         = foo.c
 ]])
 
Index: tests/recursive.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/recursive.at,v
retrieving revision 1.9
diff -u -r1.9 recursive.at
--- tests/recursive.at  8 Jan 2008 06:56:03 -0000       1.9
+++ tests/recursive.at  8 Mar 2008 11:42:55 -0000
@@ -46,7 +46,7 @@
 AUTOMAKE_OPTIONS = 1.7
 SUBDIRS = ltdl
 lib_LTLIBRARIES = foo.la
-foo_la_LDFLAGS = -module -avoid-version
+foo_la_LDFLAGS = -module -avoid-version -no-undefined
 foo_la_SOURCES = foo.c
 ]])
 
Index: tests/subproject.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/subproject.at,v
retrieving revision 1.14
diff -u -r1.14 subproject.at
--- tests/subproject.at 17 Jan 2008 04:47:41 -0000      1.14
+++ tests/subproject.at 8 Mar 2008 11:42:55 -0000
@@ -1,6 +1,6 @@
 # subproject.at -- test subproject Libltdl builds             -*- Autotest -*-
 #
-#   Copyright (C) 2005 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2008 Free Software Foundation, Inc.
 #   Written by Gary V. Vaughan, 2005
 #
 #   This file is part of GNU Libtool.
@@ -44,7 +44,7 @@
 AUTOMAKE_OPTIONS = 1.9
 SUBDIRS = sub/ltdl
 lib_LTLIBRARIES = foo.la
-foo_la_LDFLAGS = -module -avoid-version
+foo_la_LDFLAGS = -module -avoid-version -no-undefined
 ]])
 
 echo 'int dummy = 0;' > foo.c
Index: tests/testsuite.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/testsuite.at,v
retrieving revision 1.51
diff -u -r1.51 testsuite.at
--- tests/testsuite.at  1 Feb 2008 19:06:42 -0000       1.51
+++ tests/testsuite.at  8 Mar 2008 11:42:55 -0000
@@ -161,10 +161,23 @@
 m4_define([LT_AT_CHECK],
 [echo "LT_ESCAPE([$1])"; AT_CHECK($@)])
 
+
+# _LT_AT_TRANSLATE_TEXT_OUTPUT(FILE)
+# ----------------------------------
+# Ensure correct line ending for expected output of host executables.
+m4_define([_LT_AT_TRANSLATE_TEXT_OUTPUT],
+[case $host_os in mingw*)
+  while read -r l; do printf "%s\r\n" "$l"; done < $1 > $1.t
+  mv -f $1.t $1 ;;
+esac])
+
+
 # LT_AT_EXEC_CHECK(EXECUTABLE, [STATUS = 0], [STDOUT], [STDERR])
 # --------------------------------------------------------------
 m4_define([LT_AT_EXEC_CHECK],
-[AT_CHECK([$1; lt_status=$?; if test $lt_status -eq 0; then :;
+[m4_if([$3], [expout], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$3])])
+m4_if([$4], [experr], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$4])])
+AT_CHECK([$1; lt_status=$?; if test $lt_status -eq 0; then :;
           elif test "X$host" != "X$build" && \
                { test -x "$1" || test -x "$1"$EXEEXT; }
           then (exit 77); else (exit $lt_status); fi],[$2],[$3],[$4])
@@ -175,7 +188,9 @@
 #                        [STATUS = 0], [STDOUT], [STDERR])
 # ---------------------------------------------------------
 m4_define([LT_AT_NOINST_EXEC_CHECK],
-[AT_CHECK([$LIBTOOL --mode=execute $2 $1; lt_status=$?;
+[m4_if([$4], [expout], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$4])])
+m4_if([$5], [experr], [_LT_AT_TRANSLATE_TEXT_OUTPUT([$5])])
+AT_CHECK([$LIBTOOL --mode=execute $2 $1; lt_status=$?;
           if test $lt_status -eq 0; then :;
           elif test "X$host" != "X$build" && \
                { test -x "$1" || test -x "$1"$EXEEXT; }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]