418cfd0
--- elfutils/backends/ChangeLog
418cfd0
+++ elfutils/backends/ChangeLog
3cb5dfb
@@ -157,6 +157,11 @@
3025beb
 	* sparc_init.c: Likewise.
3025beb
 	* x86_64_init.c: Likewise.
3025beb
 
80ba80a
+2005-11-22  Roland McGrath  <roland@redhat.com>
80ba80a
+
80ba80a
+	* Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
80ba80a
+	(libebl_%.so rule): Use it in place of -Wl,--as-needed.
80ba80a
+
80ba80a
 2005-11-19  Roland McGrath  <roland@redhat.com>
80ba80a
 
80ba80a
 	* ppc64_reloc.def: REL30 -> ADDR30.
3cb5dfb
@@ -179,6 +184,9 @@
418cfd0
 	* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
418cfd0
 	(CLEANFILES): Add libebl_$(m).so.
418cfd0
 
418cfd0
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
418cfd0
+	(AM_CFLAGS): Use it in place of -Wextra.
418cfd0
+
418cfd0
 	* ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
418cfd0
 	* ppc64_reloc.def: Likewise.
418cfd0
 
418cfd0
--- elfutils/backends/Makefile.am
418cfd0
+++ elfutils/backends/Makefile.am
e23544f
@@ -25,12 +25,14 @@
e23544f
 ## <http://www.openinventionnetwork.com>.
418cfd0
 ##
418cfd0
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
418cfd0
+WEXTRA = @WEXTRA@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
418cfd0
 if MUDFLAP
418cfd0
 AM_CFLAGS = -fmudflap
418cfd0
 else
418cfd0
 AM_CFLAGS =
418cfd0
 endif
418cfd0
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
418cfd0
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
418cfd0
 	     -std=gnu99
418cfd0
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl \
418cfd0
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
a01d88f
@@ -62,7 +64,7 @@ textrel_check = if readelf -d $@ | fgrep
80ba80a
 libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw)
80ba80a
 	$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
80ba80a
 		-Wl,--version-script,$(word 2,$^) \
80ba80a
-		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
80ba80a
+		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
80ba80a
 	$(textrel_check)
80ba80a
 
80ba80a
 libebl_%.map: Makefile
418cfd0
--- elfutils/backends/Makefile.in
418cfd0
+++ elfutils/backends/Makefile.in
3cb5dfb
@@ -147,6 +147,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -176,6 +177,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
418cfd0
 USE_NLS = @USE_NLS@
418cfd0
 VERSION = @VERSION@
418cfd0
+WEXTRA = @WEXTRA@
418cfd0
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
418cfd0
 YACC = @YACC@
3cb5dfb
@@ -231,9 +233,9 @@ target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 top_srcdir = @top_srcdir@
418cfd0
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
418cfd0
-@MUDFLAP_FALSE@	-Wextra -Wformat=2 -std=gnu99
418cfd0
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2 -std=gnu99
418cfd0
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
418cfd0
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2 -std=gnu99
418cfd0
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99
418cfd0
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl \
418cfd0
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
418cfd0
 	   -I$(top_srcdir)/lib -I..
3cb5dfb
@@ -605,7 +607,7 @@ uninstall-am:
80ba80a
 libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw)
80ba80a
 	$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
80ba80a
 		-Wl,--version-script,$(word 2,$^) \
80ba80a
-		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
80ba80a
+		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
80ba80a
 	$(textrel_check)
80ba80a
 
80ba80a
 libebl_%.map: Makefile
570047f
--- elfutils/ChangeLog
570047f
+++ elfutils/ChangeLog
3cb5dfb
@@ -25,6 +25,10 @@
a997709
 	* configure.ac: Add dummy automake conditional to get dependencies
a997709
 	for non-generic linker right.  See src/Makefile.am.
a997709
 
80ba80a
+2005-11-22  Roland McGrath  <roland@redhat.com>
80ba80a
+
80ba80a
+	* configure.ac: Check for --as-needed linker option.
80ba80a
+
80ba80a
 2005-11-18  Roland McGrath  <roland@redhat.com>
80ba80a
 
80ba80a
 	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
3cb5dfb
@@ -72,6 +76,17 @@
f995fa8
 	* Makefile.am (all_SUBDIRS): Add libdwfl.
f995fa8
 	* configure.ac: Write libdwfl/Makefile.
f995fa8
 
