04c2ad2
--- elfutils/backends/ChangeLog
04c2ad2
+++ elfutils/backends/ChangeLog
e4cdb0b
@@ -315,6 +315,11 @@
28d5fbc
 	* sparc_init.c: Likewise.
28d5fbc
 	* x86_64_init.c: Likewise.
28d5fbc
 
3cd46aa
+2005-11-22  Roland McGrath  <roland@redhat.com>
3cd46aa
+
3cd46aa
+	* Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
3cd46aa
+	(libebl_%.so rule): Use it in place of -Wl,--as-needed.
3cd46aa
+
3cd46aa
 2005-11-19  Roland McGrath  <roland@redhat.com>
3cd46aa
 
3cd46aa
 	* ppc64_reloc.def: REL30 -> ADDR30.
e4cdb0b
@@ -337,6 +342,9 @@
04c2ad2
 	* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
04c2ad2
 	(CLEANFILES): Add libebl_$(m).so.
04c2ad2
 
04c2ad2
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
04c2ad2
+	(AM_CFLAGS): Use it in place of -Wextra.
04c2ad2
+
04c2ad2
 	* ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
04c2ad2
 	* ppc64_reloc.def: Likewise.
04c2ad2
 
04c2ad2
--- elfutils/backends/Makefile.am
04c2ad2
+++ elfutils/backends/Makefile.am
9729e74
@@ -25,12 +25,14 @@
9729e74
 ## <http://www.openinventionnetwork.com>.
04c2ad2
 ##
04c2ad2
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
04c2ad2
+WEXTRA = @WEXTRA@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
04c2ad2
 if MUDFLAP
04c2ad2
 AM_CFLAGS = -fmudflap
04c2ad2
 else
04c2ad2
 AM_CFLAGS =
04c2ad2
 endif
04c2ad2
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
04c2ad2
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
04c2ad2
 	     -std=gnu99
f6dcaea
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
04c2ad2
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
f6dcaea
@@ -59,7 +61,6 @@ endif
3cd46aa
 
f6dcaea
 textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
f6dcaea
 
f6dcaea
-
f6dcaea
 i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \
e4cdb0b
 	    i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c
f6dcaea
 cpu_i386 = ../libcpu/libcpu_i386.a
04c2ad2
--- elfutils/backends/Makefile.in
04c2ad2
+++ elfutils/backends/Makefile.in
e4cdb0b
@@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
e4cdb0b
@@ -184,6 +185,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
04c2ad2
 USE_NLS = @USE_NLS@
04c2ad2
 VERSION = @VERSION@
04c2ad2
+WEXTRA = @WEXTRA@
04c2ad2
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
04c2ad2
 YACC = @YACC@
e4cdb0b
@@ -239,9 +241,9 @@ target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
04c2ad2
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
04c2ad2
-@MUDFLAP_FALSE@	-Wextra -Wformat=2 -std=gnu99
04c2ad2
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2 -std=gnu99
04c2ad2
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
04c2ad2
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2 -std=gnu99
04c2ad2
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99
f6dcaea
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
04c2ad2
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
04c2ad2
 	   -I$(top_srcdir)/lib -I..
2c9c7d1
--- elfutils/ChangeLog
2c9c7d1
+++ elfutils/ChangeLog
e4cdb0b
@@ -39,6 +39,10 @@
fd98f05
 	* configure.ac: Add dummy automake conditional to get dependencies
fd98f05
 	for non-generic linker right.  See src/Makefile.am.
fd98f05
 
3cd46aa
+2005-11-22  Roland McGrath  <roland@redhat.com>
3cd46aa
+
3cd46aa
+	* configure.ac: Check for --as-needed linker option.
3cd46aa
+
3cd46aa
 2005-11-18  Roland McGrath  <roland@redhat.com>
3cd46aa
 
3cd46aa
 	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
e4cdb0b
@@ -86,6 +90,17 @@
6afeb40
 	* Makefile.am (all_SUBDIRS): Add libdwfl.
6afeb40
 	* configure.ac: Write libdwfl/Makefile.
6afeb40
 
6afeb40
+2005-05-31  Roland McGrath  <roland@redhat.com>
6788433
+
6788433
+	* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
6788433
+
6afeb40
+ 	* configure.ac: Check for struct stat st_?tim members.
6afeb40
+ 	* src/strip.c (process_file): Use st_?time if st_?tim are not there.
6788433
+
6afeb40
+ 	* configure.ac: Check for futimes function.
6afeb40
+ 	* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
6afeb40
+ 	(handle_ar) [! HAVE_FUTIMES]: Likewise.
6788433
+
6afeb40
 2005-05-19  Roland McGrath  <roland@redhat.com>
6788433
 
6afeb40
 	* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
2c9c7d1
--- elfutils/config/Makefile.in
2c9c7d1
+++ elfutils/config/Makefile.in
f6dcaea
@@ -72,6 +72,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
f6dcaea
@@ -101,6 +102,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
2c9c7d1
--- elfutils/configure
2c9c7d1
+++ elfutils/configure
e4cdb0b
@@ -676,6 +676,8 @@ YFLAGS
6143949
 LEX
6143949
 LEX_OUTPUT_ROOT
6143949
 LEXLIB
6143949
+WEXTRA
6143949
+LD_AS_NEEDED
6143949
 LOCALEDIR
6143949
 DATADIRNAME
6143949
 NATIVE_LD_TRUE
e4cdb0b
@@ -3894,6 +3896,88 @@ echo "$as_me: error: gcc with C99 suppor
b73b6ec
 fi
b73b6ec
 
b73b6ec
 
