418cfd
--- elfutils/backends/ChangeLog
418cfd
+++ elfutils/backends/ChangeLog
e37a49
@@ -78,6 +78,10 @@
bfd3a3
 	* ppc_attrs.c (ppc_check_object_attribute): Handle tag
bfd3a3
 	GNU_Power_ABI_Struct_Return.
bfd3a3
 
5c16b0
+2009-01-23  Roland McGrath  <roland@redhat.com>
5c16b0
+
5c16b0
+	* Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
5c16b0
+
5c16b0
 2008-10-04  Ulrich Drepper  <drepper@redhat.com>
5c16b0
 
5c16b0
 	* i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
e37a49
@@ -405,6 +409,11 @@
3025be
 	* sparc_init.c: Likewise.
3025be
 	* x86_64_init.c: Likewise.
3025be
 
80ba80
+2005-11-22  Roland McGrath  <roland@redhat.com>
80ba80
+
80ba80
+	* Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
80ba80
+	(libebl_%.so rule): Use it in place of -Wl,--as-needed.
80ba80
+
80ba80
 2005-11-19  Roland McGrath  <roland@redhat.com>
80ba80
 
80ba80
 	* ppc64_reloc.def: REL30 -> ADDR30.
e37a49
@@ -427,6 +436,9 @@
418cfd
 	* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
418cfd
 	(CLEANFILES): Add libebl_$(m).so.
418cfd
 
418cfd
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
418cfd
+	(AM_CFLAGS): Use it in place of -Wextra.
418cfd
+
418cfd
 	* ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
418cfd
 	* ppc64_reloc.def: Likewise.
418cfd
 
418cfd
--- elfutils/backends/Makefile.am
418cfd
+++ elfutils/backends/Makefile.am
e23544
@@ -25,12 +25,14 @@
e23544
 ## <http://www.openinventionnetwork.com>.
418cfd
 ##
418cfd
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
418cfd
+WEXTRA = @WEXTRA@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
418cfd
 if MUDFLAP
418cfd
 AM_CFLAGS = -fmudflap
418cfd
 else
418cfd
 AM_CFLAGS =
418cfd
 endif
418cfd
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
418cfd
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
418cfd
 	     -std=gnu99
840723
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
418cfd
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
d36848
@@ -115,7 +117,7 @@ libebl_%.so: libebl_%_pic.a libebl_%.map
5c16b0
 	$(LINK) -shared -o $@ -Wl,--whole-archive,$<\
5c16b0
 		$(cpu_$(@:libebl_%.so=%)) -Wl,--no-whole-archive \
5c16b0
 		-Wl,--version-script,$(word 2,$^) \
5c16b0
-		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
5c16b0
+		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
5c16b0
 	$(textrel_check)
5c16b0
 
5c16b0
 # XXX Should not be needed...
418cfd
--- elfutils/backends/Makefile.in
418cfd
+++ elfutils/backends/Makefile.in
d36848
@@ -163,6 +163,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -192,6 +193,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
418cfd
 USE_NLS = @USE_NLS@
418cfd
 VERSION = @VERSION@
418cfd
+WEXTRA = @WEXTRA@
418cfd
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
418cfd
 YACC = @YACC@
d36848
@@ -250,9 +252,9 @@ top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
418cfd
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
418cfd
-@MUDFLAP_FALSE@	-Wextra -Wformat=2 -std=gnu99
418cfd
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2 -std=gnu99
418cfd
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
418cfd
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2 -std=gnu99
418cfd
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99
840723
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
418cfd
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
418cfd
 	   -I$(top_srcdir)/lib -I..
d36848
@@ -680,7 +682,7 @@ libebl_%.so: libebl_%_pic.a libebl_%.map
5c16b0
 	$(LINK) -shared -o $@ -Wl,--whole-archive,$<\
5c16b0
 		$(cpu_$(@:libebl_%.so=%)) -Wl,--no-whole-archive \
5c16b0
 		-Wl,--version-script,$(word 2,$^) \
5c16b0
-		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
5c16b0
+		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
5c16b0
 	$(textrel_check)
5c16b0
 
5c16b0
 # XXX Should not be needed...
570047
--- elfutils/ChangeLog
570047
+++ elfutils/ChangeLog
e37a49
@@ -1,3 +1,7 @@
e37a49
+2009-11-22  Roland McGrath  <roland@redhat.com>
e37a49
+
e37a49
+	* configure.ac: Use sed and expr instead of modern bash extensions.
e37a49
+
e37a49
 2009-09-21  Ulrich Drepper  <drepper@redhat.com>
e37a49
 
e37a49
 	* configure.ac: Update for more modern autoconf.
e37a49
@@ -6,6 +10,10 @@
e4d1f5
 
e4d1f5
 	* configure.ac (zip_LIBS): Check for liblzma too.
e4d1f5
 
e4d1f5
+2009-08-17  Roland McGrath  <roland@redhat.com>
e4d1f5
+
e4d1f5
+	* configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
e4d1f5
+
e4d1f5
 2009-04-19  Roland McGrath  <roland@redhat.com>
e4d1f5
 
e4d1f5
 	* configure.ac (eu_version): Round down here, not in version.h macros.
e37a49
@@ -17,6 +25,8 @@
fbfe24
 
bfd3a3
 2009-01-23  Roland McGrath  <roland@redhat.com>
bfd3a3
 
5c16b0
+	* configure.ac: Check for __builtin_popcount.
5c16b0
+
bfd3a3
 	* configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
5c16b0
 
bfd3a3
 	* configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
e37a49
@@ -97,6 +107,10 @@
a99770
 	* configure.ac: Add dummy automake conditional to get dependencies
a99770
 	for non-generic linker right.  See src/Makefile.am.
a99770
 
80ba80
+2005-11-22  Roland McGrath  <roland@redhat.com>
80ba80
+
80ba80
+	* configure.ac: Check for --as-needed linker option.
80ba80
+
80ba80
 2005-11-18  Roland McGrath  <roland@redhat.com>
80ba80
 
80ba80
 	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
e37a49
@@ -144,6 +158,17 @@
f995fa
 	* Makefile.am (all_SUBDIRS): Add libdwfl.
f995fa
 	* configure.ac: Write libdwfl/Makefile.
f995fa
 
f995fa
+2005-05-31  Roland McGrath  <roland@redhat.com>
678843
+
678843
+	* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
678843
+
28fe4d
+	* configure.ac: Check for struct stat st_?tim members.
28fe4d
+	* src/strip.c (process_file): Use st_?time if st_?tim are not there.
678843
+
28fe4d
+	* configure.ac: Check for futimes function.
28fe4d
+	* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
28fe4d
+	(handle_ar) [! HAVE_FUTIMES]: Likewise.
678843
+
f995fa
 2005-05-19  Roland McGrath  <roland@redhat.com>
678843
 
f995fa
 	* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
570047
--- elfutils/config/Makefile.in
570047
+++ elfutils/config/Makefile.in
d36848
@@ -76,6 +76,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -105,6 +106,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = @VERSION@
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
5c16b0
--- elfutils/config.h.in
5c16b0
+++ elfutils/config.h.in
5c16b0
@@ -1,5 +1,8 @@
5c16b0
 /* config.h.in.  Generated from configure.ac by autoheader.  */
5c16b0
 
5c16b0
+/* Have __builtin_popcount. */
5c16b0
+#undef HAVE_BUILTIN_POPCOUNT
5c16b0
+
5c16b0
 /* $libdir subdirectory containing libebl modules. */
5c16b0
 #undef LIBEBL_SUBDIR
5c16b0
 
e4d1f5
@@ -55,4 +58,7 @@
5c16b0
 /* Define for large files, on AIX-style hosts. */
5c16b0
 #undef _LARGE_FILES
5c16b0
 
