bug-libtool
[Top][All Lists]
Advanced

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

revert unwanted enabling of libtool tracing (was: libtool-2.2.11a on AIX


From: Ralf Wildenhues
Subject: revert unwanted enabling of libtool tracing (was: libtool-2.2.11a on AIX 5.3 current git master / followup on the old test suite and failures in the new testsuit)
Date: Sat, 7 Aug 2010 07:43:45 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Rainer, I'm going through things in some random order, and it will take
me at least a little while to get through them all.

* Rainer Tammer wrote on Thu, Aug 05, 2010 at 09:25:14AM CEST:
> 38. link-order2.at:46: testing Link order of deplibs ...
> libtool: compile:  cc_r -qlanglvl=extc89 -g -c a0.c  -DPIC -o .libs/a0.o
> libtool: compile:  cc_r -qlanglvl=extc89 -g -c a1.c  -DPIC -o .libs/a1.o
> libtool: compile:  cc_r -qlanglvl=extc89 -g -c b.c  -DPIC -o .libs/b.o
> libtool: link: /usr/bin/nm -B -BCpg  .libs/a0.o   | awk '{ if ((($ 2 == "T") 
> || ($ 2 == "D") || ($ 2 == "B")) && (substr($ 3,1,1) != ".")) { print $ 3 } 
> }' | sort -u > .libs/liba0.exp
> libtool: link: cc_r -qlanglvl=extc89 -Wl,-bM:SRE -o .libs/liba0.so.0  
> .libs/a0.o   -L/daten/source/libtool-2.2.11a/tests/testsuite.dir/038/lib -lc 
> -Wl,-bnoentry  -qlanglvl=extc89   -Wl,-bE:.libs/li
> libtool: link: ar cru .libs/liba0.a .libs/liba0.so.0
> libtool: link: ( cd ".libs" && rm -f "liba0.la" && ln -s "../liba0.la" 
> "liba0.la" )
> libtool: install: cp .libs/liba0.a 
> /daten/source/libtool-2.2.11a/tests/testsuite.dir/038/lib/liba0.a
> libtool: install: cp .libs/liba0.lai 
> /daten/source/libtool-2.2.11a/tests/testsuite.dir/038/lib/liba0.la
> libtool: enabling shell trace mode
> + test 2 -gt 0
> + opt=--finish
> + shift
> + opt_finish=:
> + set dummy --mode finish 
> /daten/source/libtool-2.2.11a/tests/testsuite.dir/038/lib

Waitaminute.  Why is libtool enabling trace mode here?  That wasn't
requested anywhere; and it leads to huge log files.

*time passes*

git bisect converges at v2.2.10-34-gb8dd17a, the introduction of
getopt.m4sh.  I'm pushing the patch below to undo that.

Thanks,
Ralf

    Ensure not to reverse preserving of --debug for relinking/finish.
    
    * libltdl/config/ltmain.m4sh (func_check_version_match): Only
    preserve '--debug' switch if $opt_debug is not equal to ':'.
    * tests/help.at (debug tracing): New test group.
    Report by Rainer Tammer.

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 32a41c7..fad2e64 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -393,7 +393,7 @@ M4SH_GETOPTS(
   fi
 
   # preserve --debug
-  $opt_debug && func_append preserve_args " --debug"
+  test "$opt_debug" = : || func_append preserve_args " --debug"
 
   case $host in
     *cygwin* | *mingw* | *pw32* | *cegcc*)
diff --git a/tests/help.at b/tests/help.at
index e1bcbf5..c4eaa87 100644
--- a/tests/help.at
+++ b/tests/help.at
@@ -92,3 +92,100 @@ AT_CHECK([$LIBTOOL cl liba.la],
         [], [ignore], [ignore])
 
 AT_CLEANUP
+
+
+AT_SETUP([debug tracing])
+
+AT_DATA([a.c],
+[[int a () { return 0; }
+]])
+
+AT_DATA([b.c],
+[[extern int a ();
+int b () { return a (); }
+]])
+
+AT_DATA([main.c],
+[[extern int b ();
+int main () { return b (); }
+]])
+
+inst=`pwd`/inst
+libdir=$inst/lib
+bindir=$inst/bin
+mkdir $inst $libdir $bindir
+
+# This test will not work correctly if --debug is passed.
+AT_CHECK([case "$LIBTOOL $CC $CPPFLAGS $CFLAGS $LDFLAGS " in ]dnl
+        [  *\ --debug\ *) exit 77;; *) :;; esac])
+
+check_trace ()
+{
+  if test "X$trace" = X--debug; then
+    AT_CHECK([grep 'enabling shell trace mode' stdout stderr], [0], [ignore])
+    AT_CHECK([grep ' --mode' stderr], [0], [ignore])
+  else
+    AT_CHECK([grep 'enabling shell trace mode' stdout stderr], [1])
+    AT_CHECK([grep ' --mode' stderr], [1])
+  fi
+}
+
+orig_LIBTOOL=$LIBTOOL
+for trace in '' --debug; do
+  LIBTOOL="$orig_LIBTOOL $trace"
+
+  # Hypothesis: debug output should happen if (and only if) --debug is
+  # passed, for compile, link, install, uninstall, and clean modes.
+  AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c a.c],
+          [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c b.c],
+          [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$CC $CPPFLAGS $CFLAGS -c main.c], [], [ignore], [ignore])
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo ]dnl
+          [ -no-undefined -rpath $libdir], [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libb.la b.lo ]dnl
+          [ -no-undefined -rpath $libdir liba.la], [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main$EXEEXT 
main.$OBJEXT ]dnl
+          [libb.la], [], [stdout], [stderr])
+  check_trace
+  LT_AT_NOINST_EXEC_CHECK([./main], [], [], [stdout], [stderr])
+  check_trace
+
+  AT_CHECK([$LIBTOOL --mode=install cp liba.la libb.la $libdir],
+          [], [stdout], [stderr])
+  check_trace
+
+  # Hypothesis: --debug should be passed to relink mode if (and only if)
+  # it was passed at link mode.
+  AT_CHECK([$orig_LIBTOOL --mode=install cp liba.la libb.la $libdir],
+          [], [stdout], [stderr])
+  if grep ': relinking ' stdout stderr; then
+    if test "X$trace" = X--debug; then
+      AT_CHECK([grep ' --mode=relink' stdout stderr | grep ' --debug '],
+              [0], [ignore])
+    else
+      AT_CHECK([grep ' --mode=relink' stdout stderr | grep ' --debug '],
+              [1])
+    fi
+  fi
+
+  AT_CHECK([$LIBTOOL --mode=install cp main$EXEEXT $bindir],
+          [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=finish $bindir], [], [stdout], [stderr])
+  check_trace
+
+  AT_CHECK([$LIBTOOL --mode=uninstall rm -f $bindir/main$EXEEXT ]dnl
+          [$libdir/libb.la $libdir/liba.la], [], [stdout], [stderr])
+  check_trace
+  AT_CHECK([$LIBTOOL --mode=clean rm -f $bindir/main$EXEEXT ]dnl
+          [$libdir/libb.la $libdir/liba.la], [], [stdout], [stderr])
+  check_trace
+
+done
+
+AT_CLEANUP



reply via email to

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