6143949
+{ echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
6143949
+echo $ECHO_N "checking for -Wextra option to $CC... $ECHO_C" >&6; }
b73b6ec
+if test "${ac_cv_cc_wextra+set}" = set; then
b73b6ec
+  echo $ECHO_N "(cached) $ECHO_C" >&6
b73b6ec
+else
b73b6ec
+  old_CFLAGS="$CFLAGS"
b73b6ec
+CFLAGS="$CFLAGS -Wextra"
b73b6ec
+cat >conftest.$ac_ext <<_ACEOF
b73b6ec
+void foo (void) { }
b73b6ec
+_ACEOF
b73b6ec
+rm -f conftest.$ac_objext
6143949
+if { (ac_try="$ac_compile"
6143949
+case "(($ac_try" in
6143949
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6143949
+  *) ac_try_echo=$ac_try;;
6143949
+esac
6143949
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
6143949
+  (eval "$ac_compile") 2>conftest.er1
b73b6ec
+  ac_status=$?
b73b6ec
+  grep -v '^ *+' conftest.er1 >conftest.err
b73b6ec
+  rm -f conftest.er1
b73b6ec
+  cat conftest.err >&5
b73b6ec
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
6143949
+  (exit $ac_status); } && {
6143949
+	 test -z "$ac_c_werror_flag" ||
6143949
+	 test ! -s conftest.err
6143949
+       } && test -s conftest.$ac_objext; then
2b510d6
+  ac_cv_cc_wextra=yes
b73b6ec
+else
b73b6ec
+  echo "$as_me: failed program was:" >&5
b73b6ec
+sed 's/^/| /' conftest.$ac_ext >&5
b73b6ec
+
6143949
+	ac_cv_cc_wextra=no
b73b6ec
+fi
6143949
+
6143949
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
b73b6ec
+CFLAGS="$old_CFLAGS"
b73b6ec
+fi
6143949
+{ echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
6143949
+echo "${ECHO_T}$ac_cv_cc_wextra" >&6; }
b73b6ec
+
6afeb40
+if test "x$ac_cv_cc_wextra" = xyes; then
b73b6ec
+  WEXTRA=-Wextra
6788433
+else
6788433
+  WEXTRA=-W
b73b6ec
+fi
b73b6ec
+
b73b6ec
+
6143949
+{ echo "$as_me:$LINENO: checking for --as-needed linker option" >&5
6143949
+echo $ECHO_N "checking for --as-needed linker option... $ECHO_C" >&6; }
3cd46aa
+if test "${ac_cv_as_needed+set}" = set; then
3cd46aa
+  echo $ECHO_N "(cached) $ECHO_C" >&6
3cd46aa
+else
3cd46aa
+  cat > conftest.c <
3cd46aa
+int main (void) { return 0; }
3cd46aa
+EOF
3cd46aa
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
3cd46aa
+			    -fPIC -shared -o conftest.so conftest.c
3cd46aa
+			    -Wl,--as-needed 1>&5'
3cd46aa
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3cd46aa
+  (eval $ac_try) 2>&5
3cd46aa
+  ac_status=$?
3cd46aa
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3cd46aa
+  (exit $ac_status); }; }
3cd46aa
+then
3cd46aa
+  ac_cv_as_needed=yes
3cd46aa
+else
3cd46aa
+  ac_cv_as_needed=no
3cd46aa
+fi
3cd46aa
+rm -f conftest*
3cd46aa
+fi
6143949
+{ echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5
6143949
+echo "${ECHO_T}$ac_cv_as_needed" >&6; }
3cd46aa
+if test "x$ac_cv_as_needed" = xyes; then
3cd46aa
+  LD_AS_NEEDED=-Wl,--as-needed
3cd46aa
+else
3cd46aa
+  LD_AS_NEEDED=
3cd46aa
+fi
3cd46aa
+
3cd46aa
+
3cd46aa
+
3cd46aa
+
b73b6ec
 LOCALEDIR=$datadir
b73b6ec
 
b73b6ec
 cat >>confdefs.h <<_ACEOF
e4cdb0b
@@ -5646,8 +5730,8 @@ YFLAGS!$YFLAGS$ac_delim
6143949
 LEX!$LEX$ac_delim
6143949
 LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
6143949
 LEXLIB!$LEXLIB$ac_delim
e4cdb0b
-LOCALEDIR!$LOCALEDIR$ac_delim
e4cdb0b
-DATADIRNAME!$DATADIRNAME$ac_delim
6143949
+WEXTRA!$WEXTRA$ac_delim
6143949
+LD_AS_NEEDED!$LD_AS_NEEDED$ac_delim
6143949
 _ACEOF
6143949
 
6143949
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
e4cdb0b
@@ -5689,6 +5773,8 @@ _ACEOF
6143949
 ac_delim='%!_!# '
6143949
 for ac_last_try in false false false false false :; do
6143949
   cat >conf$$subs.sed <<_ACEOF
e4cdb0b
+LOCALEDIR!$LOCALEDIR$ac_delim
e4cdb0b
+DATADIRNAME!$DATADIRNAME$ac_delim
e4cdb0b
 NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
e4cdb0b
 NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
6143949
 base_cpu!$base_cpu$ac_delim
e4cdb0b
@@ -5722,7 +5808,7 @@ LIBOBJS!$LIBOBJS$ac_delim
6143949
 LTLIBOBJS!$LTLIBOBJS$ac_delim
6143949
 _ACEOF
6143949
 
e4cdb0b
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then
e4cdb0b
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 33; then
6143949
     break
6143949
   elif $ac_last_try; then
6143949
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
2c9c7d1
--- elfutils/configure.ac
2c9c7d1
+++ elfutils/configure.ac
e4cdb0b
@@ -74,6 +74,34 @@ CFLAGS="$old_CFLAGS"])
a769ac6
 AS_IF([test "x$ac_cv_c99" != xyes],
a769ac6
       AC_MSG_ERROR([gcc with C99 support required]))