5c16b0
+/* Stubbed out if missing compiler support. */
5c16b0
+#undef __thread
5c16b0
+
5c16b0
 #include <eu-config.h>
570047
--- elfutils/configure
570047
+++ elfutils/configure
e4d1f5
@@ -646,6 +646,8 @@ NATIVE_LD_FALSE
3cb5df
 NATIVE_LD_TRUE
28fe4d
 DATADIRNAME
28fe4d
 LOCALEDIR
28fe4d
+LD_AS_NEEDED
28fe4d
+WEXTRA
28fe4d
 LEXLIB
28fe4d
 LEX_OUTPUT_ROOT
28fe4d
 LEX
e4d1f5
@@ -4098,6 +4100,205 @@ $as_echo "$as_me: error: gcc with C99 su
b73b6e
 fi
b73b6e
 
b73b6e
 
28fe4d
+{ $as_echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
28fe4d
+$as_echo_n "checking for -Wextra option to $CC... " >&6; }
b73b6e
+if test "${ac_cv_cc_wextra+set}" = set; then
bfd3a3
+  $as_echo_n "(cached) " >&6
bfd3a3
+else
b73b6e
+  old_CFLAGS="$CFLAGS"
b73b6e
+CFLAGS="$CFLAGS -Wextra"
b73b6e
+cat >conftest.$ac_ext <<_ACEOF
b73b6e
+void foo (void) { }
bfd3a3
+_ACEOF
bfd3a3
+rm -f conftest.$ac_objext
bfd3a3
+if { (ac_try="$ac_compile"
bfd3a3
+case "(($ac_try" in
bfd3a3
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
bfd3a3
+  *) ac_try_echo=$ac_try;;
bfd3a3
+esac
bfd3a3
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
bfd3a3
+$as_echo "$ac_try_echo") >&5
bfd3a3
+  (eval "$ac_compile") 2>conftest.er1
bfd3a3
+  ac_status=$?
bfd3a3
+  grep -v '^ *+' conftest.er1 >conftest.err
bfd3a3
+  rm -f conftest.er1
bfd3a3
+  cat conftest.err >&5
bfd3a3
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
bfd3a3
+  (exit $ac_status); } && {
bfd3a3
+	 test -z "$ac_c_werror_flag" ||
bfd3a3
+	 test ! -s conftest.err
bfd3a3
+       } && test -s conftest.$ac_objext; then
b4dfab
+  ac_cv_cc_wextra=yes
b73b6e
+else
28fe4d
+  $as_echo "$as_me: failed program was:" >&5
b73b6e
+sed 's/^/| /' conftest.$ac_ext >&5
b73b6e
+
3cb5df
+	ac_cv_cc_wextra=no
b73b6e
+fi
3cb5df
+
3cb5df
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
b73b6e
+CFLAGS="$old_CFLAGS"
b73b6e
+fi
28fe4d
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
28fe4d
+$as_echo "$ac_cv_cc_wextra" >&6; }
b73b6e
+
f995fa
+if test "x$ac_cv_cc_wextra" = xyes; then
b73b6e
+  WEXTRA=-Wextra
678843
+else
678843
+  WEXTRA=-W
b73b6e
+fi
b73b6e
+
b73b6e
+
e4d1f5
+{ $as_echo "$as_me:$LINENO: checking for -fgnu89-inline option to $CC" >&5
e4d1f5
+$as_echo_n "checking for -fgnu89-inline option to $CC... " >&6; }
e4d1f5
+if test "${ac_cv_cc_gnu89_inline+set}" = set; then
e4d1f5
+  $as_echo_n "(cached) " >&6
e4d1f5
+else
e4d1f5
+  old_CFLAGS="$CFLAGS"
e4d1f5
+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
e4d1f5
+cat >conftest.$ac_ext <<_ACEOF
e4d1f5
+
e4d1f5
+void foo (void)
e4d1f5
+{
e4d1f5
+  inline void bar (void) {}
e4d1f5
+  bar ();
e4d1f5
+}
e4d1f5
+extern inline void baz (void) {}
e4d1f5
+
e4d1f5
+_ACEOF
e4d1f5
+rm -f conftest.$ac_objext
e4d1f5
+if { (ac_try="$ac_compile"
e4d1f5
+case "(($ac_try" in
e4d1f5
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
e4d1f5
+  *) ac_try_echo=$ac_try;;
e4d1f5
+esac
e4d1f5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
e4d1f5
+$as_echo "$ac_try_echo") >&5
e4d1f5
+  (eval "$ac_compile") 2>conftest.er1
e4d1f5
+  ac_status=$?
e4d1f5
+  grep -v '^ *+' conftest.er1 >conftest.err
e4d1f5
+  rm -f conftest.er1
e4d1f5
+  cat conftest.err >&5
e4d1f5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
e4d1f5
+  (exit $ac_status); } && {
e4d1f5
+	 test -z "$ac_c_werror_flag" ||
e4d1f5
+	 test ! -s conftest.err
e4d1f5
+       } && test -s conftest.$ac_objext; then
e4d1f5
+  ac_cv_cc_gnu89_inline=yes
e4d1f5
+else
e4d1f5
+  $as_echo "$as_me: failed program was:" >&5
e4d1f5
+sed 's/^/| /' conftest.$ac_ext >&5
e4d1f5
+
e4d1f5
+	ac_cv_cc_gnu89_inline=no
e4d1f5
+fi
e4d1f5
+
e4d1f5
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
e4d1f5
+CFLAGS="$old_CFLAGS"
e4d1f5
+fi
e4d1f5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cc_gnu89_inline" >&5
e4d1f5
+$as_echo "$ac_cv_cc_gnu89_inline" >&6; }
e4d1f5
+if test "x$ac_cv_cc_gnu89_inline" = xyes; then
e4d1f5
+  WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"
e4d1f5
+fi
e4d1f5
+
e4d1f5
+
28fe4d
+{ $as_echo "$as_me:$LINENO: checking for --as-needed linker option" >&5
28fe4d
+$as_echo_n "checking for --as-needed linker option... " >&6; }
80ba80
+if test "${ac_cv_as_needed+set}" = set; then
28fe4d
+  $as_echo_n "(cached) " >&6
80ba80
+else
80ba80
+  cat > conftest.c <
80ba80
+int main (void) { return 0; }
80ba80
+EOF
80ba80
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
80ba80
+			    -fPIC -shared -o conftest.so conftest.c
80ba80
+			    -Wl,--as-needed 1>&5'
80ba80
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
80ba80
+  (eval $ac_try) 2>&5
80ba80
+  ac_status=$?
28fe4d
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
80ba80
+  (exit $ac_status); }; }
80ba80
+then
80ba80
+  ac_cv_as_needed=yes
80ba80
+else
80ba80
+  ac_cv_as_needed=no
80ba80
+fi
80ba80
+rm -f conftest*
80ba80
+fi
28fe4d
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5
28fe4d
+$as_echo "$ac_cv_as_needed" >&6; }
80ba80
+if test "x$ac_cv_as_needed" = xyes; then
80ba80
+  LD_AS_NEEDED=-Wl,--as-needed
80ba80
+else
80ba80
+  LD_AS_NEEDED=
80ba80
+fi
80ba80
+
80ba80
+
80ba80
+
5c16b0
+{ $as_echo "$as_me:$LINENO: checking for __builtin_popcount" >&5
5c16b0
+$as_echo_n "checking for __builtin_popcount... " >&6; }
5c16b0
+if test "${ac_cv_popcount+set}" = set; then
5c16b0
+  $as_echo_n "(cached) " >&6
5c16b0
+else
5c16b0
+  cat >conftest.$ac_ext <<_ACEOF
5c16b0
+/* confdefs.h.  */
5c16b0
+_ACEOF
5c16b0
+cat confdefs.h >>conftest.$ac_ext
5c16b0
+cat >>conftest.$ac_ext <<_ACEOF
5c16b0
+/* end confdefs.h.  */
80ba80
+
5c16b0
+int
5c16b0
+main ()
5c16b0
+{
5c16b0
+exit (__builtin_popcount (127));
5c16b0
+  ;
5c16b0
+  return 0;
5c16b0
+}
5c16b0
+_ACEOF
5c16b0
+rm -f conftest.$ac_objext conftest$ac_exeext
5c16b0
+if { (ac_try="$ac_link"
5c16b0
+case "(($ac_try" in
5c16b0
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
5c16b0
+  *) ac_try_echo=$ac_try;;
5c16b0
+esac
5c16b0
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
5c16b0
+$as_echo "$ac_try_echo") >&5
5c16b0
+  (eval "$ac_link") 2>conftest.er1
5c16b0
+  ac_status=$?
5c16b0
+  grep -v '^ *+' conftest.er1 >conftest.err
5c16b0
+  rm -f conftest.er1
5c16b0
+  cat conftest.err >&5
5c16b0
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
5c16b0
+  (exit $ac_status); } && {
5c16b0
+	 test -z "$ac_c_werror_flag" ||
5c16b0
+	 test ! -s conftest.err
5c16b0
+       } && test -s conftest$ac_exeext && {
5c16b0
+	 test "$cross_compiling" = yes ||
5c16b0
+	 $as_test_x conftest$ac_exeext
5c16b0
+       }; then
5c16b0
+  ac_cv_popcount=yes
5c16b0
+else
5c16b0
+  $as_echo "$as_me: failed program was:" >&5
5c16b0
+sed 's/^/| /' conftest.$ac_ext >&5
5c16b0
+
5c16b0
+	ac_cv_popcount=no
5c16b0
+fi
5c16b0
+
5c16b0
+rm -rf conftest.dSYM
5c16b0
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
5c16b0
+      conftest$ac_exeext conftest.$ac_ext
5c16b0
+fi
5c16b0
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_popcount" >&5
5c16b0
+$as_echo "$ac_cv_popcount" >&6; }
5c16b0
+if test "x$ac_cv_popcount" = xyes; then
5c16b0
+
5c16b0
+cat >>confdefs.h <<\_ACEOF
5c16b0
+#define HAVE_BUILTIN_POPCOUNT 1
5c16b0
+_ACEOF
5c16b0
+
5c16b0
+fi
5c16b0
+
5c16b0
+
bfd3a3
 { $as_echo "$as_me:$LINENO: checking for __thread support" >&5
bfd3a3
 $as_echo_n "checking for __thread support... " >&6; }