f995fa8
+2005-05-31  Roland McGrath  <roland@redhat.com>
6788433
+
6788433
+	* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
6788433
+
f995fa8
+ 	* configure.ac: Check for struct stat st_?tim members.
f995fa8
+ 	* src/strip.c (process_file): Use st_?time if st_?tim are not there.
6788433
+
f995fa8
+ 	* configure.ac: Check for futimes function.
f995fa8
+ 	* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
f995fa8
+ 	(handle_ar) [! HAVE_FUTIMES]: Likewise.
6788433
+
f995fa8
 2005-05-19  Roland McGrath  <roland@redhat.com>
6788433
 
f995fa8
 	* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
570047f
--- elfutils/config/Makefile.in
570047f
+++ elfutils/config/Makefile.in
3cb5dfb
@@ -71,6 +71,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -100,6 +101,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
570047f
--- elfutils/configure
570047f
+++ elfutils/configure
3cb5dfb
@@ -674,6 +674,8 @@ YFLAGS
3cb5dfb
 LEX
3cb5dfb
 LEX_OUTPUT_ROOT
3cb5dfb
 LEXLIB
3cb5dfb
+WEXTRA
3cb5dfb
+LD_AS_NEEDED
3cb5dfb
 LOCALEDIR
3cb5dfb
 DATADIRNAME
3cb5dfb
 NATIVE_LD_TRUE
3cb5dfb
@@ -3874,6 +3876,88 @@ echo "$as_me: error: gcc with C99 suppor
b73b6ec
 fi
b73b6ec
 
b73b6ec
 
3cb5dfb
+{ echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
3cb5dfb
+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
3cb5dfb
+if { (ac_try="$ac_compile"
3cb5dfb
+case "(($ac_try" in
3cb5dfb
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3cb5dfb
+  *) ac_try_echo=$ac_try;;
3cb5dfb
+esac
3cb5dfb
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
3cb5dfb
+  (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
3cb5dfb
+  (exit $ac_status); } && {
3cb5dfb
+	 test -z "$ac_c_werror_flag" ||
3cb5dfb
+	 test ! -s conftest.err
3cb5dfb
+       } && test -s conftest.$ac_objext; then
b4dfabf
+  ac_cv_cc_wextra=yes
b73b6ec
+else
b73b6ec
+  echo "$as_me: failed program was:" >&5
b73b6ec
+sed 's/^/| /' conftest.$ac_ext >&5
b73b6ec
+
3cb5dfb
+	ac_cv_cc_wextra=no
b73b6ec
+fi
3cb5dfb
+
3cb5dfb
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
b73b6ec
+CFLAGS="$old_CFLAGS"
b73b6ec
+fi
3cb5dfb
+{ echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
3cb5dfb
+echo "${ECHO_T}$ac_cv_cc_wextra" >&6; }
b73b6ec
+
f995fa8
+if test "x$ac_cv_cc_wextra" = xyes; then
b73b6ec
+  WEXTRA=-Wextra
6788433
+else
6788433
+  WEXTRA=-W
b73b6ec
+fi
b73b6ec
+
b73b6ec
+
3cb5dfb
+{ echo "$as_me:$LINENO: checking for --as-needed linker option" >&5
3cb5dfb
+echo $ECHO_N "checking for --as-needed linker option... $ECHO_C" >&6; }
80ba80a
+if test "${ac_cv_as_needed+set}" = set; then
80ba80a
+  echo $ECHO_N "(cached) $ECHO_C" >&6
80ba80a
+else
80ba80a
+  cat > conftest.c <
80ba80a
+int main (void) { return 0; }
80ba80a
+EOF
80ba80a
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
80ba80a
+			    -fPIC -shared -o conftest.so conftest.c
80ba80a
+			    -Wl,--as-needed 1>&5'
80ba80a
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
80ba80a
+  (eval $ac_try) 2>&5
80ba80a
+  ac_status=$?
80ba80a
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
80ba80a
+  (exit $ac_status); }; }
80ba80a
+then
80ba80a
+  ac_cv_as_needed=yes
80ba80a
+else
80ba80a
+  ac_cv_as_needed=no
80ba80a
+fi
80ba80a
+rm -f conftest*
80ba80a
+fi
3cb5dfb
+{ echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5
3cb5dfb
+echo "${ECHO_T}$ac_cv_as_needed" >&6; }
80ba80a
+if test "x$ac_cv_as_needed" = xyes; then
80ba80a
+  LD_AS_NEEDED=-Wl,--as-needed
80ba80a
+else
80ba80a
+  LD_AS_NEEDED=
80ba80a
+fi
80ba80a
+
80ba80a
+
80ba80a
+
80ba80a
+
b73b6ec
 LOCALEDIR=$datadir
