This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] make check vs --without-zlib


configure supports --without-zlib and also doesn't complain if the system
just lacks zlib, so the libbfd et al built might or might not support
compressed debug sections.  However, the test suite assumes that they work
and reports numerous failures in a --without-zlib build.

This change conditionalizes all the affected test cases appropriately.

The patch omits the (largeish) changes to generated files.


Ok for trunk?
Ok for 2.23?

Thanks,
Roland


binutils/
	* Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New variable.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

binutils/testsuite/
	* lib/utils-lib.exp (run_dump_test): If as options include
	--compress-debug-sections and zlib is not available, report
	the test as unsupported.
	* binutils-all/compress.exp: Bail out if zlib is not available.
	* binutils-all/objdump.exp (objdump compressed debug): Mark
	unsupported if zlib is not available.
	* binutils-all/readelf.exp (readelf_compressed_wa_test): Likewise.

config/
	* zlib.m4 (AM_ZLIB): Write site-zlib.exp file defining
	proc is_zlib_supported.

gas/
	* Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New variable.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.

gas/testsuite/
	* lib/gas-defs.exp (run_dump_test): If as options include
	--compress-debug-sections and zlib is not available, report
	the test as unsupported.

ld/
	* Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New variable.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

ld/testsuite/
	* ld-elf/compress.exp: Bail out if zlib is not supported.
	* lib/ld-lib.exp (run_dump_test): If as options include
	--compress-debug-sections and zlib is not available, report
	the test as unsupported.

--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -2,6 +2,7 @@

 AUTOMAKE_OPTIONS = dejagnu no-dist foreign
 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
+EXTRA_DEJAGNU_SITE_CONFIG = site-zlib.exp

 SUBDIRS = doc po

--- a/binutils/testsuite/binutils-all/compress.exp
+++ b/binutils/testsuite/binutils-all/compress.exp
@@ -1,4 +1,4 @@
-#   Copyright 2010
+#   Copyright 2010, 2012
 #   Free Software Foundation, Inc.

 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@

 # Test compressed .debug section.

-if { [is_remote host] || ![is_elf_format] } then {
+if { [is_remote host] || ![is_elf_format] || ![is_zlib_supported] } then {
     return
 }

--- a/binutils/testsuite/binutils-all/objdump.exp
+++ b/binutils/testsuite/binutils-all/objdump.exp
@@ -1,5 +1,5 @@
 #   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-#   2003, 2004, 2007, 2008, 2009, 2011
+#   2003, 2004, 2007, 2008, 2009, 2011, 2012
 #   Free Software Foundation, Inc.

 # This program is free software; you can redistribute it and/or modify
@@ -160,7 +160,7 @@ if [regexp $want $got] then {

 # Test objdump -s on a file that contains a compressed .debug section

-if { ![is_elf_format] } then {
+if { ![is_elf_format] || ![is_zlib_supported] } then {
     unsupported "objdump compressed debug"
 } elseif { ![binutils_assemble $srcdir/$subdir/dw2-compressed.S
tmpdir/dw2-compressed.o] } then {
     fail "objdump compressed debug"
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -220,6 +220,11 @@ proc readelf_compressed_wa_test {} {
     global srcdir
     global subdir

+    if { ![is_zlib_supported] } {
+	unsupported "readelf -wa (compressed)"
+	return
+    }
+
     # Compile the compressed-debug-section test file.
     if { [target_compile $srcdir/$subdir/dw2-compressed.S
tmpdir/dw2-compressed.o object debug] != "" } {
 	verbose "Unable to compile test file."
--- a/binutils/testsuite/lib/utils-lib.exp
+++ b/binutils/testsuite/lib/utils-lib.exp
@@ -1,5 +1,5 @@
 # Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006, 2007,
-# 2009, 2010 Free Software Foundation, Inc.
+# 2009, 2010, 2012 Free Software Foundation, Inc.

 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -439,6 +439,12 @@ proc run_dump_test { name {extra_options {}} } {
 	}
     }

+    if { [string match "*--compress-debug-sections*" $opts(as)] \
+	 && ![is_zlib_supported] } {
+	unsupported $testname
+	return
+    }
+
     if { $opts(source) == "" } {
 	set srcfile ${file}.s
     } else {
--- a/config/zlib.m4
+++ b/config/zlib.m4
@@ -8,11 +8,19 @@ AC_DEFUN([AM_ZLIB],
     [  --with-zlib             include zlib support (auto/yes/no)
[default=auto]],
     [], [with_zlib=auto])

+  bu_zlib_int=0
   if test "$with_zlib" != "no"; then
     AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
     if test "$with_zlib" = "yes" -a "$ac_cv_header_zlib_h" != "yes"; then
       AC_MSG_ERROR([zlib (libz) library was explicitly requested but
not found])
     fi
+    if test "x$ac_cv_header_zlib_h" = "xyes"; then
+      bu_zlib_int=1
+    fi
   fi
-])

+  AC_CONFIG_COMMANDS([site-zlib.exp], [
+echo "proc is_zlib_supported {} { return $bu_zlib_int }" > site-zlib.exp
+], [bu_zlib_int=$bu_zlib_int])
+
+])
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -2,6 +2,7 @@

 AUTOMAKE_OPTIONS = 1.11 dejagnu foreign no-dist
 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
+EXTRA_DEJAGNU_SITE_CONFIG = site-zlib.exp

 SUBDIRS = doc po

--- a/gas/testsuite/lib/gas-defs.exp
+++ b/gas/testsuite/lib/gas-defs.exp
@@ -1,5 +1,5 @@
 # Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2005, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+# 2004, 2005, 2007, 2008, 2009, 2010, 2012  Free Software Foundation, Inc.

 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -616,6 +616,12 @@ proc run_dump_test { name {extra_options {}} } {
 	}
     }

+    if { [string match "*--compress-debug-sections*" $opts(as)] \
+	 && ![is_zlib_supported] } {
+	unsupported $testname
+	return
+    }
+

     if { $opts(source) == "" } {
 	set sourcefile ${file}.s
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -2,6 +2,7 @@

 AUTOMAKE_OPTIONS = dejagnu no-texinfo.tex no-dist foreign
 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
+EXTRA_DEJAGNU_SITE_CONFIG = site-zlib.exp
 TEXINFO_TEX = ../texinfo/texinfo.tex

 SUBDIRS = po
--- a/ld/testsuite/ld-elf/compress.exp
+++ b/ld/testsuite/ld-elf/compress.exp
@@ -25,6 +25,10 @@ if ![is_elf_format] {
     return
 }

+if ![is_zlib_supported] {
+    return
+}
+
 # The following tests require running the executable generated by ld.
 if ![isnative] {
     return
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -757,6 +757,12 @@ proc run_dump_test { name {extra_options {}} } {
 	set dfile $srcdir/$subdir/$opts(dump)
     }

+    if { [string match "*--compress-debug-sections*" $opts(as)] \
+	 && ![is_zlib_supported] } {
+	unsupported $testname
+	return
+    }
+
     # Time to setup xfailures.
     foreach targ $opts(xfail) {
 	setup_xfail $targ


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]