bfd3a3
 if test "${ac_cv_tls+set}" = set; then
e4d1f5
@@ -4163,9 +4364,18 @@ fi
5c16b0
 { $as_echo "$as_me:$LINENO: result: $ac_cv_tls" >&5
5c16b0
 $as_echo "$ac_cv_tls" >&6; }
5c16b0
 if test "x$ac_cv_tls" != xyes; then
bfd3a3
-  { { $as_echo "$as_me:$LINENO: error: __thread support required" >&5
bfd3a3
-$as_echo "$as_me: error: __thread support required" >&2;}
5c16b0
+  if test "$use_locks" = yes; then
5c16b0
+  { { $as_echo "$as_me:$LINENO: error: --enable-thread-safety requires __thread support" >&5
5c16b0
+$as_echo "$as_me: error: --enable-thread-safety requires __thread support" >&2;}
5c16b0
    { (exit 1); exit 1; }; }
5c16b0
+else
5c16b0
+
5c16b0
+cat >>confdefs.h <<\_ACEOF
5c16b0
+#define __thread /* empty: no multi-thread support */
5c16b0
+_ACEOF
5c16b0
+
5c16b0
+fi
5c16b0
+
5c16b0
 fi
5c16b0
 
5c16b0
 
e37a49
@@ -5460,7 +5670,7 @@ ac_config_files="$ac_config_files versio
e37a49
 
e37a49
 # 1.234<whatever> -> 1234<whatever>
e37a49
 case "$PACKAGE_VERSION" in
e37a49
-[0-9].*) eu_version="${PACKAGE_VERSION/./}" ;;
e37a49
+[0-9].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
e37a49
 *)     	   { { $as_echo "$as_me:$LINENO: error: confused by version number '$PACKAGE_VERSION'" >&5
e37a49
 $as_echo "$as_me: error: confused by version number '$PACKAGE_VERSION'" >&2;}
e37a49
    { (exit 1); exit 1; }; } ;;
e37a49
@@ -5495,7 +5705,7 @@ $as_echo "$as_me: error: confused by ver
e37a49
 esac
e37a49
 
e37a49
 # Round up to the next release API (x.y) version.
e37a49
-eu_version=$[($eu_version + 999) / 1000]
e37a49
+eu_version=`expr \( $eu_version + 999 \) / 1000`
e37a49
 
e37a49
 cat >confcache <<\_ACEOF
e37a49
 # This file is a shell script that caches the results of configure
570047
--- elfutils/configure.ac
570047
+++ elfutils/configure.ac
e4d1f5
@@ -73,6 +73,54 @@ CFLAGS="$old_CFLAGS"])
a769ac
 AS_IF([test "x$ac_cv_c99" != xyes],
a769ac
       AC_MSG_ERROR([gcc with C99 support required]))
a769ac
 
a769ac
+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
a769ac
+old_CFLAGS="$CFLAGS"
a769ac
+CFLAGS="$CFLAGS -Wextra"
a769ac
+AC_COMPILE_IFELSE([void foo (void) { }],
b4dfab
+		  ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
a769ac
+CFLAGS="$old_CFLAGS"])
a769ac
+AC_SUBST(WEXTRA)
f995fa
+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
a769ac
+
e4d1f5
+AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
e4d1f5
+old_CFLAGS="$CFLAGS"
e4d1f5
+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
e4d1f5
+AC_COMPILE_IFELSE([
e4d1f5
+void foo (void)
e4d1f5
+{
e4d1f5
+  inline void bar (void) {}
e4d1f5
+  bar ();
e4d1f5
+}
e4d1f5
+extern inline void baz (void) {}
e4d1f5
+], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
e4d1f5
+CFLAGS="$old_CFLAGS"])
e4d1f5
+AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
e4d1f5
+      [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
e4d1f5
+
80ba80
+AC_CACHE_CHECK([for --as-needed linker option],
80ba80
+	       ac_cv_as_needed, [dnl
80ba80
+cat > conftest.c <
80ba80
+int main (void) { return 0; }
80ba80
+EOF
80ba80
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
80ba80
+			    -fPIC -shared -o conftest.so conftest.c
80ba80
+			    -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
80ba80
+then
80ba80
+  ac_cv_as_needed=yes
80ba80
+else
80ba80
+  ac_cv_as_needed=no
80ba80
+fi
80ba80
+rm -f conftest*])
80ba80
+AS_IF([test "x$ac_cv_as_needed" = xyes],
80ba80
+      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
80ba80
+AC_SUBST(LD_AS_NEEDED)
80ba80
+
5c16b0
+AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
5c16b0
+AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
5c16b0
+	       ac_cv_popcount=yes, ac_cv_popcount=no)])
5c16b0
+AS_IF([test "x$ac_cv_popcount" = xyes],
5c16b0
+      [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
80ba80
+
bfd3a3
 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
bfd3a3
 # Use the same flags that we use for our DSOs, so the test is representative.
bfd3a3
 # Some old compiler/linker/libc combinations fail some ways and not others.
e4d1f5
@@ -88,7 +136,10 @@ static __thread int a; int foo (int b) {
bfd3a3
 CFLAGS="$save_CFLAGS"
bfd3a3
 LDFLAGS="$save_LDFLAGS"])
5c16b0
 AS_IF([test "x$ac_cv_tls" != xyes],
bfd3a3
-      AC_MSG_ERROR([__thread support required]))
5c16b0
+      [AS_IF([test "$use_locks" = yes],
5c16b0
+	     [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
5c16b0
+	     [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
5c16b0
+			[Stubbed out if missing compiler support.])])])
5c16b0
 