b73b6ec
 
b73b6ec
 cat >>confdefs.h <<_ACEOF
3cb5dfb
@@ -5608,10 +5692,10 @@ YFLAGS!$YFLAGS$ac_delim
3cb5dfb
 LEX!$LEX$ac_delim
3cb5dfb
 LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
3cb5dfb
 LEXLIB!$LEXLIB$ac_delim
3cb5dfb
+WEXTRA!$WEXTRA$ac_delim
3cb5dfb
+LD_AS_NEEDED!$LD_AS_NEEDED$ac_delim
3cb5dfb
 LOCALEDIR!$LOCALEDIR$ac_delim
3cb5dfb
 DATADIRNAME!$DATADIRNAME$ac_delim
3cb5dfb
-NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
3cb5dfb
-NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
3cb5dfb
 _ACEOF
3cb5dfb
 
3cb5dfb
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
3cb5dfb
@@ -5653,6 +5737,8 @@ _ACEOF
3cb5dfb
 ac_delim='%!_!# '
3cb5dfb
 for ac_last_try in false false false false false :; do
3cb5dfb
   cat >conf$$subs.sed <<_ACEOF
3cb5dfb
+NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
3cb5dfb
+NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
3cb5dfb
 base_cpu!$base_cpu$ac_delim
3cb5dfb
 NEVER_TRUE!$NEVER_TRUE$ac_delim
3cb5dfb
 NEVER_FALSE!$NEVER_FALSE$ac_delim
3cb5dfb
@@ -5683,7 +5769,7 @@ LIBOBJS!$LIBOBJS$ac_delim
3cb5dfb
 LTLIBOBJS!$LTLIBOBJS$ac_delim
3cb5dfb
 _ACEOF
3cb5dfb
 
3cb5dfb
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then
3cb5dfb
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 30; then
3cb5dfb
     break
3cb5dfb
   elif $ac_last_try; then