a769ac6
 
a769ac6
+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
a769ac6
+old_CFLAGS="$CFLAGS"
a769ac6
+CFLAGS="$CFLAGS -Wextra"
a769ac6
+AC_COMPILE_IFELSE([void foo (void) { }],
2b510d6
+		  ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
a769ac6
+CFLAGS="$old_CFLAGS"])
a769ac6
+AC_SUBST(WEXTRA)
6afeb40
+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
a769ac6
+
3cd46aa
+AC_CACHE_CHECK([for --as-needed linker option],
3cd46aa
+	       ac_cv_as_needed, [dnl
3cd46aa
+cat > conftest.c <
3cd46aa
+int main (void) { return 0; }
3cd46aa
+EOF
3cd46aa
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
3cd46aa
+			    -fPIC -shared -o conftest.so conftest.c
3cd46aa
+			    -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
3cd46aa
+then
3cd46aa
+  ac_cv_as_needed=yes
3cd46aa
+else
3cd46aa
+  ac_cv_as_needed=no
3cd46aa
+fi
3cd46aa
+rm -f conftest*])
3cd46aa
+AS_IF([test "x$ac_cv_as_needed" = xyes],
3cd46aa
+      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
3cd46aa
+AC_SUBST(LD_AS_NEEDED)
3cd46aa
+
3cd46aa
+
a769ac6
 LOCALEDIR=$datadir
a769ac6
 AC_SUBST(LOCALEDIR)
a769ac6
 AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
2c9c7d1
--- elfutils/lib/ChangeLog
2c9c7d1
+++ elfutils/lib/ChangeLog
e4cdb0b
@@ -41,6 +41,11 @@
76905ff
 	* Makefile.am (libeu_a_SOURCES): Add it.
76905ff
 	* system.h: Declare crc32_file.
76905ff
 
a769ac6
+2005-02-07  Roland McGrath  <roland@redhat.com>
a769ac6
+
a769ac6
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
a769ac6
+	(AM_CFLAGS): Use it in place of -Wextra.
a769ac6
+
76905ff
 2005-04-30  Ulrich Drepper  <drepper@redhat.com>
a769ac6
 
76905ff
 	* Makefile.am: Use -ffunction-sections for xmalloc.c.
2c9c7d1
--- elfutils/lib/Makefile.am
2c9c7d1
+++ elfutils/lib/Makefile.am
9729e74
@@ -25,12 +25,13 @@
9729e74
 ## <http://www.openinventionnetwork.com>.
a769ac6
 ##
a769ac6
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
a769ac6
 AM_CFLAGS = -fmudflap
a769ac6
 else
a769ac6
 AM_CFLAGS =
a769ac6
 endif
a769ac6
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra $($(*F)_CFLAGS)
a769ac6
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS)
a769ac6
 INCLUDES = -I$(srcdir)/../libelf -I..
a769ac6
 
a769ac6
 noinst_LIBRARIES = libeu.a
2c9c7d1
--- elfutils/lib/Makefile.in
2c9c7d1
+++ elfutils/lib/Makefile.in
7ecb9b4
@@ -93,6 +93,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
7ecb9b4
@@ -122,6 +123,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
7ecb9b4
@@ -177,9 +179,9 @@ target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
b73b6ec
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
b73b6ec
-@MUDFLAP_FALSE@	-Wextra $($(*F)_CFLAGS)
b73b6ec
+@MUDFLAP_FALSE@	$(WEXTRA) $($(*F)_CFLAGS)
b73b6ec
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
b73b6ec
-@MUDFLAP_TRUE@	-Wunused -Wextra $($(*F)_CFLAGS)
b73b6ec
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) $($(*F)_CFLAGS)
b73b6ec
 INCLUDES = -I$(srcdir)/../libelf -I..
b73b6ec
 noinst_LIBRARIES = libeu.a
9729e74
 libeu_a_SOURCES = xstrndup.c xmalloc.c next_prime.c \
6afeb40
--- elfutils/libasm/ChangeLog
6afeb40
+++ elfutils/libasm/ChangeLog
f6dcaea
@@ -54,6 +54,11 @@
455bc49
 	* asm_error.c: Add new error ASM_E_IOERROR.
455bc49
 	* libasmP.h: Add ASM_E_IOERROR definition.
455bc49
 
6afeb40
+2005-05-31  Roland McGrath  <roland@redhat.com>
6afeb40
+
6afeb40
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
6afeb40
+	(AM_CFLAGS): Use it in place of -Wextra.
6afeb40
+
6afeb40
 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
6afeb40
 
455bc49
 	* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
2c9c7d1
--- elfutils/libasm/Makefile.am
2c9c7d1
+++ elfutils/libasm/Makefile.am
9729e74
@@ -25,12 +25,13 @@
9729e74
 ## <http://www.openinventionnetwork.com>.
a769ac6
 ##
a769ac6
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
a769ac6
 AM_CFLAGS = -fmudflap
a769ac6
 else
a769ac6
 AM_CFLAGS =
a769ac6
 endif
455bc49
-AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
455bc49
+AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2
04c2ad2
 INCLUDES = -I. -I$(srcdir) -I.. \
04c2ad2
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
a769ac6
 	   -I$(top_srcdir)/lib
2c9c7d1
--- elfutils/libasm/Makefile.in
2c9c7d1
+++ elfutils/libasm/Makefile.in
f6dcaea
@@ -126,6 +126,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
f6dcaea
@@ -155,6 +156,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = 1
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
f6dcaea
@@ -210,9 +212,9 @@ target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
455bc49
 @MUDFLAP_FALSE@AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Werror -Wunused \