a769ac
 LOCALEDIR=$datadir
a769ac
 AC_SUBST(LOCALEDIR)
e37a49
@@ -259,7 +310,7 @@ AC_SUBST([eu_version])
e37a49
 
e37a49
 # 1.234<whatever> -> 1234<whatever>
e37a49
 case "$PACKAGE_VERSION" in
e37a49
-[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
e37a49
+[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
e37a49
 *)     	   AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
e37a49
 esac
e37a49
 case "$eu_version" in
e37a49
@@ -288,6 +339,6 @@ case "$eu_version" in
e37a49
 esac
e37a49
 
e37a49
 # Round up to the next release API (x.y) version.
e37a49
-[eu_version=$[($eu_version + 999) / 1000]]
e37a49
+eu_version=`expr \( $eu_version + 999 \) / 1000`
e37a49
 
e37a49
 AC_OUTPUT
570047
--- elfutils/lib/ChangeLog
570047
+++ elfutils/lib/ChangeLog
e4d1f5
@@ -4,6 +4,9 @@
e4d1f5
 
bfd3a3
 2009-01-23  Roland McGrath  <roland@redhat.com>
bfd3a3
 
5c16b0
+	* eu-config.h [! HAVE_BUILTIN_POPCOUNT]
5c16b0
+	(__builtin_popcount): New inline function.
5c16b0
+
bfd3a3
 	* eu-config.h: Add multiple inclusion protection.
5c16b0
 
bfd3a3
 2009-01-17  Ulrich Drepper  <drepper@redhat.com>
e4d1f5
@@ -60,6 +63,11 @@
5fa386
 	* Makefile.am (libeu_a_SOURCES): Add it.
5fa386
 	* system.h: Declare crc32_file.
5fa386
 
a769ac
+2005-02-07  Roland McGrath  <roland@redhat.com>
a769ac
+
a769ac
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
a769ac
+	(AM_CFLAGS): Use it in place of -Wextra.
a769ac
+
5fa386
 2005-04-30  Ulrich Drepper  <drepper@redhat.com>
a769ac
 
5fa386
 	* Makefile.am: Use -ffunction-sections for xmalloc.c.
5c16b0
--- elfutils/lib/eu-config.h
5c16b0
+++ elfutils/lib/eu-config.h
e4d1f5
@@ -182,6 +182,17 @@ asm (".section predict_data, \"aw\"; .pr
5c16b0
 /* This macro is used by the tests conditionalize for standalone building.  */
5c16b0
 #define ELFUTILS_HEADER(name) <lib##name.h>
bfd3a3
 
5c16b0
+#ifndef HAVE_BUILTIN_POPCOUNT
5c16b0
+# define __builtin_popcount hakmem_popcount
5c16b0
+static inline unsigned int __attribute__ ((unused))
5c16b0
+hakmem_popcount (unsigned int x)
5c16b0
+{
5c16b0
+  /* HAKMEM 169 */
5c16b0
+  unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
5c16b0
+  return ((n + (n >> 3)) & 030707070707) % 63;
5c16b0
+}
5c16b0
+#endif	/* HAVE_BUILTIN_POPCOUNT */
5c16b0
+
bfd3a3
 
e4d1f5
 #ifdef SHARED
e4d1f5
 # define OLD_VERSION(name, version) \
570047
--- elfutils/lib/Makefile.am
570047
+++ elfutils/lib/Makefile.am
e23544
@@ -25,12 +25,13 @@
e23544
 ## <http://www.openinventionnetwork.com>.
a769ac
 ##
a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
a769ac
+WEXTRA = @WEXTRA@
a769ac
 if MUDFLAP
a769ac
 AM_CFLAGS = -fmudflap
a769ac
 else
a769ac
 AM_CFLAGS =
a769ac
 endif
a769ac
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra $($(*F)_CFLAGS)
a769ac
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS)
a769ac
 INCLUDES = -I$(srcdir)/../libelf -I..
a769ac
 
a769ac
 noinst_LIBRARIES = libeu.a
570047
--- elfutils/lib/Makefile.in
570047
+++ elfutils/lib/Makefile.in
d36848
@@ -98,6 +98,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -127,6 +128,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = @VERSION@
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
d36848
@@ -185,9 +187,9 @@ top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
b73b6e
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
b73b6e
-@MUDFLAP_FALSE@	-Wextra $($(*F)_CFLAGS)
b73b6e
+@MUDFLAP_FALSE@	$(WEXTRA) $($(*F)_CFLAGS)
b73b6e
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
b73b6e
-@MUDFLAP_TRUE@	-Wunused -Wextra $($(*F)_CFLAGS)
b73b6e
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) $($(*F)_CFLAGS)
b73b6e
 INCLUDES = -I$(srcdir)/../libelf -I..
b73b6e
 noinst_LIBRARIES = libeu.a
e23544
 libeu_a_SOURCES = xstrndup.c xmalloc.c next_prime.c \
f995fa
--- elfutils/libasm/ChangeLog
f995fa
+++ elfutils/libasm/ChangeLog
5c16b0
@@ -63,6 +63,11 @@
2ca692
 	* asm_error.c: Add new error ASM_E_IOERROR.
2ca692
 	* libasmP.h: Add ASM_E_IOERROR definition.
2ca692
 
f995fa
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa
+
f995fa
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa
+
f995fa
 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
f995fa
 
2ca692
 	* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
570047
--- elfutils/libasm/Makefile.am
570047
+++ elfutils/libasm/Makefile.am
e23544
@@ -25,12 +25,13 @@
e23544
 ## <http://www.openinventionnetwork.com>.
a769ac
 ##
a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
a769ac
+WEXTRA = @WEXTRA@
a769ac
 if MUDFLAP
a769ac
 AM_CFLAGS = -fmudflap
a769ac
 else
a769ac
 AM_CFLAGS =
a769ac
 endif
2ca692
-AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
2ca692
+AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2
418cfd
 INCLUDES = -I. -I$(srcdir) -I.. \
418cfd
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
a769ac
 	   -I$(top_srcdir)/lib
570047
--- elfutils/libasm/Makefile.in
570047
+++ elfutils/libasm/Makefile.in
d36848
@@ -145,6 +145,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -174,6 +175,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = 1
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
d36848
@@ -232,9 +234,9 @@ top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
2ca692
 @MUDFLAP_FALSE@AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Werror -Wunused \
2ca692
-@MUDFLAP_FALSE@	-Wextra -Wformat=2
2ca692
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2
2ca692
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -std=gnu99 -Wall -Wshadow -Werror \
2ca692
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2
2ca692
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2
418cfd
 INCLUDES = -I. -I$(srcdir) -I.. \
418cfd
 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\
b73b6e
 	   -I$(top_srcdir)/lib
570047
--- elfutils/libcpu/ChangeLog
570047
+++ elfutils/libcpu/ChangeLog
fbfe24
@@ -5,6 +5,9 @@
fbfe24
 
bfd3a3
 2009-01-23  Roland McGrath  <roland@redhat.com>
bfd3a3
 
5c16b0
+	* i386_disasm.c (i386_disasm): Add abort after assert-constant for old
5c16b0
+	compilers that don't realize it's noreturn.
5c16b0
+
bfd3a3
 	* Makefile.am (i386_parse_CFLAGS): Use quotes around command
bfd3a3
 	substitution that can produce leading whitespace.
5c16b0
 
fbfe24
@@ -334,6 +337,11 @@
840723
 	* defs/i386.doc: New file.
840723
 	* defs/x86_64: New file.
840723
 
