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