455bc49
-@MUDFLAP_FALSE@	-Wextra -Wformat=2
455bc49
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2
455bc49
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -std=gnu99 -Wall -Wshadow -Werror \
455bc49
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2
455bc49
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2
04c2ad2
 INCLUDES = -I. -I$(srcdir) -I.. \
04c2ad2
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
b73b6ec
 	   -I$(top_srcdir)/lib
2c9c7d1
--- elfutils/libcpu/ChangeLog
2c9c7d1
+++ elfutils/libcpu/ChangeLog
7ecb9b4
@@ -265,6 +265,11 @@
f6dcaea
 	* defs/i386.doc: New file.
f6dcaea
 	* defs/x86_64: New file.
f6dcaea
 
6788433
+2005-04-04  Roland McGrath  <roland@redhat.com>
6788433
+
6788433
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
6788433
+	(AM_CFLAGS): Use it instead of -Wextra.
6788433
+
6788433
 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
6788433
 
6788433
 	* Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
2c9c7d1
--- elfutils/libcpu/Makefile.am
2c9c7d1
+++ elfutils/libcpu/Makefile.am
f6dcaea
@@ -30,7 +30,8 @@ AM_CFLAGS = -fmudflap
f6dcaea
 else
f6dcaea
 AM_CFLAGS =
f6dcaea
 endif
f6dcaea
-AM_CFLAGS += -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fpic \
c881c2e
+WEXTRA = @WEXTRA@
f6dcaea
+AM_CFLAGS += -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fpic \
f6dcaea
 	     $($(*F)_CFLAGS) \
f6dcaea
 	     $(if $($(*F)_no_Werror),,-Werror)
f6dcaea
 INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \
2c9c7d1
--- elfutils/libcpu/Makefile.in
2c9c7d1
+++ elfutils/libcpu/Makefile.in
f6dcaea
@@ -109,6 +109,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
f6dcaea
 LEX_OUTPUT_ROOT = lex.$(
f6dcaea
@@ -138,6 +139,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
f6dcaea
@@ -192,10 +194,10 @@ sysconfdir = @sysconfdir@
b73b6ec
 target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
f6dcaea
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 \
f6dcaea
-@MUDFLAP_FALSE@	-fpic $($(*F)_CFLAGS) $(if \
f6dcaea
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) \
f6dcaea
+@MUDFLAP_FALSE@	-std=gnu99 -fpic $($(*F)_CFLAGS) $(if \
f6dcaea
 @MUDFLAP_FALSE@	$($(*F)_no_Werror),,-Werror)
f6dcaea
-@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Wunused -Wextra \
f6dcaea
+@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Wunused $(WEXTRA) \
f6dcaea
 @MUDFLAP_TRUE@	-std=gnu99 -fpic $($(*F)_CFLAGS) $(if \
f6dcaea
 @MUDFLAP_TRUE@	$($(*F)_no_Werror),,-Werror)
f6dcaea
 INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \
6afeb40
--- elfutils/libdw/ChangeLog
6afeb40
+++ elfutils/libdw/ChangeLog
e4cdb0b
@@ -495,6 +495,11 @@
6afeb40
 
6afeb40
 2005-05-31  Roland McGrath  <roland@redhat.com>
6afeb40
 
6afeb40
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
6afeb40
+	(AM_CFLAGS): Use it in place of -Wextra.
6afeb40
+
6afeb40
+2005-05-31  Roland McGrath  <roland@redhat.com>
6afeb40
+
6afeb40
 	* dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
6afeb40
 	formref offset.
6afeb40
 
2c9c7d1
--- elfutils/libdw/Makefile.am
2c9c7d1
+++ elfutils/libdw/Makefile.am
9729e74
@@ -25,6 +25,7 @@
9729e74
 ## <http://www.openinventionnetwork.com>.
a769ac6
 ##
6afeb40
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DIS_LIBDW
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
a769ac6
 AM_CFLAGS = -fmudflap
a769ac6
 else
9729e74
@@ -33,7 +34,7 @@ endif
04c2ad2
 if BUILD_STATIC
04c2ad2
 AM_CFLAGS += -fpic
a769ac6
 endif
a769ac6
-AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
a769ac6
+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
a769ac6
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
a769ac6
 VERSION = 1
a769ac6
 
2c9c7d1
--- elfutils/libdw/Makefile.in
2c9c7d1
+++ elfutils/libdw/Makefile.in
f6dcaea
@@ -164,6 +164,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
f6dcaea
@@ -193,6 +194,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = 1
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
f6dcaea
@@ -248,9 +250,10 @@ target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
04c2ad2
 @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Werror -Wshadow \
04c2ad2
-@MUDFLAP_FALSE@	-Wunused -Wformat=2 -Wextra -std=gnu99
04c2ad2
+@MUDFLAP_FALSE@	-Wunused -Wformat=2 $(WEXTRA) -std=gnu99
04c2ad2
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Werror \
04c2ad2
-@MUDFLAP_TRUE@	-Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
04c2ad2
+@MUDFLAP_TRUE@	-Wshadow -Wunused -Wformat=2 $(WEXTRA) \
04c2ad2
+@MUDFLAP_TRUE@	-std=gnu99
b73b6ec
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
4af02cf
 COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \
4af02cf
 						       $(COMPILE)))
6afeb40
--- elfutils/libdwfl/ChangeLog
6afeb40
+++ elfutils/libdwfl/ChangeLog
e4cdb0b
@@ -885,6 +885,11 @@
f71f402
 
6afeb40
 2005-07-21  Roland McGrath  <roland@redhat.com>
6afeb40
 