678843
+2005-04-04  Roland McGrath  <roland@redhat.com>
678843
+
678843
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
678843
+	(AM_CFLAGS): Use it instead of -Wextra.
678843
+
678843
 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
678843
 
678843
 	* Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
5c16b0
--- elfutils/libcpu/i386_disasm.c
5c16b0
+++ elfutils/libcpu/i386_disasm.c
5c16b0
@@ -791,6 +791,7 @@ i386_disasm (const uint8_t **startp, con
5c16b0
 
5c16b0
 			default:
5c16b0
 			  assert (! "INVALID not handled");
5c16b0
+			  abort ();
5c16b0
 			}
5c16b0
 		    }
5c16b0
 		  else
570047
--- elfutils/libcpu/Makefile.am
570047
+++ elfutils/libcpu/Makefile.am
840723
@@ -30,7 +30,8 @@ AM_CFLAGS = -fmudflap
840723
 else
840723
 AM_CFLAGS =
840723
 endif
840723
-AM_CFLAGS += -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fpic \
c881c2
+WEXTRA = @WEXTRA@
840723
+AM_CFLAGS += -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fpic \
fbfe24
 	     -fdollars-in-identifiers \
840723
 	     $($(*F)_CFLAGS) \
840723
 	     $(if $($(*F)_no_Werror),,-Werror)
570047
--- elfutils/libcpu/Makefile.in
570047
+++ elfutils/libcpu/Makefile.in
d36848
@@ -114,6 +114,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
840723
 LEX_OUTPUT_ROOT = lex.$(
d36848
@@ -143,6 +144,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = @VERSION@
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
d36848
@@ -200,10 +202,11 @@ top_build_prefix = @top_build_prefix@
3cb5df
 top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
840723
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 \
fbfe24
-@MUDFLAP_FALSE@	-fpic -fdollars-in-identifiers $($(*F)_CFLAGS) \
fbfe24
-@MUDFLAP_FALSE@	$(if $($(*F)_no_Werror),,-Werror)
840723
-@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Wunused -Wextra \
fbfe24
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) \
fbfe24
+@MUDFLAP_FALSE@	-std=gnu99 -fpic -fdollars-in-identifiers \
fbfe24
+@MUDFLAP_FALSE@	$($(*F)_CFLAGS) $(if \
fbfe24
+@MUDFLAP_FALSE@	$($(*F)_no_Werror),,-Werror)
840723
+@MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Wunused $(WEXTRA) \
fbfe24
 @MUDFLAP_TRUE@	-std=gnu99 -fpic -fdollars-in-identifiers \
fbfe24
 @MUDFLAP_TRUE@	$($(*F)_CFLAGS) $(if \
840723
 @MUDFLAP_TRUE@	$($(*F)_no_Werror),,-Werror)
f995fa
--- elfutils/libdw/ChangeLog
f995fa
+++ elfutils/libdw/ChangeLog
e37a49
@@ -49,6 +49,10 @@
e4d1f5
 
e4d1f5
 	* dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
e4d1f5
 
e4d1f5
+2009-08-17  Roland McGrath  <roland@redhat.com>
e4d1f5
+
e4d1f5
+	* libdw.h: Disable extern inlines for GCC 4.2.
e4d1f5
+
e4d1f5
 2009-08-10  Roland McGrath  <roland@redhat.com>
e4d1f5
 
e4d1f5
 	* dwarf_getscopevar.c: Use dwarf_diename.
e37a49
@@ -817,6 +821,11 @@
f995fa
 
f995fa
 2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa
 
f995fa
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa
+
f995fa
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa
+
f995fa
 	* dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
f995fa
 	formref offset.
f995fa
 
e4d1f5
--- elfutils/libdw/libdw.h
e4d1f5
+++ elfutils/libdw/libdw.h
e37a49
@@ -814,7 +814,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
e4d1f5
 
e4d1f5
 
e4d1f5
 /* Inline optimizations.  */
e4d1f5
-#ifdef __OPTIMIZE__
e4d1f5
+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
e4d1f5
 /* Return attribute code of given attribute.  */
e4d1f5
 __libdw_extern_inline unsigned int
e4d1f5
 dwarf_whatattr (Dwarf_Attribute *attr)
570047
--- elfutils/libdw/Makefile.am
570047
+++ elfutils/libdw/Makefile.am
e23544
@@ -25,6 +25,7 @@
e23544
 ## <http://www.openinventionnetwork.com>.
a769ac
 ##
f995fa
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DIS_LIBDW
a769ac
+WEXTRA = @WEXTRA@
a769ac
 if MUDFLAP
a769ac
 AM_CFLAGS = -fmudflap
a769ac
 else
e23544
@@ -33,7 +34,7 @@ endif
418cfd
 if BUILD_STATIC
418cfd
 AM_CFLAGS += -fpic
a769ac
 endif
a769ac
-AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
a769ac
+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
a769ac
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
a769ac
 VERSION = 1
a769ac
 
570047
--- elfutils/libdw/Makefile.in
570047
+++ elfutils/libdw/Makefile.in
e37a49
@@ -187,6 +187,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
e37a49
@@ -216,6 +217,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = 1
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
e37a49
@@ -274,9 +276,10 @@ top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
418cfd
 @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Werror -Wshadow \
418cfd
-@MUDFLAP_FALSE@	-Wunused -Wformat=2 -Wextra -std=gnu99
418cfd
+@MUDFLAP_FALSE@	-Wunused -Wformat=2 $(WEXTRA) -std=gnu99
418cfd
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Werror \
418cfd
-@MUDFLAP_TRUE@	-Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
418cfd
+@MUDFLAP_TRUE@	-Wshadow -Wunused -Wformat=2 $(WEXTRA) \
418cfd
+@MUDFLAP_TRUE@	-std=gnu99
b73b6e
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
65b080
 COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \
65b080
 						       $(COMPILE)))
f995fa
--- elfutils/libdwfl/ChangeLog
f995fa
+++ elfutils/libdwfl/ChangeLog
e37a49
@@ -1165,6 +1165,11 @@
469b3c
 
f995fa
 2005-07-21  Roland McGrath  <roland@redhat.com>
f995fa
 
f995fa
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa
+
f995fa
+2005-07-21  Roland McGrath  <roland@redhat.com>
f995fa
+
f995fa
 	* Makefile.am (noinst_HEADERS): Add loc2c.c.
f995fa
 
f995fa
 	* test2.c (main): Check sscanf result to quiet warning.
f995fa
--- elfutils/libdwfl/Makefile.am
f995fa
+++ elfutils/libdwfl/Makefile.am
e23544
@@ -27,12 +27,13 @@
e23544
 ## <http://www.openinventionnetwork.com>.
f995fa
 ##
f995fa
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
f995fa
+WEXTRA = @WEXTRA@
f995fa
 if MUDFLAP
f995fa
 AM_CFLAGS = -fmudflap
f995fa
 else
f995fa
 AM_CFLAGS =
f995fa
 endif
f995fa
-AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
f995fa
+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
f995fa
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
f995fa
 	   -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib
f995fa
 VERSION = 1
f995fa
--- elfutils/libdwfl/Makefile.in
f995fa
+++ elfutils/libdwfl/Makefile.in
e4d1f5
@@ -179,6 +179,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
e4d1f5
@@ -208,6 +209,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
f995fa
 USE_NLS = @USE_NLS@
f995fa
 VERSION = 1
f995fa
+WEXTRA = @WEXTRA@
f995fa
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
f995fa
 YACC = @YACC@
e4d1f5
@@ -266,9 +268,9 @@ top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
f995fa
 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
f995fa
-@MUDFLAP_FALSE@	-Wextra -std=gnu99
f995fa
+@MUDFLAP_FALSE@	$(WEXTRA) -std=gnu99
f995fa
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \
f995fa
-@MUDFLAP_TRUE@	-Wformat=2 -Wextra -std=gnu99
f995fa
+@MUDFLAP_TRUE@	-Wformat=2 $(WEXTRA) -std=gnu99
f995fa
 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
