]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/hardcode.test [solaris]: Use dumpstabs if available,
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 17 Apr 2005 07:59:52 +0000 (07:59 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 17 Apr 2005 07:59:52 +0000 (07:59 +0000)
to avoid false failure caused by debug section which contains
command line (Solaris cc).

ChangeLog
tests/hardcode.test

index e1b80eb99b0072467d10a40d2dcaa39cdb25148c..45b011dd0c95b83496d6255c9f3696f9692886bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * tests/hardcode.test [solaris]:  Use dumpstabs if available,
+       to avoid false failure caused by debug section which contains
+       command line (Solaris cc).
+
 2005-04-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
 
        * libtoolize.in: Fix syntax typos.
index f264e03bda2f22f3e0082aadbd8207269064242f..0cf0249dab21fa6cdc73ed1356d7bae775e9a0da 100755 (executable)
@@ -10,6 +10,9 @@ if test -z "$srcdir"; then
 fi
 . $srcdir/defs || exit 1
 
+# Extra tools we might need
+: ${DUMPSTABS=dumpstabs}
+
 # Check that things are built.
 if test -f $prefix/lib/libhello.la && cd ../demo; then :
 else
@@ -95,12 +98,22 @@ for file in hc-*; do
   # Discover whether the objdir really was hardcoded.
   hardcoded=no
 
+  # Solaris cc may store the command line in a debugging section,
+  # which leads to false positives.  Unfortunately, Solaris strip
+  # is not capable to remove the section (unlike GNU binutils strip).
+  # So we use dumpstabs if it seems to work.
+  if { $DUMPSTABS -d $file; } >/dev/null 2>&1; then
+    if $DUMPSTABS -d $file 2>/dev/null | $FGREP "$objdir" >/dev/null 2>&1; then
+      hardcoded=yes
+    else
+      hardcoded=no
+    fi
   # At least AIX fgrep doesn't work for binary files, and AIX also
   # doesn't have strings(1), so we need this strange conversion
   # (which only works on ASCII).
   # AIX fgrep also has a limited line length, so we turn unprintable
   # characters into newlines.
-  if cat $file | (tr '\000-\037\200-\377' '\n' || cat) 2>/dev/null \
+  elif cat $file | (tr '\000-\037\200-\377' '\n' || cat) 2>/dev/null \
               | $FGREP "$objdir" > /dev/null 2>&1; then
     hardcoded=yes
   elif $FGREP "$objdir" $file > /dev/null 2>&1; then