3cb5dfb
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
570047f
--- elfutils/configure.ac
570047f
+++ elfutils/configure.ac
3cb5dfb
@@ -71,6 +71,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) { }],
b4dfabf
+		  ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
a769ac6
+CFLAGS="$old_CFLAGS"])
a769ac6
+AC_SUBST(WEXTRA)
f995fa8
+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
a769ac6
+
80ba80a
+AC_CACHE_CHECK([for --as-needed linker option],
80ba80a
+	       ac_cv_as_needed, [dnl
80ba80a
+cat > conftest.c <
80ba80a
+int main (void) { return 0; }
80ba80a
+EOF
80ba80a
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
80ba80a
+			    -fPIC -shared -o conftest.so conftest.c
80ba80a
+			    -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
80ba80a
+then
80ba80a
+  ac_cv_as_needed=yes
80ba80a
+else
80ba80a
+  ac_cv_as_needed=no
80ba80a
+fi
80ba80a
+rm -f conftest*])
80ba80a
+AS_IF([test "x$ac_cv_as_needed" = xyes],
80ba80a
+      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
80ba80a
+AC_SUBST(LD_AS_NEEDED)
80ba80a
+
80ba80a
+
a769ac6
 LOCALEDIR=$datadir
a769ac6
 AC_SUBST(LOCALEDIR)
a769ac6
 AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
570047f
--- elfutils/lib/ChangeLog
570047f
+++ elfutils/lib/ChangeLog
e23544f
@@ -16,6 +16,11 @@
5fa3867
 	* Makefile.am (libeu_a_SOURCES): Add it.
5fa3867
 	* system.h: Declare crc32_file.
5fa3867
 
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
+
5fa3867
 2005-04-30  Ulrich Drepper  <drepper@redhat.com>
a769ac6
 
5fa3867
 	* Makefile.am: Use -ffunction-sections for xmalloc.c.
570047f
--- elfutils/lib/Makefile.am
570047f
+++ elfutils/lib/Makefile.am
e23544f
@@ -25,12 +25,13 @@
e23544f
 ## <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
570047f
--- elfutils/lib/Makefile.in
570047f
+++ elfutils/lib/Makefile.in
3cb5dfb
@@ -91,6 +91,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -120,6 +121,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
3cb5dfb
@@ -175,9 +177,9 @@ target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 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
e23544f
 libeu_a_SOURCES = xstrndup.c xmalloc.c next_prime.c \
f995fa8
--- elfutils/libasm/ChangeLog
f995fa8
+++ elfutils/libasm/ChangeLog
9a3c170
@@ -32,6 +32,11 @@
2ca6928
 	* asm_error.c: Add new error ASM_E_IOERROR.
2ca6928
 	* libasmP.h: Add ASM_E_IOERROR definition.
2ca6928
 
f995fa8
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa8
+
f995fa8
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa8
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa8
+
f995fa8
 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
f995fa8
 
2ca6928
 	* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
570047f
--- elfutils/libasm/Makefile.am
570047f
+++ elfutils/libasm/Makefile.am
e23544f
@@ -25,12 +25,13 @@
e23544f
 ## <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
2ca6928
-AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
2ca6928
+AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2
418cfd0
 INCLUDES = -I. -I$(srcdir) -I.. \
418cfd0
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
a769ac6
 	   -I$(top_srcdir)/lib
570047f
--- elfutils/libasm/Makefile.in
570047f
+++ elfutils/libasm/Makefile.in
3cb5dfb
@@ -124,6 +124,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -153,6 +154,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = 1
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
3cb5dfb
@@ -208,9 +210,9 @@ target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 top_srcdir = @top_srcdir@
2ca6928
 @MUDFLAP_FALSE@AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Werror -Wunused \
2ca6928
-@MUDFLAP_FALSE@	-Wextra -Wformat=2
2ca6928
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2
2ca6928
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -std=gnu99 -Wall -Wshadow -Werror \
2ca6928
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2
2ca6928
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2
418cfd0
 INCLUDES = -I. -I$(srcdir) -I.. \
418cfd0
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
b73b6ec
 	   -I$(top_srcdir)/lib
570047f
--- elfutils/libcpu/ChangeLog
570047f
+++ elfutils/libcpu/ChangeLog
6788433
@@ -1,3 +1,8 @@
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.
570047f
--- elfutils/libcpu/Makefile.am
570047f
+++ elfutils/libcpu/Makefile.am
e23544f
@@ -25,7 +25,8 @@
e23544f
 ## <http://www.openinventionnetwork.com>.
c881c2e
 ##
c881c2e
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
c881c2e
-AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
c881c2e
+WEXTRA = @WEXTRA@
c881c2e
+AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
c881c2e
 INCLUDES = -I$(srcdir)
c881c2e
 
c881c2e
 noinst_LIBRARIES = libcpu_i386.a
570047f
--- elfutils/libcpu/Makefile.in
570047f
+++ elfutils/libcpu/Makefile.in
3cb5dfb
@@ -87,6 +87,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -116,6 +117,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
3cb5dfb
@@ -170,7 +172,7 @@ sysconfdir = @sysconfdir@
b73b6ec
 target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 top_srcdir = @top_srcdir@
b73b6ec
-AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
b73b6ec
+AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
b73b6ec
 INCLUDES = -I$(srcdir)
b73b6ec
 noinst_LIBRARIES = libcpu_i386.a
b73b6ec
 libcpu_i386_a_SOURCES = i386_dis.c
f995fa8
--- elfutils/libdw/ChangeLog
f995fa8
+++ elfutils/libdw/ChangeLog
52ee0c5
@@ -386,6 +386,11 @@
f995fa8
 
f995fa8
 2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa8
 
f995fa8
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa8
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa8
+
f995fa8
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa8
+
f995fa8
 	* dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
f995fa8
 	formref offset.
f995fa8
 
570047f
--- elfutils/libdw/Makefile.am
570047f
+++ elfutils/libdw/Makefile.am
e23544f
@@ -25,6 +25,7 @@
e23544f
 ## <http://www.openinventionnetwork.com>.
a769ac6
 ##
f995fa8
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DIS_LIBDW
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
a769ac6
 AM_CFLAGS = -fmudflap
a769ac6
 else
e23544f
@@ -33,7 +34,7 @@ endif
418cfd0
 if BUILD_STATIC
418cfd0
 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
 
570047f
--- elfutils/libdw/Makefile.in
570047f
+++ elfutils/libdw/Makefile.in
3cb5dfb
@@ -163,6 +163,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -192,6 +193,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = 1
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
3cb5dfb
@@ -247,9 +249,10 @@ target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 top_srcdir = @top_srcdir@
418cfd0
 @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Werror -Wshadow \
418cfd0
-@MUDFLAP_FALSE@	-Wunused -Wformat=2 -Wextra -std=gnu99
418cfd0
+@MUDFLAP_FALSE@	-Wunused -Wformat=2 $(WEXTRA) -std=gnu99
418cfd0
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Werror \
418cfd0
-@MUDFLAP_TRUE@	-Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
418cfd0
+@MUDFLAP_TRUE@	-Wshadow -Wunused -Wformat=2 $(WEXTRA) \
418cfd0
+@MUDFLAP_TRUE@	-std=gnu99
b73b6ec
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
65b0804
 COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \
65b0804
 						       $(COMPILE)))