f995fa
 	   -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib
f995fa
 
f995fa
--- elfutils/libebl/ChangeLog
f995fa
+++ elfutils/libebl/ChangeLog
e37a49
@@ -620,6 +620,11 @@
f995fa
 	* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
f995fa
 	tracking works right.
f995fa
 
f995fa
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa
+
f995fa
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa
+
f995fa
 2005-05-21  Ulrich Drepper  <drepper@redhat.com>
f995fa
 
f995fa
 	* libebl_x86_64.map: Add x86_64_core_note.
570047
--- elfutils/libebl/Makefile.am
570047
+++ elfutils/libebl/Makefile.am
e23544
@@ -25,12 +25,13 @@
e23544
 ## <http://www.openinventionnetwork.com>.
a769ac
 ##
a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
a769ac
+WEXTRA = @WEXTRA@
a769ac
 if MUDFLAP
a769ac
 AM_CFLAGS = -fmudflap
a769ac
 else
a769ac
 AM_CFLAGS =
a769ac
 endif
a769ac
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
a769ac
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
a769ac
 	     -std=gnu99
a769ac
 
418cfd
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
570047
--- elfutils/libebl/Makefile.in
570047
+++ elfutils/libebl/Makefile.in
d36848
@@ -141,6 +141,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -170,6 +171,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = 1
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
d36848
@@ -228,9 +230,9 @@ top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
b73b6e
 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
b73b6e
-@MUDFLAP_FALSE@	-Wextra -Wformat=2 -std=gnu99
b73b6e
+@MUDFLAP_FALSE@	$(WEXTRA) -Wformat=2 -std=gnu99
b73b6e
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
b73b6e
-@MUDFLAP_TRUE@	-Wunused -Wextra -Wformat=2 -std=gnu99
b73b6e
+@MUDFLAP_TRUE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99
418cfd
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
840723
 	   -I$(top_srcdir)/lib -I.. -I$(srcdir)/../libasm
418cfd
 
f995fa
--- elfutils/libelf/ChangeLog
f995fa
+++ elfutils/libelf/ChangeLog
e37a49
@@ -614,6 +614,11 @@
5c16b0
 
5c16b0
 	* elf.h: Update from glibc.
469b3c
 
f995fa
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa
+
f995fa
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa
+
5c16b0
 2005-05-08  Roland McGrath  <roland@redhat.com>
f995fa
 
5c16b0
 	* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
f995fa
--- elfutils/libelf/common.h
f995fa
+++ elfutils/libelf/common.h
44874c
@@ -160,7 +160,7 @@ libelf_release_all (Elf *elf)
f995fa
   (Var) = (sizeof (Var) == 1						      \
f995fa
 	   ? (unsigned char) (Var)					      \
f995fa
 	   : (sizeof (Var) == 2						      \
f995fa
-	      ? bswap_16 (Var)						      \
f995fa
+	      ? (unsigned short int) bswap_16 (Var)			      \
f995fa
 	      : (sizeof (Var) == 4					      \
f995fa
 		 ? bswap_32 (Var)					      \
f995fa
 		 : bswap_64 (Var))))
44874c
@@ -169,7 +169,7 @@ libelf_release_all (Elf *elf)
f995fa
   (Dst) = (sizeof (Var) == 1						      \
f995fa
 	   ? (unsigned char) (Var)					      \
f995fa
 	   : (sizeof (Var) == 2						      \
f995fa
-	      ? bswap_16 (Var)						      \
f995fa
+	      ? (unsigned short int) bswap_16 (Var)			      \
f995fa
 	      : (sizeof (Var) == 4					      \
f995fa
 		 ? bswap_32 (Var)					      \
f995fa
 		 : bswap_64 (Var))))
570047
--- elfutils/libelf/Makefile.am
570047
+++ elfutils/libelf/Makefile.am
e23544
@@ -25,6 +25,7 @@
e23544
 ## <http://www.openinventionnetwork.com>.
a769ac
 ##
a769ac
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
a769ac
+WEXTRA = @WEXTRA@
a769ac
 if MUDFLAP
511c10
 AM_CFLAGS = -fmudflap
a769ac
 else
44874c
@@ -33,7 +34,7 @@ endif
511c10
 if BUILD_STATIC
511c10
 AM_CFLAGS += -fpic
a769ac
 endif
a769ac
-AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
a769ac
+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
a769ac
 	     $($(*F)_CFLAGS)
a769ac
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
a769ac
 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
570047
--- elfutils/libelf/Makefile.in
570047
+++ elfutils/libelf/Makefile.in
d36848
@@ -188,6 +188,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -217,6 +218,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = 1
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
d36848
@@ -275,10 +277,10 @@ top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
511c10
 @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \
511c10
-@MUDFLAP_FALSE@	-Wunused -Wextra -Wformat=2 -std=gnu99 \
511c10
+@MUDFLAP_FALSE@	-Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
511c10
 @MUDFLAP_FALSE@	$($(*F)_CFLAGS)
511c10
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Wshadow \
511c10
-@MUDFLAP_TRUE@	-Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
511c10
+@MUDFLAP_TRUE@	-Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
b73b6e
 @MUDFLAP_TRUE@	$($(*F)_CFLAGS)
b73b6e
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
b73b6e
 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
570047
--- elfutils/m4/Makefile.in
570047
+++ elfutils/m4/Makefile.in
d36848
@@ -75,6 +75,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -104,6 +105,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
f995fa
 USE_NLS = @USE_NLS@
f995fa
 VERSION = @VERSION@
f995fa
+WEXTRA = @WEXTRA@
f995fa
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
f995fa
 YACC = @YACC@
f995fa
--- elfutils/Makefile.in
f995fa
+++ elfutils/Makefile.in
d36848
@@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -184,6 +185,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = @VERSION@
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
5c16b0
--- elfutils/src/addr2line.c
5c16b0
+++ elfutils/src/addr2line.c
fbfe24
@@ -447,10 +447,10 @@ handle_address (const char *string, Dwfl
5c16b0
       bool parsed = false;
5c16b0
       int n;
5c16b0
       char *name = NULL;
5c16b0
-      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2
5c16b0
+      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2
5c16b0
 	  && string[n] == '\0')
fbfe24
 	parsed = adjust_to_section (name, &addr, dwfl);