6afeb40
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
6afeb40
+	(AM_CFLAGS): Use it in place of -Wextra.
6afeb40
+
6afeb40
+2005-07-21  Roland McGrath  <roland@redhat.com>
6afeb40
+
6afeb40
 	* Makefile.am (noinst_HEADERS): Add loc2c.c.
6afeb40
 
6afeb40
 	* test2.c (main): Check sscanf result to quiet warning.
6afeb40
--- elfutils/libdwfl/Makefile.am
6afeb40
+++ elfutils/libdwfl/Makefile.am
9729e74
@@ -27,12 +27,13 @@
9729e74
 ## <http://www.openinventionnetwork.com>.
6afeb40
 ##
6afeb40
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
6afeb40
+WEXTRA = @WEXTRA@
6afeb40
 if MUDFLAP
6afeb40
 AM_CFLAGS = -fmudflap
6afeb40
 else
6afeb40
 AM_CFLAGS =
6afeb40
 endif
6afeb40
-AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
6afeb40
+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
6afeb40
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
6afeb40
 	   -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib
6afeb40
 VERSION = 1
6afeb40
--- elfutils/libdwfl/Makefile.in
6afeb40
+++ elfutils/libdwfl/Makefile.in
e4cdb0b
@@ -131,6 +131,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
e4cdb0b
@@ -160,6 +161,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
6afeb40
 USE_NLS = @USE_NLS@
6afeb40
 VERSION = 1
6afeb40
+WEXTRA = @WEXTRA@
6afeb40
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
6afeb40
 YACC = @YACC@
e4cdb0b
@@ -215,9 +217,9 @@ target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
6afeb40
 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
6afeb40
-@MUDFLAP_FALSE@	-Wextra -std=gnu99
6afeb40
+@MUDFLAP_FALSE@	$(WEXTRA) -std=gnu99
6afeb40
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \
6afeb40
-@MUDFLAP_TRUE@	-Wformat=2 -Wextra -std=gnu99
6afeb40
+@MUDFLAP_TRUE@	-Wformat=2 $(WEXTRA) -std=gnu99
6afeb40
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
6afeb40
 	   -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib
6afeb40
 
6afeb40
--- elfutils/libebl/ChangeLog
6afeb40
+++ elfutils/libebl/ChangeLog
e4cdb0b
@@ -554,6 +554,11 @@
6afeb40
 	* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
6afeb40
 	tracking works right.
6afeb40
 
6afeb40
+2005-05-31  Roland McGrath  <roland@redhat.com>
6afeb40
+
6afeb40
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
6afeb40
+	(AM_CFLAGS): Use it in place of -Wextra.
6afeb40
+
6afeb40
 2005-05-21  Ulrich Drepper  <drepper@redhat.com>
6afeb40
 
6afeb40
 	* libebl_x86_64.map: Add x86_64_core_note.
2c9c7d1
--- elfutils/libebl/Makefile.am
2c9c7d1
+++ elfutils/libebl/Makefile.am
9729e74
@@ -25,12 +25,13 @@
9729e74
 ## <http://www.openinventionnetwork.com>.
a769ac6
 ##
a769ac6
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
a769ac6
 AM_CFLAGS = -fmudflap
a769ac6
 else
a769ac6
 AM_CFLAGS =
a769ac6
 endif
a769ac6
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
a769ac6
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
a769ac6
 	     -std=gnu99
a769ac6
 
04c2ad2
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
2c9c7d1
--- elfutils/libebl/Makefile.in
2c9c7d1
+++ elfutils/libebl/Makefile.in
e4cdb0b
@@ -123,6 +123,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
e4cdb0b
@@ -152,6 +153,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = 1
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
e4cdb0b
@@ -207,9 +209,9 @@ target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
b73b6ec
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
b73b6ec
-@MUDFLAP_FALSE@	-Wextra -Wformat=2 -std=gnu99
b73b6ec
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2 -std=gnu99
b73b6ec
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
b73b6ec
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2 -std=gnu99
b73b6ec
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99
04c2ad2
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
f6dcaea
 	   -I$(top_srcdir)/lib -I.. -I$(srcdir)/../libasm
04c2ad2
 
6afeb40
--- elfutils/libelf/ChangeLog
6afeb40
+++ elfutils/libelf/ChangeLog
e4cdb0b
@@ -408,6 +408,11 @@
f71f402
 	If section content hasn't been read yet, do it before looking for the
f71f402
 	block size.  If no section data present, infer size of section header.
f71f402
 
6afeb40
+2005-05-31  Roland McGrath  <roland@redhat.com>
6afeb40
+
6afeb40
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
6afeb40
+	(AM_CFLAGS): Use it in place of -Wextra.
6afeb40
+
6afeb40
 2005-05-11  Ulrich Drepper  <drepper@redhat.com>
6afeb40
 
6afeb40
 	* elf.h: Update again.
6afeb40
--- elfutils/libelf/common.h
6afeb40
+++ elfutils/libelf/common.h
e4cdb0b
@@ -160,7 +160,7 @@ libelf_release_all (Elf *elf)
6afeb40
   (Var) = (sizeof (Var) == 1						      \
6afeb40
 	   ? (unsigned char) (Var)					      \
6afeb40
 	   : (sizeof (Var) == 2						      \
6afeb40
-	      ? bswap_16 (Var)						      \
6afeb40
+	      ? (unsigned short int) bswap_16 (Var)			      \
6afeb40
 	      : (sizeof (Var) == 4					      \
6afeb40
 		 ? bswap_32 (Var)					      \
6afeb40
 		 : bswap_64 (Var))))