f995fa8
--- elfutils/libdwfl/ChangeLog
f995fa8
+++ elfutils/libdwfl/ChangeLog
52ee0c5
@@ -531,6 +531,11 @@
469b3c7
 
f995fa8
 2005-07-21  Roland McGrath  <roland@redhat.com>
f995fa8
 
f995fa8
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa8
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa8
+
f995fa8
+2005-07-21  Roland McGrath  <roland@redhat.com>
f995fa8
+
f995fa8
 	* Makefile.am (noinst_HEADERS): Add loc2c.c.
f995fa8
 
f995fa8
 	* test2.c (main): Check sscanf result to quiet warning.
f995fa8
--- elfutils/libdwfl/Makefile.am
f995fa8
+++ elfutils/libdwfl/Makefile.am
e23544f
@@ -27,12 +27,13 @@
e23544f
 ## <http://www.openinventionnetwork.com>.
f995fa8
 ##
f995fa8
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
f995fa8
+WEXTRA = @WEXTRA@
f995fa8
 if MUDFLAP
f995fa8
 AM_CFLAGS = -fmudflap
f995fa8
 else
f995fa8
 AM_CFLAGS =
f995fa8
 endif
f995fa8
-AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
f995fa8
+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
f995fa8
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
f995fa8
 	   -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib
f995fa8
 VERSION = 1
f995fa8
--- elfutils/libdwfl/Makefile.in
f995fa8
+++ elfutils/libdwfl/Makefile.in
3cb5dfb
@@ -124,6 +124,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -153,6 +154,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
f995fa8
 USE_NLS = @USE_NLS@
f995fa8
 VERSION = 1
f995fa8
+WEXTRA = @WEXTRA@
f995fa8
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
f995fa8
 YACC = @YACC@
3cb5dfb
@@ -208,9 +210,9 @@ target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 top_srcdir = @top_srcdir@
f995fa8
 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
f995fa8
-@MUDFLAP_FALSE@	-Wextra -std=gnu99
f995fa8
+@MUDFLAP_FALSE@	$(WEXTRA) -std=gnu99
f995fa8
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \
f995fa8
-@MUDFLAP_TRUE@	-Wformat=2 -Wextra -std=gnu99
f995fa8
+@MUDFLAP_TRUE@	-Wformat=2 $(WEXTRA) -std=gnu99
f995fa8
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
f995fa8
 	   -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib
f995fa8
 
f995fa8
--- elfutils/libebl/ChangeLog
f995fa8
+++ elfutils/libebl/ChangeLog
52ee0c5
@@ -476,6 +476,11 @@
f995fa8
 	* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
f995fa8
 	tracking works right.
f995fa8
 
f995fa8
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa8
+
f995fa8
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa8
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa8
+
f995fa8
 2005-05-21  Ulrich Drepper  <drepper@redhat.com>
f995fa8
 
f995fa8
 	* libebl_x86_64.map: Add x86_64_core_note.
570047f
--- elfutils/libebl/Makefile.am
570047f
+++ elfutils/libebl/Makefile.am
e23544f
@@ -25,12 +25,13 @@
e23544f
 ## <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
 
418cfd0
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
570047f
--- elfutils/libebl/Makefile.in
570047f
+++ elfutils/libebl/Makefile.in
3cb5dfb
@@ -120,6 +120,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -149,6 +150,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = 1
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
3cb5dfb
@@ -204,9 +206,9 @@ target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 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
418cfd0
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
418cfd0
 	   -I$(top_srcdir)/lib -I..
418cfd0
 
f995fa8
--- elfutils/libelf/ChangeLog
f995fa8
+++ elfutils/libelf/ChangeLog
52ee0c5
@@ -234,6 +234,11 @@
469b3c7
 	If section content hasn't been read yet, do it before looking for the