5c16b0
-      else if (sscanf (string, "%m[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2
5c16b0
+      else if (sscanf (string, "%a[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2
5c16b0
 	       && string[n] == '\0')
5c16b0
 	{
5c16b0
 	  /* It was symbol+offset.  */
f995fa
--- elfutils/src/ChangeLog
f995fa
+++ elfutils/src/ChangeLog
e37a49
@@ -59,8 +59,16 @@
e4d1f5
 	* readelf.c (attr_callback): Use print_block only when we don't use
e4d1f5
 	print_ops.
e4d1f5
 
e4d1f5
+2009-08-17  Roland McGrath  <roland@redhat.com>
e4d1f5
+
e4d1f5
+	* ld.h: Disable extern inlines for GCC 4.2.
e4d1f5
+
e4d1f5
 2009-08-14  Roland McGrath  <roland@redhat.com>
e4d1f5
 
e4d1f5
+	* strings.c (read_block): Conditionalize posix_fadvise use
e4d1f5
+	on [POSIX_FADV_SEQUENTIAL].
e4d1f5
+	From Petr Salinger <Petr.Salinger@seznam.cz>.
e4d1f5
+
e4d1f5
 	* ar.c (do_oper_extract): Use pathconf instead of statfs.
e4d1f5
 
e4d1f5
 2009-08-01  Ulrich Drepper  <drepper@redhat.com>
e37a49
@@ -224,6 +232,8 @@
5c16b0
 	* readelf.c (print_debug_frame_section): Use t instead of j formats
5c16b0
 	for ptrdiff_t OFFSET.
5c16b0
 
5c16b0
+	* addr2line.c (handle_address): Use %a instead of %m for compatibility.
5c16b0
+
5c16b0
 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
5c16b0
 
5c16b0
 	* elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
e37a49
@@ -407,6 +417,11 @@
fa1a8e
 	that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
fa1a8e
 	is valid in RELRO.
fa1a8e
 
fb2677
+2008-03-01  Roland McGrath  <roland@redhat.com>
fb2677
+
fb2677
+	* readelf.c (dump_archive_index): Tweak portability hack
fb2677
+	to match [__GNUC__ < 4] too.
fb2677
+
fb2677
 2008-02-29  Roland McGrath  <roland@redhat.com>
fb2677
 
fb2677
 	* readelf.c (print_attributes): Add a cast.
e37a49
@@ -658,6 +673,8 @@
a7b828
 
a7b828
 	* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
a7b828
 
2dfc22
+	* Makefile.am (readelf_no_Werror): New variable.
2dfc22
+
2dfc22
 2007-10-15  Roland McGrath  <roland@redhat.com>
2dfc22
 
2dfc22
 	* make-debug-archive.in: New file.
e37a49
@@ -1097,6 +1114,10 @@
9a3c17
 	* elflint.c (valid_e_machine): Add EM_ALPHA.
9a3c17
 	Reported by Christian Aichinger <Greek0@gmx.net>.
9a3c17
 
9a3c17
+	* strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
9a3c17
+	MADV_SEQUENTIAL if undefined.  	Don't call posix_madvise
9a3c17
+	if neither is defined.
9a3c17
+
9a3c17
 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
9a3c17
 
9a3c17
 	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
e37a49
@@ -1173,6 +1194,10 @@
a99770
 	* Makefile.am: Add hacks to create dependency files for non-generic
a99770
 	linker.
a99770
 
3c3d38
+2006-04-05  Roland McGrath  <roland@redhat.com>
3c3d38
+
3c3d38
+	* strings.c (MAP_POPULATE): Define to 0 if undefined.
3c3d38
+
3c3d38
 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
3c3d38
 
3c3d38
 	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
e37a49
@@ -1521,6 +1546,11 @@
f995fa
 	* readelf.c (print_debug_loc_section): Fix indentation for larger
f995fa
 	address size.
f995fa
 
f995fa
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa
+
f995fa
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa
+
f995fa
 2005-05-30  Roland McGrath  <roland@redhat.com>
f995fa
 
f995fa
 	* readelf.c (print_debug_line_section): Print section offset of each
f995fa
--- elfutils/src/findtextrel.c
f995fa
+++ elfutils/src/findtextrel.c
5c16b0
@@ -490,7 +490,11 @@ ptrcompare (const void *p1, const void *
f995fa
 
f995fa
 
f995fa
 static void
f995fa
-check_rel (size_t nsegments, struct segments segments[nsegments],
f995fa
+check_rel (size_t nsegments, struct segments segments[
f995fa
+#if __GNUC__ >= 4
f995fa
+						      nsegments
f995fa
+#endif
f995fa
+	   ],
f995fa
 	   GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
f995fa
 	   const char *fname, bool more_than_one, void **knownsrcs)
f995fa
 {
e4d1f5
--- elfutils/src/ld.h
e4d1f5
+++ elfutils/src/ld.h
e4d1f5
@@ -1122,6 +1122,7 @@ extern bool dynamically_linked_p (void);
e4d1f5
 
e4d1f5
 /* Checked whether the symbol is undefined and referenced from a DSO.  */
e4d1f5
 extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
e4d1f5
+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
e4d1f5
 #ifdef __GNUC_STDC_INLINE__
e4d1f5
 __attribute__ ((__gnu_inline__))
e4d1f5
 #endif
e4d1f5
@@ -1139,5 +1140,6 @@ linked_from_dso_p (struct scninfo *scnin
e4d1f5
 
e4d1f5
   return sym->defined && sym->in_dso;
e4d1f5
 }
e4d1f5
+#endif	/* Optimizing and not GCC 4.2.  */
e4d1f5
 
e4d1f5
 #endif	/* ld.h */
570047
--- elfutils/src/Makefile.am
570047
+++ elfutils/src/Makefile.am
e23544
@@ -26,6 +26,7 @@
a769ac
 ##
840723
 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \
a769ac
        -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
a769ac
+WEXTRA = @WEXTRA@
a769ac
 if MUDFLAP
850d0e
 AM_CFLAGS = -fmudflap
a769ac
 else
e23544
@@ -33,7 +34,7 @@ AM_CFLAGS =
a769ac
 endif
511c10
 AM_CFLAGS += -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
511c10
 	     $(if $($(*F)_no_Werror),,-Werror) \
511c10
-	     $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
511c10
+	     $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
5c16b0
 	     $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(CFLAGS_$(*F))
511c10
 
fb15a5
 INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
5c16b0
@@ -112,6 +113,9 @@ addr2line_no_Wformat = yes
2dfc22
 # XXX While the file is not finished, don't warn about this
2dfc22
 ldgeneric_no_Wunused = yes
2dfc22
 
2dfc22
+# Buggy old compilers.
2dfc22
+readelf_no_Werror = yes
2dfc22
+
2dfc22
 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
2dfc22
 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
2dfc22
 size_LDADD = $(libelf) $(libeu) $(libmudflap)
570047
--- elfutils/src/Makefile.in
570047
+++ elfutils/src/Makefile.in
d36848
@@ -226,6 +226,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -255,6 +256,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = @VERSION@
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@ -d
d36848
@@ -315,13 +317,13 @@ zip_LIBS = @zip_LIBS@
511c10
 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \
511c10
 @MUDFLAP_FALSE@	$(native_ld_cflags) $(if \
511c10
 @MUDFLAP_FALSE@	$($(*F)_no_Werror),,-Werror) $(if \
511c10
-@MUDFLAP_FALSE@	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
511c10
+@MUDFLAP_FALSE@	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
5c16b0
 @MUDFLAP_FALSE@	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
2a32e1
 @MUDFLAP_FALSE@	$(CFLAGS_$(*F))
850d0e
 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -std=gnu99 \
850d0e
 @MUDFLAP_TRUE@	$(native_ld_cflags) $(if \
511c10
 @MUDFLAP_TRUE@	$($(*F)_no_Werror),,-Werror) $(if \
511c10
-@MUDFLAP_TRUE@	$($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
511c10
+@MUDFLAP_TRUE@	$($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
5c16b0
 @MUDFLAP_TRUE@	$($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
5c16b0
 @MUDFLAP_TRUE@	$(CFLAGS_$(*F))
fb15a5
 INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
d36848
@@ -367,6 +369,9 @@ strings_no_Wformat = yes
5c16b0
 addr2line_no_Wformat = yes
2dfc22
 # XXX While the file is not finished, don't warn about this
2dfc22
 ldgeneric_no_Wunused = yes
2dfc22
+
2dfc22
+# Buggy old compilers.
2dfc22
+readelf_no_Werror = yes
2dfc22
 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
2dfc22
 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
2dfc22
 size_LDADD = $(libelf) $(libeu) $(libmudflap)
fb2677
--- elfutils/src/readelf.c
fb2677
+++ elfutils/src/readelf.c
e37a49
@@ -7661,7 +7661,7 @@ dump_archive_index (Elf *elf, const char
fb2677
 	  if (unlikely (elf_rand (elf, as_off) == 0)
fb2677
 	      || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
fb2677
 			   == NULL))
fb2677
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
fb2677
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
fb2677
 	    while (1)
fb2677
 #endif
fb2677
 	      error (EXIT_FAILURE, 0,
3c3d38
--- elfutils/src/strings.c
3c3d38
+++ elfutils/src/strings.c
3c3d38
@@ -51,6 +51,10 @@
3c3d38
 
3c3d38
 #include <system.h>
3c3d38
 
3c3d38
+#ifndef MAP_POPULATE
3c3d38
+# define MAP_POPULATE 0
3c3d38
+#endif
3c3d38
+
3c3d38
 
3c3d38
 /* Prototypes of local functions.  */
3c3d38
 static int read_fd (int fd, const char *fname, off64_t fdlen);
9a3c17
@@ -491,8 +495,13 @@ map_file (int fd, off64_t start_off, off
9a3c17
 		    fd, start_off);
9a3c17
       if (mem != MAP_FAILED)
9a3c17
 	{
9a3c17
+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
9a3c17
+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
9a3c17
+#endif
9a3c17
+#ifdef POSIX_MADV_SEQUENTIAL
9a3c17
 	  /* We will go through the mapping sequentially.  */
9a3c17
 	  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
9a3c17
+#endif
9a3c17
 	  break;
9a3c17
 	}
9a3c17
       if (errno != EINVAL && errno != ENOMEM)
e4d1f5
@@ -586,9 +595,11 @@ read_block (int fd, const char *fname, o
e4d1f5
       elfmap_off = from & ~(ps - 1);
e4d1f5
       elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
e4d1f5
 
e4d1f5
+#ifdef POSIX_FADV_SEQUENTIAL
e4d1f5
       if (unlikely (elfmap == MAP_FAILED))
e4d1f5
 	/* Let the kernel know we are going to read everything in sequence.  */
e4d1f5
 	(void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
e4d1f5
+#endif
e4d1f5
     }
e4d1f5
 
e4d1f5
   if (unlikely (elfmap == MAP_FAILED))
570047
--- elfutils/src/strip.c
570047
+++ elfutils/src/strip.c
e23544
@@ -52,6 +52,12 @@
b73b6e
 #include <libebl.h>
b73b6e
 #include <system.h>
b73b6e
 
b73b6e
+#ifdef HAVE_FUTIMES
b73b6e
+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
b73b6e
+#else
b73b6e
+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
b73b6e
+#endif
b73b6e
+
b73b6e
 
b73b6e
 /* Name and version of program.  */
b73b6e
 static void print_version (FILE *stream, struct argp_state *state);
e23544
@@ -300,8 +306,18 @@ process_file (const char *fname)
a769ac
 
a769ac
       /* If we have to preserve the timestamp, we need it in the
a769ac
 	 format utimes() understands.  */
a769ac
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
a769ac
       TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
a769ac
+#else
a769ac
+      tv[0].tv_sec = pre_st.st_atime;
a769ac
+      tv[0].tv_usec = 0;
a769ac
+#endif
a769ac
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
a769ac
       TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
a769ac
+#else
a769ac
+      tv[1].tv_sec = pre_st.st_atime;
a769ac
+      tv[1].tv_usec = 0;
a769ac
+#endif
a769ac
     }
a769ac
 
a769ac
   /* Open the file.  */
fbfe24
@@ -1746,7 +1762,7 @@ handle_elf (int fd, Elf *elf, const char
a769ac
   /* If requested, preserve the timestamp.  */
a769ac
   if (tvp != NULL)
a769ac
     {
a769ac
-      if (futimes (fd, tvp) != 0)
b73b6e
+      if (FUTIMES (fd, output_fname, tvp) != 0)
a769ac
 	{
a769ac
 	  error (0, errno, gettext ("\
5fa386
 cannot set access and modification date of '%s'"),
fbfe24
@@ -1803,7 +1819,7 @@ handle_ar (int fd, Elf *elf, const char 
a769ac
 
a769ac
   if (tvp != NULL)
a769ac
     {
a769ac
-      if (unlikely (futimes (fd, tvp) != 0))
b73b6e
+      if (unlikely (FUTIMES (fd, fname, tvp) != 0))
a769ac
 	{
a769ac
 	  error (0, errno, gettext ("\
5fa386
 cannot set access and modification date of '%s'"), fname);
f995fa
--- elfutils/tests/ChangeLog
f995fa
+++ elfutils/tests/ChangeLog
d36848
@@ -124,6 +124,8 @@
fb2677
 
fb2677
 2008-01-21  Roland McGrath  <roland@redhat.com>
fb2677
 
fb2677
+	* line2addr.c (main): Revert last change.
fb2677
+
fb2677
 	* testfile45.S.bz2: Add tests for cltq, cqto.
fb2677
 	* testfile45.expect.bz2: Adjust.
fb2677
 
d36848
@@ -832,6 +834,11 @@
f995fa
 	* Makefile.am (TESTS): Add run-elflint-test.sh.
f995fa
 	(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
f995fa
 
f995fa
+2005-05-31  Roland McGrath  <roland@redhat.com>
f995fa
+
f995fa
+	* Makefile.am (WEXTRA): New variable, substituted by configure.
f995fa
+	(AM_CFLAGS): Use it in place of -Wextra.
f995fa
+
f995fa
 2005-05-24  Ulrich Drepper  <drepper@redhat.com>
f995fa
 
f995fa
 	* get-files.c (main): Use correct format specifier.
fb2677
--- elfutils/tests/line2addr.c
fb2677
+++ elfutils/tests/line2addr.c
fb2677
@@ -132,7 +132,7 @@ main (int argc, char *argv[])
fb2677
     {
fb2677
       struct args a = { .arg = argv[cnt] };
fb2677
 
fb2677
-      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
fb2677
+      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
fb2677
 	{
fb2677
 	default:
fb2677
 	case 0:
f995fa
--- elfutils/tests/Makefile.am
f995fa
+++ elfutils/tests/Makefile.am
e23544
@@ -25,12 +25,13 @@
e23544
 ## <http://www.openinventionnetwork.com>.
f995fa
 ##
f995fa
 DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE
f995fa
+WEXTRA = @WEXTRA@
f995fa
 if MUDFLAP
f995fa
-AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\
f995fa
+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\
f995fa
 	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
418cfd
 BUILD_RPATH = \$$ORIGIN/../backends
f995fa
 else
f995fa
-AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
f995fa
+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \
f995fa
 	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
418cfd
 BUILT_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
f995fa
 endif
570047
--- elfutils/tests/Makefile.in
570047
+++ elfutils/tests/Makefile.in
d36848
@@ -359,6 +359,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
80ba80
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80ba80
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
80ba80
 LDFLAGS = @LDFLAGS@
80ba80
+LD_AS_NEEDED = @LD_AS_NEEDED@
80ba80
 LEX = @LEX@
80ba80
 LEXLIB = @LEXLIB@
80ba80
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
d36848
@@ -388,6 +389,7 @@ SHELL = @SHELL@
3cb5df
 STRIP = @STRIP@
b73b6e
 USE_NLS = @USE_NLS@
b73b6e
 VERSION = @VERSION@
b73b6e
+WEXTRA = @WEXTRA@
b73b6e
 XGETTEXT = @XGETTEXT@
3cb5df
 XGETTEXT_015 = @XGETTEXT_015@
b73b6e
 YACC = @YACC@
d36848
@@ -445,10 +447,10 @@ top_build_prefix = @top_build_prefix@
3cb5df
 top_builddir = @top_builddir@
3cb5df
 top_srcdir = @top_srcdir@
5c16b0
 zip_LIBS = @zip_LIBS@
f995fa
-@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \
f995fa
+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \
f995fa
 @MUDFLAP_FALSE@	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
f995fa
 
f995fa
-@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\
f995fa
+@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\
f995fa
 @MUDFLAP_TRUE@	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2)
f995fa
 
418cfd
 @MUDFLAP_TRUE@BUILD_RPATH = \$$ORIGIN/../backends