e4cdb0b
@@ -169,7 +169,7 @@ libelf_release_all (Elf *elf)
6afeb40
   (Dst) = (sizeof (Var) == 1						      \
6afeb40
 	   ? (unsigned char) (Var)					      \
6afeb40
 	   : (sizeof (Var) == 2						      \
6afeb40
-	      ? bswap_16 (Var)						      \
6afeb40
+	      ? (unsigned short int) bswap_16 (Var)			      \
6afeb40
 	      : (sizeof (Var) == 4					      \
6afeb40
 		 ? bswap_32 (Var)					      \
6afeb40
 		 : bswap_64 (Var))))
2c9c7d1
--- elfutils/libelf/Makefile.am
2c9c7d1
+++ elfutils/libelf/Makefile.am
9729e74
@@ -25,6 +25,7 @@
9729e74
 ## <http://www.openinventionnetwork.com>.
a769ac6
 ##
a769ac6
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
06757fc
 AM_CFLAGS = -fmudflap
a769ac6
 else
e4cdb0b
@@ -33,7 +34,7 @@ endif
06757fc
 if BUILD_STATIC
06757fc
 AM_CFLAGS += -fpic
a769ac6
 endif
a769ac6
-AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
a769ac6
+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
a769ac6
 	     $($(*F)_CFLAGS)
a769ac6
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
a769ac6
 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
2c9c7d1
--- elfutils/libelf/Makefile.in
2c9c7d1
+++ elfutils/libelf/Makefile.in
e4cdb0b
@@ -171,6 +171,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
e4cdb0b
@@ -200,6 +201,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = 1
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
e4cdb0b
@@ -255,10 +257,10 @@ target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
06757fc
 @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \
06757fc
-@MUDFLAP_FALSE@	-Wunused -Wextra -Wformat=2 -std=gnu99 \
06757fc
+@MUDFLAP_FALSE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
06757fc
 @MUDFLAP_FALSE@	$($(*F)_CFLAGS)
06757fc
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Wshadow \
06757fc
-@MUDFLAP_TRUE@	-Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
06757fc
+@MUDFLAP_TRUE@	-Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
b73b6ec
 @MUDFLAP_TRUE@	$($(*F)_CFLAGS)
b73b6ec
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
b73b6ec
 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
2c9c7d1
--- elfutils/m4/Makefile.in
2c9c7d1
+++ elfutils/m4/Makefile.in
f6dcaea
@@ -71,6 +71,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
f6dcaea
@@ -100,6 +101,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
6afeb40
 USE_NLS = @USE_NLS@
6afeb40
 VERSION = @VERSION@
6afeb40
+WEXTRA = @WEXTRA@
6afeb40
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
6afeb40
 YACC = @YACC@
6afeb40
--- elfutils/Makefile.in
6afeb40
+++ elfutils/Makefile.in
f6dcaea
@@ -98,6 +98,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
f6dcaea
@@ -127,6 +128,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
6afeb40
--- elfutils/src/ChangeLog
6afeb40
+++ elfutils/src/ChangeLog
e4cdb0b
@@ -61,6 +61,11 @@
a6ac629
 	that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
a6ac629
 	is valid in RELRO.
a6ac629
 
7ecb9b4
+2008-03-01  Roland McGrath  <roland@redhat.com>
7ecb9b4
+
7ecb9b4
+	* readelf.c (dump_archive_index): Tweak portability hack
7ecb9b4
+	to match [__GNUC__ < 4] too.
7ecb9b4
+
7ecb9b4
 2008-02-29  Roland McGrath  <roland@redhat.com>
7ecb9b4
 
7ecb9b4
 	* readelf.c (print_attributes): Add a cast.
e4cdb0b
@@ -312,6 +317,8 @@
f82c9bc
 
f82c9bc
 	* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
f82c9bc
 
aae552b
+	* Makefile.am (readelf_no_Werror): New variable.
aae552b
+
aae552b
 2007-10-15  Roland McGrath  <roland@redhat.com>
aae552b
 
aae552b
 	* make-debug-archive.in: New file.
e4cdb0b
@@ -751,6 +758,10 @@
57cea90
 	* elflint.c (valid_e_machine): Add EM_ALPHA.
57cea90
 	Reported by Christian Aichinger <Greek0@gmx.net>.
57cea90
 
57cea90
+	* strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
57cea90
+	MADV_SEQUENTIAL if undefined.  	Don't call posix_madvise
57cea90
+	if neither is defined.
57cea90
+
57cea90
 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
57cea90
 
57cea90
 	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
e4cdb0b
@@ -827,6 +838,10 @@
fd98f05
 	* Makefile.am: Add hacks to create dependency files for non-generic
fd98f05
 	linker.
fd98f05
 
7b4e27b
+2006-04-05  Roland McGrath  <roland@redhat.com>
7b4e27b
+
7b4e27b
+	* strings.c (MAP_POPULATE): Define to 0 if undefined.
7b4e27b
+
7b4e27b
 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
7b4e27b
 
7b4e27b
 	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
e4cdb0b
@@ -1175,6 +1190,11 @@
6afeb40
 	* readelf.c (print_debug_loc_section): Fix indentation for larger
6afeb40
 	address size.
6afeb40
 
6afeb40
+2005-05-31  Roland McGrath  <roland@redhat.com>
6afeb40
+
6afeb40
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
6afeb40
+	(AM_CFLAGS): Use it in place of -Wextra.
6afeb40
+
6afeb40
 2005-05-30  Roland McGrath  <roland@redhat.com>
6afeb40
 
6afeb40
 	* readelf.c (print_debug_line_section): Print section offset of each