469b3c7
 	block size.  If no section data present, infer size of section header.
469b3c7
 
f995fa8
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa8
+
f995fa8
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa8
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa8
+
f995fa8
 2005-05-11  Ulrich Drepper  <drepper@redhat.com>
f995fa8
 
f995fa8
 	* elf.h: Update again.
f995fa8
--- elfutils/libelf/common.h
f995fa8
+++ elfutils/libelf/common.h
e23544f
@@ -155,7 +155,7 @@ libelf_release_all (Elf *elf)
f995fa8
   (Var) = (sizeof (Var) == 1						      \
f995fa8
 	   ? (unsigned char) (Var)					      \
f995fa8
 	   : (sizeof (Var) == 2						      \
f995fa8
-	      ? bswap_16 (Var)						      \
f995fa8
+	      ? (unsigned short int) bswap_16 (Var)			      \
f995fa8
 	      : (sizeof (Var) == 4					      \
f995fa8
 		 ? bswap_32 (Var)					      \
f995fa8
 		 : bswap_64 (Var))))
e23544f
@@ -164,7 +164,7 @@ libelf_release_all (Elf *elf)
f995fa8
   (Dst) = (sizeof (Var) == 1						      \
f995fa8
 	   ? (unsigned char) (Var)					      \
f995fa8
 	   : (sizeof (Var) == 2						      \
f995fa8
-	      ? bswap_16 (Var)						      \
f995fa8
+	      ? (unsigned short int) bswap_16 (Var)			      \
f995fa8
 	      : (sizeof (Var) == 4					      \
f995fa8
 		 ? bswap_32 (Var)					      \
f995fa8
 		 : bswap_64 (Var))))
570047f
--- elfutils/libelf/Makefile.am
570047f
+++ elfutils/libelf/Makefile.am
e23544f
@@ -25,6 +25,7 @@
e23544f
 ## <http://www.openinventionnetwork.com>.
a769ac6
 ##
a769ac6
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
511c104
 AM_CFLAGS = -fmudflap
a769ac6
 else
e23544f
@@ -33,7 +34,10 @@ endif
511c104
 if BUILD_STATIC
511c104
 AM_CFLAGS += -fpic
a769ac6
 endif
a769ac6
-AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
850d0e1
+if BUILD_STATIC
850d0e1
+AM_CFLAGS += -fpic
850d0e1
+endif
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)
570047f
--- elfutils/libelf/Makefile.in
570047f
+++ elfutils/libelf/Makefile.in
3cb5dfb
@@ -34,7 +34,7 @@ PRE_UNINSTALL = :
850d0e1
 POST_UNINSTALL = :
850d0e1
 build_triplet = @build@
850d0e1
 host_triplet = @host@
850d0e1
-@BUILD_STATIC_TRUE@am__append_1 = -fpic
850d0e1
+@BUILD_STATIC_TRUE@am__append_1 = -fpic -fpic
850d0e1
 @MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
850d0e1
 @MUDFLAP_TRUE@am_libelf_pic_a_OBJECTS =
850d0e1
 subdir = libelf
3cb5dfb
@@ -167,6 +167,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -196,6 +197,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = 1
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
3cb5dfb
@@ -251,10 +253,10 @@ target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 top_srcdir = @top_srcdir@
511c104
 @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \
511c104
-@MUDFLAP_FALSE@	-Wunused -Wextra -Wformat=2 -std=gnu99 \
511c104
+@MUDFLAP_FALSE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
511c104
 @MUDFLAP_FALSE@	$($(*F)_CFLAGS)
511c104
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Wshadow \
511c104
-@MUDFLAP_TRUE@	-Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
511c104
+@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)
570047f
--- elfutils/m4/Makefile.in
570047f
+++ elfutils/m4/Makefile.in
3cb5dfb
@@ -70,6 +70,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -99,6 +100,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
f995fa8
 USE_NLS = @USE_NLS@
f995fa8
 VERSION = @VERSION@
f995fa8
+WEXTRA = @WEXTRA@
f995fa8
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
f995fa8
 YACC = @YACC@
f995fa8
--- elfutils/Makefile.in
f995fa8
+++ elfutils/Makefile.in
3cb5dfb
@@ -97,6 +97,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -126,6 +127,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
f995fa8
--- elfutils/src/ChangeLog
f995fa8
+++ elfutils/src/ChangeLog
52ee0c5
@@ -220,6 +220,10 @@
9a3c170
 	* elflint.c (valid_e_machine): Add EM_ALPHA.