6afeb40
--- elfutils/src/findtextrel.c
6afeb40
+++ elfutils/src/findtextrel.c
9729e74
@@ -488,7 +488,11 @@ ptrcompare (const void *p1, const void *
6afeb40
 
6afeb40
 
6afeb40
 static void
6afeb40
-check_rel (size_t nsegments, struct segments segments[nsegments],
6afeb40
+check_rel (size_t nsegments, struct segments segments[
6afeb40
+#if __GNUC__ >= 4
6afeb40
+						      nsegments
6afeb40
+#endif
6afeb40
+	   ],
6afeb40
 	   GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
6afeb40
 	   const char *fname, bool more_than_one, void **knownsrcs)
6afeb40
 {
2c9c7d1
--- elfutils/src/Makefile.am
2c9c7d1
+++ elfutils/src/Makefile.am
9729e74
@@ -26,6 +26,7 @@
a769ac6
 ##
f6dcaea
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \
a769ac6
        -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
b504429
 AM_CFLAGS = -fmudflap
a769ac6
 else
9729e74
@@ -33,7 +34,7 @@ AM_CFLAGS =
a769ac6
 endif
06757fc
 AM_CFLAGS += -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
06757fc
 	     $(if $($(*F)_no_Werror),,-Werror) \
06757fc
-	     $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
06757fc
+	     $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
2335578
 	     $(if $($(*F)_no_Wformat),,-Wformat=2) $(CFLAGS_$(*F))
06757fc
 
6d45a85
 INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
f6dcaea
@@ -111,6 +112,9 @@ strings_no_Wformat = yes
aae552b
 # XXX While the file is not finished, don't warn about this
aae552b
 ldgeneric_no_Wunused = yes
aae552b
 
aae552b
+# Buggy old compilers.
aae552b
+readelf_no_Werror = yes
aae552b
+
aae552b
 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
aae552b
 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
aae552b
 size_LDADD = $(libelf) $(libeu) $(libmudflap)
2c9c7d1
--- elfutils/src/Makefile.in
2c9c7d1
+++ elfutils/src/Makefile.in
f6dcaea
@@ -201,6 +201,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
f6dcaea
@@ -230,6 +231,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@ -d
f6dcaea
@@ -287,13 +289,13 @@ top_srcdir = @top_srcdir@
06757fc
 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \
06757fc
 @MUDFLAP_FALSE@	$(native_ld_cflags) $(if \
06757fc
 @MUDFLAP_FALSE@	$($(*F)_no_Werror),,-Werror) $(if \
06757fc
-@MUDFLAP_FALSE@	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
06757fc
+@MUDFLAP_FALSE@	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
2335578
 @MUDFLAP_FALSE@	$($(*F)_no_Wformat),,-Wformat=2) \
2335578
 @MUDFLAP_FALSE@	$(CFLAGS_$(*F))
b504429
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -std=gnu99 \
b504429
 @MUDFLAP_TRUE@	$(native_ld_cflags) $(if \
06757fc
 @MUDFLAP_TRUE@	$($(*F)_no_Werror),,-Werror) $(if \
06757fc
-@MUDFLAP_TRUE@	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
06757fc
+@MUDFLAP_TRUE@	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
2335578
 @MUDFLAP_TRUE@	$($(*F)_no_Wformat),,-Wformat=2) $(CFLAGS_$(*F))
6d45a85
 INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
6d45a85
 	   -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
f6dcaea
@@ -337,6 +339,9 @@ size_no_Wformat = yes
aae552b
 strings_no_Wformat = yes
aae552b
 # XXX While the file is not finished, don't warn about this
aae552b
 ldgeneric_no_Wunused = yes
aae552b
+
aae552b
+# Buggy old compilers.
aae552b
+readelf_no_Werror = yes
aae552b
 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
aae552b
 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
aae552b
 size_LDADD = $(libelf) $(libeu) $(libmudflap)
7ecb9b4
--- elfutils/src/readelf.c
7ecb9b4
+++ elfutils/src/readelf.c
e4cdb0b
@@ -6419,7 +6419,7 @@ dump_archive_index (Elf *elf, const char
7ecb9b4
 	  if (unlikely (elf_rand (elf, as_off) == 0)
7ecb9b4
 	      || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
7ecb9b4
 			   == NULL))
7ecb9b4
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
7ecb9b4
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
7ecb9b4
 	    while (1)
7ecb9b4
 #endif
7ecb9b4
 	      error (EXIT_FAILURE, 0,
7b4e27b
--- elfutils/src/strings.c
7b4e27b
+++ elfutils/src/strings.c
7b4e27b
@@ -51,6 +51,10 @@
7b4e27b
 
7b4e27b
 #include <system.h>
7b4e27b
 
7b4e27b
+#ifndef MAP_POPULATE
7b4e27b
+# define MAP_POPULATE 0
7b4e27b
+#endif
7b4e27b
+
7b4e27b
 
7b4e27b
 /* Prototypes of local functions.  */
7b4e27b
 static int read_fd (int fd, const char *fname, off64_t fdlen);
57cea90
@@ -491,8 +495,13 @@ map_file (int fd, off64_t start_off, off
57cea90
 		    fd, start_off);
57cea90
       if (mem != MAP_FAILED)
57cea90
 	{
57cea90
+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
57cea90
+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
57cea90
+#endif
57cea90
+#ifdef POSIX_MADV_SEQUENTIAL
57cea90
 	  /* We will go through the mapping sequentially.  */
57cea90
 	  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
57cea90
+#endif
57cea90
 	  break;
57cea90
 	}
57cea90
       if (errno != EINVAL && errno != ENOMEM)
2c9c7d1
--- elfutils/src/strip.c
2c9c7d1
+++ elfutils/src/strip.c
9729e74
@@ -52,6 +52,12 @@
b73b6ec
 #include <libebl.h>
b73b6ec
 #include <system.h>
b73b6ec
 
b73b6ec
+#ifdef HAVE_FUTIMES
b73b6ec
+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
b73b6ec
+#else
b73b6ec
+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
b73b6ec
+#endif
b73b6ec
+
b73b6ec
 
b73b6ec
 /* Name and version of program.  */
b73b6ec
 static void print_version (FILE *stream, struct argp_state *state);
9729e74
@@ -300,8 +306,18 @@ process_file (const char *fname)
a769ac6
 
a769ac6
       /* If we have to preserve the timestamp, we need it in the
a769ac6
 	 format utimes() understands.  */
a769ac6
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
a769ac6
       TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
a769ac6
+#else
a769ac6
+      tv[0].tv_sec = pre_st.st_atime;
a769ac6
+      tv[0].tv_usec = 0;
a769ac6
+#endif
a769ac6
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
a769ac6
       TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
a769ac6
+#else
a769ac6
+      tv[1].tv_sec = pre_st.st_atime;
a769ac6
+      tv[1].tv_usec = 0;
a769ac6
+#endif
a769ac6
     }
a769ac6
 
a769ac6
   /* Open the file.  */
a6ac629
@@ -1745,7 +1761,7 @@ handle_elf (int fd, Elf *elf, const char
a769ac6
   /* If requested, preserve the timestamp.  */
a769ac6
   if (tvp != NULL)
a769ac6
     {
a769ac6
-      if (futimes (fd, tvp) != 0)
b73b6ec
+      if (FUTIMES (fd, output_fname, tvp) != 0)
a769ac6
 	{
a769ac6
 	  error (0, errno, gettext ("\
76905ff
 cannot set access and modification date of '%s'"),
a6ac629
@@ -1802,7 +1818,7 @@ handle_ar (int fd, Elf *elf, const char 
a769ac6
 
a769ac6
   if (tvp != NULL)
a769ac6
     {
a769ac6
-      if (unlikely (futimes (fd, tvp) != 0))
b73b6ec
+      if (unlikely (FUTIMES (fd, fname, tvp) != 0))
a769ac6
 	{
a769ac6
 	  error (0, errno, gettext ("\
76905ff
 cannot set access and modification date of '%s'"), fname);
6afeb40
--- elfutils/tests/ChangeLog
6afeb40
+++ elfutils/tests/ChangeLog
e4cdb0b
@@ -51,6 +51,8 @@
7ecb9b4
 
7ecb9b4
 2008-01-21  Roland McGrath  <roland@redhat.com>
7ecb9b4
 
7ecb9b4
+	* line2addr.c (main): Revert last change.
7ecb9b4
+
7ecb9b4
 	* testfile45.S.bz2: Add tests for cltq, cqto.
7ecb9b4
 	* testfile45.expect.bz2: Adjust.
7ecb9b4
 
e4cdb0b
@@ -759,6 +761,11 @@
6afeb40
 	* Makefile.am (TESTS): Add run-elflint-test.sh.
6afeb40
 	(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
6afeb40
 
6afeb40
+2005-05-31  Roland McGrath  <roland@redhat.com>
6afeb40
+
6afeb40
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
6afeb40
+	(AM_CFLAGS): Use it in place of -Wextra.
6afeb40
+
6afeb40
 2005-05-24  Ulrich Drepper  <drepper@redhat.com>
6afeb40
 
6afeb40
 	* get-files.c (main): Use correct format specifier.
7ecb9b4
--- elfutils/tests/line2addr.c
7ecb9b4
+++ elfutils/tests/line2addr.c
7ecb9b4
@@ -132,7 +132,7 @@ main (int argc, char *argv[])
7ecb9b4
     {
7ecb9b4
       struct args a = { .arg = argv[cnt] };
7ecb9b4
 
7ecb9b4
-      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
7ecb9b4
+      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
7ecb9b4
 	{
7ecb9b4
 	default:
7ecb9b4
 	case 0:
6afeb40
--- elfutils/tests/Makefile.am
6afeb40
+++ elfutils/tests/Makefile.am
9729e74
@@ -25,12 +25,13 @@
9729e74
 ## <http://www.openinventionnetwork.com>.
6afeb40
 ##
6afeb40
 DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE
6afeb40
+WEXTRA = @WEXTRA@
6afeb40
 if MUDFLAP
6afeb40
-AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\
6afeb40
+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\
6afeb40
 	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
04c2ad2
 BUILD_RPATH = \$$ORIGIN/../backends
6afeb40
 else
6afeb40
-AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
6afeb40
+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \
6afeb40
 	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
04c2ad2
 BUILT_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
6afeb40
 endif
2c9c7d1
--- elfutils/tests/Makefile.in
2c9c7d1
+++ elfutils/tests/Makefile.in
a6ac629
@@ -335,6 +335,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
3cd46aa
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
3cd46aa
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
3cd46aa
 LDFLAGS = @LDFLAGS@
3cd46aa
+LD_AS_NEEDED = @LD_AS_NEEDED@
3cd46aa
 LEX = @LEX@
3cd46aa
 LEXLIB = @LEXLIB@
3cd46aa
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
a6ac629
@@ -364,6 +365,7 @@ SHELL = @SHELL@
6143949
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
6143949
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
a6ac629
@@ -418,10 +420,10 @@ sysconfdir = @sysconfdir@
6afeb40
 target_alias = @target_alias@
6143949
 top_builddir = @top_builddir@
6143949
 top_srcdir = @top_srcdir@
6afeb40
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
6afeb40
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \
6afeb40
 @MUDFLAP_FALSE@	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
6afeb40
 
6afeb40
-@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\
6afeb40
+@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\
6afeb40
 @MUDFLAP_TRUE@	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
6afeb40
 
04c2ad2
 @MUDFLAP_TRUE@BUILD_RPATH = \$$ORIGIN/../backends