9a3c170
 	Reported by Christian Aichinger <Greek0@gmx.net>.
9a3c170
 
9a3c170
+	* strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
9a3c170
+	MADV_SEQUENTIAL if undefined.  	Don't call posix_madvise
9a3c170
+	if neither is defined.
9a3c170
+
9a3c170
 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
9a3c170
 
9a3c170
 	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
52ee0c5
@@ -296,6 +300,10 @@
a997709
 	* Makefile.am: Add hacks to create dependency files for non-generic
a997709
 	linker.
a997709
 
3c3d383
+2006-04-05  Roland McGrath  <roland@redhat.com>
3c3d383
+
3c3d383
+	* strings.c (MAP_POPULATE): Define to 0 if undefined.
3c3d383
+
3c3d383
 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
3c3d383
 
3c3d383
 	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
52ee0c5
@@ -644,6 +652,11 @@
f995fa8
 	* readelf.c (print_debug_loc_section): Fix indentation for larger
f995fa8
 	address size.
f995fa8
 
f995fa8
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa8
+
f995fa8
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa8
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa8
+
f995fa8
 2005-05-30  Roland McGrath  <roland@redhat.com>
f995fa8
 
f995fa8
 	* readelf.c (print_debug_line_section): Print section offset of each
f995fa8
--- elfutils/src/findtextrel.c
f995fa8
+++ elfutils/src/findtextrel.c
e23544f
@@ -488,7 +488,11 @@ ptrcompare (const void *p1, const void *
f995fa8
 
f995fa8
 
f995fa8
 static void
f995fa8
-check_rel (size_t nsegments, struct segments segments[nsegments],
f995fa8
+check_rel (size_t nsegments, struct segments segments[
f995fa8
+#if __GNUC__ >= 4
f995fa8
+						      nsegments
f995fa8
+#endif
f995fa8
+	   ],
f995fa8
 	   GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
f995fa8
 	   const char *fname, bool more_than_one, void **knownsrcs)
f995fa8
 {
570047f
--- elfutils/src/Makefile.am
570047f
+++ elfutils/src/Makefile.am
e23544f
@@ -26,6 +26,7 @@
a769ac6
 ##
a769ac6
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
a769ac6
        -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
a769ac6
+WEXTRA = @WEXTRA@
a769ac6
 if MUDFLAP
850d0e1
 AM_CFLAGS = -fmudflap
a769ac6
 else
e23544f
@@ -33,7 +34,7 @@ AM_CFLAGS =
a769ac6
 endif
511c104
 AM_CFLAGS += -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
511c104
 	     $(if $($(*F)_no_Werror),,-Werror) \
511c104
-	     $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
511c104
+	     $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
2a32e1c
 	     $(if $($(*F)_no_Wformat),,-Wformat=2) $(CFLAGS_$(*F))
511c104
 
fb15a50
 INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
570047f
--- elfutils/src/Makefile.in
570047f
+++ elfutils/src/Makefile.in
3cb5dfb
@@ -197,6 +197,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
3cb5dfb
@@ -226,6 +227,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@ -d
3cb5dfb
@@ -283,13 +285,13 @@ top_srcdir = @top_srcdir@
511c104
 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \
511c104
 @MUDFLAP_FALSE@	$(native_ld_cflags) $(if \
511c104
 @MUDFLAP_FALSE@	$($(*F)_no_Werror),,-Werror) $(if \
511c104
-@MUDFLAP_FALSE@	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
511c104
+@MUDFLAP_FALSE@	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
2a32e1c
 @MUDFLAP_FALSE@	$($(*F)_no_Wformat),,-Wformat=2) \
2a32e1c
 @MUDFLAP_FALSE@	$(CFLAGS_$(*F))
850d0e1
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -std=gnu99 \
850d0e1
 @MUDFLAP_TRUE@	$(native_ld_cflags) $(if \
511c104
 @MUDFLAP_TRUE@	$($(*F)_no_Werror),,-Werror) $(if \
511c104
-@MUDFLAP_TRUE@	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
511c104
+@MUDFLAP_TRUE@	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
2a32e1c
 @MUDFLAP_TRUE@	$($(*F)_no_Wformat),,-Wformat=2) $(CFLAGS_$(*F))
fb15a50
 INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
fb15a50
 	   -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
3c3d383
--- elfutils/src/strings.c
3c3d383
+++ elfutils/src/strings.c
3c3d383
@@ -51,6 +51,10 @@
3c3d383
 
3c3d383
 #include <system.h>
3c3d383
 
3c3d383
+#ifndef MAP_POPULATE
3c3d383
+# define MAP_POPULATE 0
3c3d383
+#endif
3c3d383
+
3c3d383
 
3c3d383
 /* Prototypes of local functions.  */
3c3d383
 static int read_fd (int fd, const char *fname, off64_t fdlen);
9a3c170
@@ -491,8 +495,13 @@ map_file (int fd, off64_t start_off, off
9a3c170
 		    fd, start_off);
9a3c170
       if (mem != MAP_FAILED)
9a3c170
 	{
9a3c170
+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
9a3c170
+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
9a3c170
+#endif
9a3c170
+#ifdef POSIX_MADV_SEQUENTIAL
9a3c170
 	  /* We will go through the mapping sequentially.  */
9a3c170
 	  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
9a3c170
+#endif
9a3c170
 	  break;
9a3c170
 	}
9a3c170
       if (errno != EINVAL && errno != ENOMEM)
570047f
--- elfutils/src/strip.c
570047f
+++ elfutils/src/strip.c
e23544f
@@ -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);
e23544f
@@ -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.  */
3cb5dfb
@@ -1702,7 +1718,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 ("\
5fa3867
 cannot set access and modification date of '%s'"),
3cb5dfb
@@ -1759,7 +1775,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 ("\
5fa3867
 cannot set access and modification date of '%s'"), fname);
f995fa8
--- elfutils/tests/ChangeLog
f995fa8
+++ elfutils/tests/ChangeLog
52ee0c5
@@ -549,6 +549,11 @@
f995fa8
 	* Makefile.am (TESTS): Add run-elflint-test.sh.
f995fa8
 	(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
f995fa8
 
f995fa8
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa8
+
f995fa8
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa8
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa8
+
f995fa8
 2005-05-24  Ulrich Drepper  <drepper@redhat.com>
f995fa8
 
f995fa8
 	* get-files.c (main): Use correct format specifier.
f995fa8
--- elfutils/tests/Makefile.am
f995fa8
+++ elfutils/tests/Makefile.am
e23544f
@@ -25,12 +25,13 @@
e23544f
 ## <http://www.openinventionnetwork.com>.
f995fa8
 ##
f995fa8
 DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE
f995fa8
+WEXTRA = @WEXTRA@
f995fa8
 if MUDFLAP
f995fa8
-AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\
f995fa8
+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\
f995fa8
 	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
418cfd0
 BUILD_RPATH = \$$ORIGIN/../backends
f995fa8
 else
f995fa8
-AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
f995fa8
+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \
f995fa8
 	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
418cfd0
 BUILT_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
f995fa8
 endif
570047f
--- elfutils/tests/Makefile.in
570047f
+++ elfutils/tests/Makefile.in
52ee0c5
@@ -322,6 +322,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80a
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80a
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80a
 LDFLAGS = @LDFLAGS@
80ba80a
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80a
 LEX = @LEX@
80ba80a
 LEXLIB = @LEXLIB@
80ba80a
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
52ee0c5
@@ -351,6 +352,7 @@ SHELL = @SHELL@
3cb5dfb
 STRIP = @STRIP@
b73b6ec
 USE_NLS = @USE_NLS@
b73b6ec
 VERSION = @VERSION@
b73b6ec
+WEXTRA = @WEXTRA@
b73b6ec
 XGETTEXT = @XGETTEXT@
3cb5dfb
 XGETTEXT_015 = @XGETTEXT_015@
b73b6ec
 YACC = @YACC@
52ee0c5
@@ -405,10 +407,10 @@ sysconfdir = @sysconfdir@
f995fa8
 target_alias = @target_alias@
3cb5dfb
 top_builddir = @top_builddir@
3cb5dfb
 top_srcdir = @top_srcdir@
f995fa8
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
f995fa8
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \
f995fa8
 @MUDFLAP_FALSE@	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
f995fa8
 
f995fa8
-@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\
f995fa8
+@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\
f995fa8
 @MUDFLAP_TRUE@	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
f995fa8
 
418cfd0
 @MUDFLAP_TRUE@BUILD_RPATH = \$$ORIGIN/../backends