summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/elfutils-0.155/redhat-portability.diff
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils/elfutils-0.155/redhat-portability.diff')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.155/redhat-portability.diff1547
1 files changed, 1547 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.155/redhat-portability.diff b/meta/recipes-devtools/elfutils/elfutils-0.155/redhat-portability.diff
new file mode 100644
index 0000000000..d5628aa3f1
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.155/redhat-portability.diff
@@ -0,0 +1,1547 @@
1Upstream-Status: Backport
2
3Index: elfutils-0.155/backends/ChangeLog
4===================================================================
5--- elfutils-0.155.orig/backends/ChangeLog
6+++ elfutils-0.155/backends/ChangeLog
7@@ -135,6 +135,10 @@
8 * ppc_attrs.c (ppc_check_object_attribute): Handle tag
9 GNU_Power_ABI_Struct_Return.
10
11+2009-01-23 Roland McGrath <roland@redhat.com>
12+
13+ * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
14+
15 2008-10-04 Ulrich Drepper <drepper@redhat.com>
16
17 * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
18@@ -462,6 +466,11 @@
19 * sparc_init.c: Likewise.
20 * x86_64_init.c: Likewise.
21
22+2005-11-22 Roland McGrath <roland@redhat.com>
23+
24+ * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
25+ (libebl_%.so rule): Use it in place of -Wl,--as-needed.
26+
27 2005-11-19 Roland McGrath <roland@redhat.com>
28
29 * ppc64_reloc.def: REL30 -> ADDR30.
30@@ -484,6 +493,9 @@
31 * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
32 (CLEANFILES): Add libebl_$(m).so.
33
34+ * Makefile.am (WEXTRA): New variable, substituted by configure.
35+ (AM_CFLAGS): Use it in place of -Wextra.
36+
37 * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
38 * ppc64_reloc.def: Likewise.
39
40Index: elfutils-0.155/backends/Makefile.am
41===================================================================
42--- elfutils-0.155.orig/backends/Makefile.am
43+++ elfutils-0.155/backends/Makefile.am
44@@ -111,7 +111,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
45 $(LINK) -shared -o $(@:.map=.so) \
46 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
47 -Wl,--version-script,$(@:.so=.map) \
48- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
49+ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
50 $(textrel_check)
51
52 libebl_i386.so: $(cpu_i386)
53Index: elfutils-0.155/backends/Makefile.in
54===================================================================
55--- elfutils-0.155.orig/backends/Makefile.in
56+++ elfutils-0.155/backends/Makefile.in
57@@ -38,7 +38,8 @@ build_triplet = @build@
58 host_triplet = @host@
59 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
60 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog
61-@MUDFLAP_TRUE@am__append_1 = -fmudflap
62+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
63+@MUDFLAP_TRUE@am__append_2 = -fmudflap
64 subdir = backends
65 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
66 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
67@@ -172,6 +173,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
68 INSTALL_SCRIPT = @INSTALL_SCRIPT@
69 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
70 LDFLAGS = @LDFLAGS@
71+LD_AS_NEEDED = @LD_AS_NEEDED@
72 LEX = @LEX@
73 LEXLIB = @LEXLIB@
74 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
75@@ -201,6 +203,7 @@ SHELL = @SHELL@
76 STRIP = @STRIP@
77 USE_NLS = @USE_NLS@
78 VERSION = @VERSION@
79+WEXTRA = @WEXTRA@
80 XGETTEXT = @XGETTEXT@
81 XGETTEXT_015 = @XGETTEXT_015@
82 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
83@@ -263,10 +266,9 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
84 -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
85 -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
86 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
87- $($(*F)_no_Werror),,-Werror) $(if \
88- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
89+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
90 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
91- $(am__append_1)
92+ $(am__append_1) $(am__append_2)
93 @MUDFLAP_FALSE@libmudflap =
94 @MUDFLAP_TRUE@libmudflap = -lmudflap
95 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
96@@ -725,7 +727,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
97 $(LINK) -shared -o $(@:.map=.so) \
98 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
99 -Wl,--version-script,$(@:.so=.map) \
100- -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
101+ -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
102 $(textrel_check)
103
104 libebl_i386.so: $(cpu_i386)
105Index: elfutils-0.155/ChangeLog
106===================================================================
107--- elfutils-0.155.orig/ChangeLog
108+++ elfutils-0.155/ChangeLog
109@@ -16,6 +16,8 @@
110
111 2012-01-24 Mark Wielaard <mjw@redhat.com>
112
113+ * configure.ac: Wrap AC_COMPILE_IFELSE sources in AC_LANG_SOURCE.
114+
115 * COPYING: Fix address. Updated version from gnulib.
116
117 2012-01-23 Mark Wielaard <mjw@redhat.com>
118@@ -34,6 +36,9 @@
119
120 2011-10-08 Mike Frysinger <vapier@gentoo.org>
121
122+ * configure.ac (--disable-werror): Handle it, controlling BUILD_WERROR
123+ automake option.
124+
125 * configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly.
126
127 2011-10-02 Ulrich Drepper <drepper@gmail.com>
128@@ -55,6 +60,10 @@
129
130 * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
131
132+2009-11-22 Roland McGrath <roland@redhat.com>
133+
134+ * configure.ac: Use sed and expr instead of modern bash extensions.
135+
136 2009-09-21 Ulrich Drepper <drepper@redhat.com>
137
138 * configure.ac: Update for more modern autoconf.
139@@ -63,6 +72,10 @@
140
141 * configure.ac (zip_LIBS): Check for liblzma too.
142
143+2009-08-17 Roland McGrath <roland@redhat.com>
144+
145+ * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
146+
147 2009-04-19 Roland McGrath <roland@redhat.com>
148
149 * configure.ac (eu_version): Round down here, not in version.h macros.
150@@ -74,6 +87,8 @@
151
152 2009-01-23 Roland McGrath <roland@redhat.com>
153
154+ * configure.ac: Check for __builtin_popcount.
155+
156 * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
157
158 * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
159@@ -154,6 +169,10 @@
160 * configure.ac: Add dummy automake conditional to get dependencies
161 for non-generic linker right. See src/Makefile.am.
162
163+2005-11-22 Roland McGrath <roland@redhat.com>
164+
165+ * configure.ac: Check for --as-needed linker option.
166+
167 2005-11-18 Roland McGrath <roland@redhat.com>
168
169 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
170@@ -201,6 +220,17 @@
171 * Makefile.am (all_SUBDIRS): Add libdwfl.
172 * configure.ac: Write libdwfl/Makefile.
173
174+2005-05-31 Roland McGrath <roland@redhat.com>
175+
176+ * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
177+
178+ * configure.ac: Check for struct stat st_?tim members.
179+ * src/strip.c (process_file): Use st_?time if st_?tim are not there.
180+
181+ * configure.ac: Check for futimes function.
182+ * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
183+ (handle_ar) [! HAVE_FUTIMES]: Likewise.
184+
185 2005-05-19 Roland McGrath <roland@redhat.com>
186
187 * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
188Index: elfutils-0.155/config/ChangeLog
189===================================================================
190--- elfutils-0.155.orig/config/ChangeLog
191+++ elfutils-0.155/config/ChangeLog
192@@ -19,6 +19,10 @@
193
194 * known-dwarf.awk: Use gawk.
195
196+2011-10-08 Mike Frysinger <vapier@gentoo.org>
197+
198+ * eu.am [BUILD_WERROR]: Conditionalize -Werror use on this.
199+
200 2010-07-02 Ulrich Drepper <drepper@redhat.com>
201
202 * elfutils.spec.in: Add more BuildRequires.
203Index: elfutils-0.155/config/eu.am
204===================================================================
205--- elfutils-0.155.orig/config/eu.am
206+++ elfutils-0.155/config/eu.am
207@@ -1,6 +1,6 @@
208 ## Common automake fragments for elfutils subdirectory makefiles.
209 ##
210-## Copyright (C) 2010 Red Hat, Inc.
211+## Copyright (C) 2010-2011 Red Hat, Inc.
212 ##
213 ## This file is part of elfutils.
214 ##
215@@ -29,14 +29,20 @@
216 ## not, see <http://www.gnu.org/licenses/>.
217 ##
218
219+WEXTRA = @WEXTRA@
220+LD_AS_NEEDED = @LD_AS_NEEDED@
221+
222 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
223 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
224 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
225- $(if $($(*F)_no_Werror),,-Werror) \
226- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
227+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
228 $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
229 $($(*F)_CFLAGS)
230
231+if BUILD_WERROR
232+AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror)
233+endif
234+
235 if MUDFLAP
236 AM_CFLAGS += -fmudflap
237 libmudflap = -lmudflap
238Index: elfutils-0.155/config/Makefile.in
239===================================================================
240--- elfutils-0.155.orig/config/Makefile.in
241+++ elfutils-0.155/config/Makefile.in
242@@ -76,6 +76,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
243 INSTALL_SCRIPT = @INSTALL_SCRIPT@
244 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
245 LDFLAGS = @LDFLAGS@
246+LD_AS_NEEDED = @LD_AS_NEEDED@
247 LEX = @LEX@
248 LEXLIB = @LEXLIB@
249 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
250@@ -105,6 +106,7 @@ SHELL = @SHELL@
251 STRIP = @STRIP@
252 USE_NLS = @USE_NLS@
253 VERSION = @VERSION@
254+WEXTRA = @WEXTRA@
255 XGETTEXT = @XGETTEXT@
256 XGETTEXT_015 = @XGETTEXT_015@
257 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
258Index: elfutils-0.155/config.h.in
259===================================================================
260--- elfutils-0.155.orig/config.h.in
261+++ elfutils-0.155/config.h.in
262@@ -6,6 +6,9 @@
263 /* Defined if libdw should support GNU ref_alt FORM, dwz multi files. */
264 #undef ENABLE_DWZ
265
266+/* Have __builtin_popcount. */
267+#undef HAVE_BUILTIN_POPCOUNT
268+
269 /* $libdir subdirectory containing libebl modules. */
270 #undef LIBEBL_SUBDIR
271
272@@ -64,4 +67,7 @@
273 /* Define for large files, on AIX-style hosts. */
274 #undef _LARGE_FILES
275
276+/* Stubbed out if missing compiler support. */
277+#undef __thread
278+
279 #include <eu-config.h>
280Index: elfutils-0.155/configure.ac
281===================================================================
282--- elfutils-0.155.orig/configure.ac
283+++ elfutils-0.155/configure.ac
284@@ -90,6 +90,54 @@ CFLAGS="$old_CFLAGS"])
285 AS_IF([test "x$ac_cv_c99" != xyes],
286 AC_MSG_ERROR([gcc with C99 support required]))
287
288+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
289+old_CFLAGS="$CFLAGS"
290+CFLAGS="$CFLAGS -Wextra"
291+AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo (void) { }])],
292+ ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
293+CFLAGS="$old_CFLAGS"])
294+AC_SUBST(WEXTRA)
295+AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
296+
297+AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
298+old_CFLAGS="$CFLAGS"
299+CFLAGS="$CFLAGS -fgnu89-inline -Werror"
300+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
301+void foo (void)
302+{
303+ inline void bar (void) {}
304+ bar ();
305+}
306+extern inline void baz (void) {}
307+])], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
308+CFLAGS="$old_CFLAGS"])
309+AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
310+ [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
311+
312+AC_CACHE_CHECK([for --as-needed linker option],
313+ ac_cv_as_needed, [dnl
314+cat > conftest.c <<EOF
315+int main (void) { return 0; }
316+EOF
317+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
318+ -fPIC -shared -o conftest.so conftest.c
319+ -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
320+then
321+ ac_cv_as_needed=yes
322+else
323+ ac_cv_as_needed=no
324+fi
325+rm -f conftest*])
326+AS_IF([test "x$ac_cv_as_needed" = xyes],
327+ [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
328+AC_SUBST(LD_AS_NEEDED)
329+
330+AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
331+AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
332+ ac_cv_popcount=yes, ac_cv_popcount=no)])
333+AS_IF([test "x$ac_cv_popcount" = xyes],
334+ [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
335+
336 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
337 # Use the same flags that we use for our DSOs, so the test is representative.
338 # Some old compiler/linker/libc combinations fail some ways and not others.
339@@ -105,7 +153,10 @@ static __thread int a; int foo (int b) {
340 CFLAGS="$save_CFLAGS"
341 LDFLAGS="$save_LDFLAGS"])
342 AS_IF([test "x$ac_cv_tls" != xyes],
343- AC_MSG_ERROR([__thread support required]))
344+ [AS_IF([test "$use_locks" = yes],
345+ [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
346+ [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
347+ [Stubbed out if missing compiler support.])])])
348
349 dnl This test must come as early as possible after the compiler configuration
350 dnl tests, because the choice of the file model can (in principle) affect
351@@ -193,6 +244,11 @@ AM_CONDITIONAL(GCOV, test "$use_gcov" =
352 AM_CONDITIONAL(BUILD_STATIC, [dnl
353 test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes])
354
355+AC_ARG_ENABLE([werror],
356+AS_HELP_STRING([--disable-werror],[do not build with -Werror]),
357+ [enable_werror=$enableval], [enable_werror=yes])
358+AM_CONDITIONAL(BUILD_WERROR, test "$enable_werror" = yes)
359+
360 AC_ARG_ENABLE([tests-rpath],
361 AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
362 [tests_use_rpath=$enableval], [tests_use_rpath=no])
363@@ -304,6 +360,6 @@ case "$eu_version" in
364 esac
365
366 # Round up to the next release API (x.y) version.
367-eu_version=$(( (eu_version + 999) / 1000 ))
368+eu_version=`expr \( $eu_version + 999 \) / 1000`
369
370 AC_OUTPUT
371Index: elfutils-0.155/lib/ChangeLog
372===================================================================
373--- elfutils-0.155.orig/lib/ChangeLog
374+++ elfutils-0.155/lib/ChangeLog
375@@ -35,6 +35,9 @@
376
377 2009-01-23 Roland McGrath <roland@redhat.com>
378
379+ * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
380+ (__builtin_popcount): New inline function.
381+
382 * eu-config.h: Add multiple inclusion protection.
383
384 2009-01-17 Ulrich Drepper <drepper@redhat.com>
385@@ -91,6 +94,11 @@
386 * Makefile.am (libeu_a_SOURCES): Add it.
387 * system.h: Declare crc32_file.
388
389+2005-02-07 Roland McGrath <roland@redhat.com>
390+
391+ * Makefile.am (WEXTRA): New variable, substituted by configure.
392+ (AM_CFLAGS): Use it in place of -Wextra.
393+
394 2005-04-30 Ulrich Drepper <drepper@redhat.com>
395
396 * Makefile.am: Use -ffunction-sections for xmalloc.c.
397Index: elfutils-0.155/lib/eu-config.h
398===================================================================
399--- elfutils-0.155.orig/lib/eu-config.h
400+++ elfutils-0.155/lib/eu-config.h
401@@ -162,6 +162,17 @@ asm (".section predict_data, \"aw\"; .pr
402 /* This macro is used by the tests conditionalize for standalone building. */
403 #define ELFUTILS_HEADER(name) <lib##name.h>
404
405+#ifndef HAVE_BUILTIN_POPCOUNT
406+# define __builtin_popcount hakmem_popcount
407+static inline unsigned int __attribute__ ((unused))
408+hakmem_popcount (unsigned int x)
409+{
410+ /* HAKMEM 169 */
411+ unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
412+ return ((n + (n >> 3)) & 030707070707) % 63;
413+}
414+#endif /* HAVE_BUILTIN_POPCOUNT */
415+
416
417 #ifdef SHARED
418 # define OLD_VERSION(name, version) \
419Index: elfutils-0.155/lib/Makefile.in
420===================================================================
421--- elfutils-0.155.orig/lib/Makefile.in
422+++ elfutils-0.155/lib/Makefile.in
423@@ -37,7 +37,8 @@ build_triplet = @build@
424 host_triplet = @host@
425 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
426 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog
427-@MUDFLAP_TRUE@am__append_1 = -fmudflap
428+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
429+@MUDFLAP_TRUE@am__append_2 = -fmudflap
430 subdir = lib
431 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
432 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
433@@ -100,6 +101,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
434 INSTALL_SCRIPT = @INSTALL_SCRIPT@
435 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
436 LDFLAGS = @LDFLAGS@
437+LD_AS_NEEDED = @LD_AS_NEEDED@
438 LEX = @LEX@
439 LEXLIB = @LEXLIB@
440 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
441@@ -129,6 +131,7 @@ SHELL = @SHELL@
442 STRIP = @STRIP@
443 USE_NLS = @USE_NLS@
444 VERSION = @VERSION@
445+WEXTRA = @WEXTRA@
446 XGETTEXT = @XGETTEXT@
447 XGETTEXT_015 = @XGETTEXT_015@
448 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
449@@ -190,10 +193,9 @@ zip_LIBS = @zip_LIBS@
450 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
451 -I$(srcdir)/../libelf
452 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
453- $($(*F)_no_Werror),,-Werror) $(if \
454- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
455+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
456 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
457- $(am__append_1) -fpic
458+ $(am__append_1) $(am__append_2) -fpic
459 @MUDFLAP_FALSE@libmudflap =
460 @MUDFLAP_TRUE@libmudflap = -lmudflap
461 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
462Index: elfutils-0.155/libasm/ChangeLog
463===================================================================
464--- elfutils-0.155.orig/libasm/ChangeLog
465+++ elfutils-0.155/libasm/ChangeLog
466@@ -71,6 +71,11 @@
467 * asm_error.c: Add new error ASM_E_IOERROR.
468 * libasmP.h: Add ASM_E_IOERROR definition.
469
470+2005-05-31 Roland McGrath <roland@redhat.com>
471+
472+ * Makefile.am (WEXTRA): New variable, substituted by configure.
473+ (AM_CFLAGS): Use it in place of -Wextra.
474+
475 2005-02-15 Ulrich Drepper <drepper@redhat.com>
476
477 * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
478Index: elfutils-0.155/libasm/Makefile.in
479===================================================================
480--- elfutils-0.155.orig/libasm/Makefile.in
481+++ elfutils-0.155/libasm/Makefile.in
482@@ -39,10 +39,11 @@ host_triplet = @host@
483 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
484 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
485 $(top_srcdir)/config/eu.am ChangeLog
486-@MUDFLAP_TRUE@am__append_1 = -fmudflap
487+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
488+@MUDFLAP_TRUE@am__append_2 = -fmudflap
489 @MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
490 @MUDFLAP_TRUE@am_libasm_pic_a_OBJECTS =
491-@MUDFLAP_FALSE@@USE_LOCKS_TRUE@am__append_2 = -lpthread
492+@MUDFLAP_FALSE@@USE_LOCKS_TRUE@am__append_3 = -lpthread
493 subdir = libasm
494 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
495 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
496@@ -153,6 +154,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
497 INSTALL_SCRIPT = @INSTALL_SCRIPT@
498 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
499 LDFLAGS = @LDFLAGS@
500+LD_AS_NEEDED = @LD_AS_NEEDED@
501 LEX = @LEX@
502 LEXLIB = @LEXLIB@
503 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
504@@ -182,6 +184,7 @@ SHELL = @SHELL@
505 STRIP = @STRIP@
506 USE_NLS = @USE_NLS@
507 VERSION = 1
508+WEXTRA = @WEXTRA@
509 XGETTEXT = @XGETTEXT@
510 XGETTEXT_015 = @XGETTEXT_015@
511 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
512@@ -244,10 +247,9 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
513 -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
514 -I$(top_srcdir)/libdw
515 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
516- $($(*F)_no_Werror),,-Werror) $(if \
517- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
518+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
519 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
520- $(am__append_1)
521+ $(am__append_1) $(am__append_2)
522 @MUDFLAP_FALSE@libmudflap =
523 @MUDFLAP_TRUE@libmudflap = -lmudflap
524 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
525@@ -276,7 +278,7 @@ libasm_a_SOURCES = asm_begin.c asm_abort
526
527 @MUDFLAP_FALSE@libasm_pic_a_SOURCES =
528 @MUDFLAP_FALSE@am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
529-@MUDFLAP_FALSE@libasm_so_LDLIBS = $(am__append_2)
530+@MUDFLAP_FALSE@libasm_so_LDLIBS = $(am__append_3)
531 @MUDFLAP_FALSE@libasm_so_SOURCES =
532 noinst_HEADERS = libasmP.h symbolhash.h
533 EXTRA_DIST = libasm.map
534Index: elfutils-0.155/libcpu/ChangeLog
535===================================================================
536--- elfutils-0.155.orig/libcpu/ChangeLog
537+++ elfutils-0.155/libcpu/ChangeLog
538@@ -38,6 +38,9 @@
539
540 2009-01-23 Roland McGrath <roland@redhat.com>
541
542+ * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
543+ compilers that don't realize it's noreturn.
544+
545 * Makefile.am (i386_parse_CFLAGS): Use quotes around command
546 substitution that can produce leading whitespace.
547
548@@ -367,6 +370,11 @@
549 * defs/i386.doc: New file.
550 * defs/x86_64: New file.
551
552+2005-04-04 Roland McGrath <roland@redhat.com>
553+
554+ * Makefile.am (WEXTRA): New variable, substituted by configure.
555+ (AM_CFLAGS): Use it instead of -Wextra.
556+
557 2005-02-15 Ulrich Drepper <drepper@redhat.com>
558
559 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
560Index: elfutils-0.155/libcpu/i386_disasm.c
561===================================================================
562--- elfutils-0.155.orig/libcpu/i386_disasm.c
563+++ elfutils-0.155/libcpu/i386_disasm.c
564@@ -822,6 +822,7 @@ i386_disasm (const uint8_t **startp, con
565
566 default:
567 assert (! "INVALID not handled");
568+ abort ();
569 }
570 }
571 else
572Index: elfutils-0.155/libcpu/Makefile.in
573===================================================================
574--- elfutils-0.155.orig/libcpu/Makefile.in
575+++ elfutils-0.155/libcpu/Makefile.in
576@@ -39,7 +39,8 @@ host_triplet = @host@
577 DIST_COMMON = $(am__noinst_HEADERS_DIST) $(srcdir)/Makefile.am \
578 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog \
579 i386_lex.c i386_parse.c
580-@MUDFLAP_TRUE@am__append_1 = -fmudflap
581+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
582+@MUDFLAP_TRUE@am__append_2 = -fmudflap
583 @MAINTAINER_MODE_TRUE@noinst_PROGRAMS = i386_gendis$(EXEEXT)
584 subdir = libcpu
585 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
586@@ -117,6 +118,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
587 INSTALL_SCRIPT = @INSTALL_SCRIPT@
588 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
589 LDFLAGS = @LDFLAGS@
590+LD_AS_NEEDED = @LD_AS_NEEDED@
591 LEX = @LEX@
592 LEXLIB = @LEXLIB@
593 LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
594@@ -146,6 +148,7 @@ SHELL = @SHELL@
595 STRIP = @STRIP@
596 USE_NLS = @USE_NLS@
597 VERSION = @VERSION@
598+WEXTRA = @WEXTRA@
599 XGETTEXT = @XGETTEXT@
600 XGETTEXT_015 = @XGETTEXT_015@
601 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
602@@ -208,10 +211,9 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
603 -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
604 -I$(srcdir)/../libdw -I$(srcdir)/../libasm
605 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
606- $($(*F)_no_Werror),,-Werror) $(if \
607- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
608+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
609 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
610- $(am__append_1) -fpic -fdollars-in-identifiers
611+ $(am__append_1) $(am__append_2) -fpic -fdollars-in-identifiers
612 @MUDFLAP_FALSE@libmudflap =
613 @MUDFLAP_TRUE@libmudflap = -lmudflap
614 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
615Index: elfutils-0.155/libdw/ChangeLog
616===================================================================
617--- elfutils-0.155.orig/libdw/ChangeLog
618+++ elfutils-0.155/libdw/ChangeLog
619@@ -82,6 +82,10 @@
620
621 * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
622
623+2011-07-20 Mark Wielaard <mjw@redhat.com>
624+
625+ * dwarf_begin_elf.c: Add fallback for be64toh if not defined.
626+
627 2011-07-14 Mark Wielaard <mjw@redhat.com>
628
629 * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
630@@ -441,6 +445,10 @@
631
632 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
633
634+2009-08-17 Roland McGrath <roland@redhat.com>
635+
636+ * libdw.h: Disable extern inlines for GCC 4.2.
637+
638 2009-08-10 Roland McGrath <roland@redhat.com>
639
640 * dwarf_getscopevar.c: Use dwarf_diename.
641@@ -1209,6 +1217,11 @@
642
643 2005-05-31 Roland McGrath <roland@redhat.com>
644
645+ * Makefile.am (WEXTRA): New variable, substituted by configure.
646+ (AM_CFLAGS): Use it in place of -Wextra.
647+
648+2005-05-31 Roland McGrath <roland@redhat.com>
649+
650 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
651 formref offset.
652
653Index: elfutils-0.155/libdw/dwarf_begin_elf.c
654===================================================================
655--- elfutils-0.155.orig/libdw/dwarf_begin_elf.c
656+++ elfutils-0.155/libdw/dwarf_begin_elf.c
657@@ -48,6 +48,14 @@
658 #if USE_ZLIB
659 # include <endian.h>
660 # define crc32 loser_crc32
661+# ifndef be64toh
662+# include <byteswap.h>
663+# if __BYTE_ORDER == __LITTLE_ENDIAN
664+# define be64toh(x) bswap_64 (x)
665+# else
666+# define be64toh(x) (x)
667+# endif
668+# endif
669 # include <zlib.h>
670 # undef crc32
671 #endif
672Index: elfutils-0.155/libdw/libdw.h
673===================================================================
674--- elfutils-0.155.orig/libdw/libdw.h
675+++ elfutils-0.155/libdw/libdw.h
676@@ -831,7 +831,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
677
678
679 /* Inline optimizations. */
680-#ifdef __OPTIMIZE__
681+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
682 /* Return attribute code of given attribute. */
683 __libdw_extern_inline unsigned int
684 dwarf_whatattr (Dwarf_Attribute *attr)
685Index: elfutils-0.155/libdw/Makefile.in
686===================================================================
687--- elfutils-0.155.orig/libdw/Makefile.in
688+++ elfutils-0.155/libdw/Makefile.in
689@@ -39,8 +39,9 @@ host_triplet = @host@
690 DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
691 $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
692 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog
693-@MUDFLAP_TRUE@am__append_1 = -fmudflap
694-@BUILD_STATIC_TRUE@am__append_2 = -fpic
695+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
696+@MUDFLAP_TRUE@am__append_2 = -fmudflap
697+@BUILD_STATIC_TRUE@am__append_3 = -fpic
698 @MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
699 @MUDFLAP_TRUE@am_libdw_pic_a_OBJECTS =
700 subdir = libdw
701@@ -198,6 +199,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
702 INSTALL_SCRIPT = @INSTALL_SCRIPT@
703 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
704 LDFLAGS = @LDFLAGS@
705+LD_AS_NEEDED = @LD_AS_NEEDED@
706 LEX = @LEX@
707 LEXLIB = @LEXLIB@
708 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
709@@ -227,6 +229,7 @@ SHELL = @SHELL@
710 STRIP = @STRIP@
711 USE_NLS = @USE_NLS@
712 VERSION = 1
713+WEXTRA = @WEXTRA@
714 XGETTEXT = @XGETTEXT@
715 XGETTEXT_015 = @XGETTEXT_015@
716 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
717@@ -288,10 +291,9 @@ zip_LIBS = @zip_LIBS@
718 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
719 -I$(srcdir)/../libelf
720 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
721- $($(*F)_no_Werror),,-Werror) $(if \
722- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
723+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
724 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
725- $(am__append_1) $(am__append_2)
726+ $(am__append_1) $(am__append_2) $(am__append_3)
727 @MUDFLAP_FALSE@libmudflap =
728 @MUDFLAP_TRUE@libmudflap = -lmudflap
729 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
730Index: elfutils-0.155/libdwfl/ChangeLog
731===================================================================
732--- elfutils-0.155.orig/libdwfl/ChangeLog
733+++ elfutils-0.155/libdwfl/ChangeLog
734@@ -1420,6 +1420,11 @@
735
736 2005-07-21 Roland McGrath <roland@redhat.com>
737
738+ * Makefile.am (WEXTRA): New variable, substituted by configure.
739+ (AM_CFLAGS): Use it in place of -Wextra.
740+
741+2005-07-21 Roland McGrath <roland@redhat.com>
742+
743 * Makefile.am (noinst_HEADERS): Add loc2c.c.
744
745 * test2.c (main): Check sscanf result to quiet warning.
746Index: elfutils-0.155/libdwfl/Makefile.in
747===================================================================
748--- elfutils-0.155.orig/libdwfl/Makefile.in
749+++ elfutils-0.155/libdwfl/Makefile.in
750@@ -38,11 +38,12 @@ host_triplet = @host@
751 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
752 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
753 $(top_srcdir)/config/eu.am ChangeLog
754-@MUDFLAP_TRUE@am__append_1 = -fmudflap
755-@MUDFLAP_FALSE@am__append_2 = libdwfl_pic.a
756-@ZLIB_TRUE@am__append_3 = gzip.c
757-@BZLIB_TRUE@am__append_4 = bzip2.c
758-@LZMA_TRUE@am__append_5 = lzma.c
759+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
760+@MUDFLAP_TRUE@am__append_2 = -fmudflap
761+@MUDFLAP_FALSE@am__append_3 = libdwfl_pic.a
762+@ZLIB_TRUE@am__append_4 = gzip.c
763+@BZLIB_TRUE@am__append_5 = bzip2.c
764+@LZMA_TRUE@am__append_6 = lzma.c
765 @MUDFLAP_TRUE@am_libdwfl_pic_a_OBJECTS =
766 subdir = libdwfl
767 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
768@@ -188,6 +189,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
769 INSTALL_SCRIPT = @INSTALL_SCRIPT@
770 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
771 LDFLAGS = @LDFLAGS@
772+LD_AS_NEEDED = @LD_AS_NEEDED@
773 LEX = @LEX@
774 LEXLIB = @LEXLIB@
775 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
776@@ -217,6 +219,7 @@ SHELL = @SHELL@
777 STRIP = @STRIP@
778 USE_NLS = @USE_NLS@
779 VERSION = 1
780+WEXTRA = @WEXTRA@
781 XGETTEXT = @XGETTEXT@
782 XGETTEXT_015 = @XGETTEXT_015@
783 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
784@@ -279,10 +282,9 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
785 -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
786 -I$(srcdir)/../libdw
787 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
788- $($(*F)_no_Werror),,-Werror) $(if \
789- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
790+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
791 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
792- $(am__append_1)
793+ $(am__append_1) $(am__append_2)
794 @MUDFLAP_FALSE@libmudflap =
795 @MUDFLAP_TRUE@libmudflap = -lmudflap
796 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
797@@ -290,7 +292,7 @@ COMPILE.os = $(filter-out -fprofile-arcs
798
799 CLEANFILES = *.gcno *.gcda $(am_libdwfl_pic_a_OBJECTS)
800 textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
801-noinst_LIBRARIES = libdwfl.a $(am__append_2)
802+noinst_LIBRARIES = libdwfl.a $(am__append_3)
803 pkginclude_HEADERS = libdwfl.h
804 libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c \
805 dwfl_version.c dwfl_module.c dwfl_report_elf.c relocate.c \
806@@ -311,8 +313,8 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en
807 dwfl_module_getsym.c dwfl_module_addrname.c \
808 dwfl_module_addrsym.c dwfl_module_return_value_location.c \
809 dwfl_module_register_names.c dwfl_segment_report_module.c \
810- link_map.c core-file.c open.c image-header.c $(am__append_3) \
811- $(am__append_4) $(am__append_5)
812+ link_map.c core-file.c open.c image-header.c $(am__append_4) \
813+ $(am__append_5) $(am__append_6)
814 @MUDFLAP_FALSE@libdwfl = $(libdw)
815 @MUDFLAP_TRUE@libdwfl = libdwfl.a $(libdw) $(libebl) $(libelf) $(libeu)
816 @MUDFLAP_FALSE@libdw = ../libdw/libdw.so
817Index: elfutils-0.155/libebl/ChangeLog
818===================================================================
819--- elfutils-0.155.orig/libebl/ChangeLog
820+++ elfutils-0.155/libebl/ChangeLog
821@@ -658,6 +658,11 @@
822 * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
823 tracking works right.
824
825+2005-05-31 Roland McGrath <roland@redhat.com>
826+
827+ * Makefile.am (WEXTRA): New variable, substituted by configure.
828+ (AM_CFLAGS): Use it in place of -Wextra.
829+
830 2005-05-21 Ulrich Drepper <drepper@redhat.com>
831
832 * libebl_x86_64.map: Add x86_64_core_note.
833Index: elfutils-0.155/libebl/Makefile.in
834===================================================================
835--- elfutils-0.155.orig/libebl/Makefile.in
836+++ elfutils-0.155/libebl/Makefile.in
837@@ -38,7 +38,8 @@ host_triplet = @host@
838 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
839 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
840 $(top_srcdir)/config/eu.am ChangeLog
841-@MUDFLAP_TRUE@am__append_1 = -fmudflap
842+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
843+@MUDFLAP_TRUE@am__append_2 = -fmudflap
844 subdir = libebl
845 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
846 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
847@@ -150,6 +151,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
848 INSTALL_SCRIPT = @INSTALL_SCRIPT@
849 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
850 LDFLAGS = @LDFLAGS@
851+LD_AS_NEEDED = @LD_AS_NEEDED@
852 LEX = @LEX@
853 LEXLIB = @LEXLIB@
854 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
855@@ -179,6 +181,7 @@ SHELL = @SHELL@
856 STRIP = @STRIP@
857 USE_NLS = @USE_NLS@
858 VERSION = 1
859+WEXTRA = @WEXTRA@
860 XGETTEXT = @XGETTEXT@
861 XGETTEXT_015 = @XGETTEXT_015@
862 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
863@@ -241,10 +244,9 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
864 -I$(srcdir)/../libelf -I$(srcdir)/../libdw \
865 -I$(srcdir)/../libasm
866 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
867- $($(*F)_no_Werror),,-Werror) $(if \
868- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
869+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
870 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
871- $(am__append_1) -fpic
872+ $(am__append_1) $(am__append_2) -fpic
873 @MUDFLAP_FALSE@libmudflap =
874 @MUDFLAP_TRUE@libmudflap = -lmudflap
875 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
876Index: elfutils-0.155/libelf/ChangeLog
877===================================================================
878--- elfutils-0.155.orig/libelf/ChangeLog
879+++ elfutils-0.155/libelf/ChangeLog
880@@ -34,6 +34,11 @@
881
882 * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
883
884+2011-03-10 Roland McGrath <roland@redhat.com>
885+
886+ * gnuhash_xlate.h (elf_cvt_gnuhash): Avoid post-increment in bswap_32
887+ argument, since some implementations are buggy macros.
888+
889 2011-02-26 Mark Wielaard <mjw@redhat.com>
890
891 * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
892@@ -711,6 +716,11 @@
893
894 * elf.h: Update from glibc.
895
896+2005-05-31 Roland McGrath <roland@redhat.com>
897+
898+ * Makefile.am (WEXTRA): New variable, substituted by configure.
899+ (AM_CFLAGS): Use it in place of -Wextra.
900+
901 2005-05-08 Roland McGrath <roland@redhat.com>
902
903 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
904Index: elfutils-0.155/libelf/common.h
905===================================================================
906--- elfutils-0.155.orig/libelf/common.h
907+++ elfutils-0.155/libelf/common.h
908@@ -139,7 +139,7 @@ libelf_release_all (Elf *elf)
909 (Var) = (sizeof (Var) == 1 \
910 ? (unsigned char) (Var) \
911 : (sizeof (Var) == 2 \
912- ? bswap_16 (Var) \
913+ ? (unsigned short int) bswap_16 (Var) \
914 : (sizeof (Var) == 4 \
915 ? bswap_32 (Var) \
916 : bswap_64 (Var))))
917@@ -148,7 +148,7 @@ libelf_release_all (Elf *elf)
918 (Dst) = (sizeof (Var) == 1 \
919 ? (unsigned char) (Var) \
920 : (sizeof (Var) == 2 \
921- ? bswap_16 (Var) \
922+ ? (unsigned short int) bswap_16 (Var) \
923 : (sizeof (Var) == 4 \
924 ? bswap_32 (Var) \
925 : bswap_64 (Var))))
926Index: elfutils-0.155/libelf/gnuhash_xlate.h
927===================================================================
928--- elfutils-0.155.orig/libelf/gnuhash_xlate.h
929+++ elfutils-0.155/libelf/gnuhash_xlate.h
930@@ -1,5 +1,5 @@
931 /* Conversion functions for versioning information.
932- Copyright (C) 2006, 2007 Red Hat, Inc.
933+ Copyright (C) 2006-2011 Red Hat, Inc.
934 This file is part of elfutils.
935 Written by Ulrich Drepper <drepper@redhat.com>, 2006.
936
937@@ -68,7 +68,9 @@ elf_cvt_gnuhash (void *dest, const void
938 dest32 = (Elf32_Word *) &dest64[bitmask_words];
939 while (len >= 4)
940 {
941- *dest32++ = bswap_32 (*src32++);
942+ *dest32 = bswap_32 (*src32);
943+ ++dest32;
944+ ++src32;
945 len -= 4;
946 }
947 }
948Index: elfutils-0.155/libelf/Makefile.in
949===================================================================
950--- elfutils-0.155.orig/libelf/Makefile.in
951+++ elfutils-0.155/libelf/Makefile.in
952@@ -39,11 +39,12 @@ host_triplet = @host@
953 DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
954 $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
955 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog
956-@MUDFLAP_TRUE@am__append_1 = -fmudflap
957-@BUILD_STATIC_TRUE@am__append_2 = -fpic
958+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
959+@MUDFLAP_TRUE@am__append_2 = -fmudflap
960+@BUILD_STATIC_TRUE@am__append_3 = -fpic
961 @MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
962 @MUDFLAP_TRUE@am_libelf_pic_a_OBJECTS =
963-@MUDFLAP_FALSE@@USE_LOCKS_TRUE@am__append_3 = -lpthread
964+@MUDFLAP_FALSE@@USE_LOCKS_TRUE@am__append_4 = -lpthread
965 subdir = libelf
966 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
967 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
968@@ -195,6 +196,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
969 INSTALL_SCRIPT = @INSTALL_SCRIPT@
970 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
971 LDFLAGS = @LDFLAGS@
972+LD_AS_NEEDED = @LD_AS_NEEDED@
973 LEX = @LEX@
974 LEXLIB = @LEXLIB@
975 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
976@@ -224,6 +226,7 @@ SHELL = @SHELL@
977 STRIP = @STRIP@
978 USE_NLS = @USE_NLS@
979 VERSION = 1
980+WEXTRA = @WEXTRA@
981 XGETTEXT = @XGETTEXT@
982 XGETTEXT_015 = @XGETTEXT_015@
983 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
984@@ -284,10 +287,9 @@ top_srcdir = @top_srcdir@
985 zip_LIBS = @zip_LIBS@
986 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
987 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
988- $($(*F)_no_Werror),,-Werror) $(if \
989- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
990+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
991 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
992- $(am__append_1) $(am__append_2)
993+ $(am__append_1) $(am__append_2) $(am__append_3)
994 @MUDFLAP_FALSE@libmudflap =
995 @MUDFLAP_TRUE@libmudflap = -lmudflap
996 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
997@@ -352,7 +354,7 @@ libelf_a_SOURCES = elf_version.c elf_has
998
999 @MUDFLAP_FALSE@libelf_pic_a_SOURCES =
1000 @MUDFLAP_FALSE@am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
1001-@MUDFLAP_FALSE@libelf_so_LDLIBS = $(am__append_3)
1002+@MUDFLAP_FALSE@libelf_so_LDLIBS = $(am__append_4)
1003 @MUDFLAP_FALSE@libelf_so_SOURCES =
1004 noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
1005 version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h
1006Index: elfutils-0.155/m4/Makefile.in
1007===================================================================
1008--- elfutils-0.155.orig/m4/Makefile.in
1009+++ elfutils-0.155/m4/Makefile.in
1010@@ -75,6 +75,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
1011 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1012 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1013 LDFLAGS = @LDFLAGS@
1014+LD_AS_NEEDED = @LD_AS_NEEDED@
1015 LEX = @LEX@
1016 LEXLIB = @LEXLIB@
1017 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1018@@ -104,6 +105,7 @@ SHELL = @SHELL@
1019 STRIP = @STRIP@
1020 USE_NLS = @USE_NLS@
1021 VERSION = @VERSION@
1022+WEXTRA = @WEXTRA@
1023 XGETTEXT = @XGETTEXT@
1024 XGETTEXT_015 = @XGETTEXT_015@
1025 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1026Index: elfutils-0.155/Makefile.in
1027===================================================================
1028--- elfutils-0.155.orig/Makefile.in
1029+++ elfutils-0.155/Makefile.in
1030@@ -165,6 +165,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
1031 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1032 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1033 LDFLAGS = @LDFLAGS@
1034+LD_AS_NEEDED = @LD_AS_NEEDED@
1035 LEX = @LEX@
1036 LEXLIB = @LEXLIB@
1037 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1038@@ -194,6 +195,7 @@ SHELL = @SHELL@
1039 STRIP = @STRIP@
1040 USE_NLS = @USE_NLS@
1041 VERSION = @VERSION@
1042+WEXTRA = @WEXTRA@
1043 XGETTEXT = @XGETTEXT@
1044 XGETTEXT_015 = @XGETTEXT_015@
1045 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1046Index: elfutils-0.155/src/addr2line.c
1047===================================================================
1048--- elfutils-0.155.orig/src/addr2line.c
1049+++ elfutils-0.155/src/addr2line.c
1050@@ -447,10 +447,10 @@ handle_address (const char *string, Dwfl
1051 bool parsed = false;
1052 int i, j;
1053 char *name = NULL;
1054- if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
1055+ if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
1056 && string[i] == '\0')
1057 parsed = adjust_to_section (name, &addr, dwfl);
1058- switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
1059+ switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
1060 {
1061 default:
1062 break;
1063Index: elfutils-0.155/src/ChangeLog
1064===================================================================
1065--- elfutils-0.155.orig/src/ChangeLog
1066+++ elfutils-0.155/src/ChangeLog
1067@@ -606,8 +606,16 @@
1068 * readelf.c (attr_callback): Use print_block only when we don't use
1069 print_ops.
1070
1071+2009-08-17 Roland McGrath <roland@redhat.com>
1072+
1073+ * ld.h: Disable extern inlines for GCC 4.2.
1074+
1075 2009-08-14 Roland McGrath <roland@redhat.com>
1076
1077+ * strings.c (read_block): Conditionalize posix_fadvise use
1078+ on [POSIX_FADV_SEQUENTIAL].
1079+ From Petr Salinger <Petr.Salinger@seznam.cz>.
1080+
1081 * ar.c (do_oper_extract): Use pathconf instead of statfs.
1082
1083 2009-08-01 Ulrich Drepper <drepper@redhat.com>
1084@@ -771,6 +779,8 @@
1085 * readelf.c (print_debug_frame_section): Use t instead of j formats
1086 for ptrdiff_t OFFSET.
1087
1088+ * addr2line.c (handle_address): Use %a instead of %m for compatibility.
1089+
1090 2009-01-21 Ulrich Drepper <drepper@redhat.com>
1091
1092 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
1093@@ -954,6 +964,11 @@
1094 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
1095 is valid in RELRO.
1096
1097+2008-03-01 Roland McGrath <roland@redhat.com>
1098+
1099+ * readelf.c (dump_archive_index): Tweak portability hack
1100+ to match [__GNUC__ < 4] too.
1101+
1102 2008-02-29 Roland McGrath <roland@redhat.com>
1103
1104 * readelf.c (print_attributes): Add a cast.
1105@@ -1205,6 +1220,8 @@
1106
1107 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
1108
1109+ * Makefile.am (readelf_no_Werror): New variable.
1110+
1111 2007-10-15 Roland McGrath <roland@redhat.com>
1112
1113 * make-debug-archive.in: New file.
1114@@ -1644,6 +1661,10 @@
1115 * elflint.c (valid_e_machine): Add EM_ALPHA.
1116 Reported by Christian Aichinger <Greek0@gmx.net>.
1117
1118+ * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
1119+ MADV_SEQUENTIAL if undefined. Don't call posix_madvise
1120+ if neither is defined.
1121+
1122 2006-08-08 Ulrich Drepper <drepper@redhat.com>
1123
1124 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
1125@@ -1720,6 +1741,10 @@
1126 * Makefile.am: Add hacks to create dependency files for non-generic
1127 linker.
1128
1129+2006-04-05 Roland McGrath <roland@redhat.com>
1130+
1131+ * strings.c (MAP_POPULATE): Define to 0 if undefined.
1132+
1133 2006-06-12 Ulrich Drepper <drepper@redhat.com>
1134
1135 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
1136@@ -2068,6 +2093,11 @@
1137 * readelf.c (print_debug_loc_section): Fix indentation for larger
1138 address size.
1139
1140+2005-05-31 Roland McGrath <roland@redhat.com>
1141+
1142+ * Makefile.am (WEXTRA): New variable, substituted by configure.
1143+ (AM_CFLAGS): Use it in place of -Wextra.
1144+
1145 2005-05-30 Roland McGrath <roland@redhat.com>
1146
1147 * readelf.c (print_debug_line_section): Print section offset of each
1148Index: elfutils-0.155/src/findtextrel.c
1149===================================================================
1150--- elfutils-0.155.orig/src/findtextrel.c
1151+++ elfutils-0.155/src/findtextrel.c
1152@@ -496,7 +496,11 @@ ptrcompare (const void *p1, const void *
1153
1154
1155 static void
1156-check_rel (size_t nsegments, struct segments segments[nsegments],
1157+check_rel (size_t nsegments, struct segments segments[
1158+#if __GNUC__ >= 4
1159+ nsegments
1160+#endif
1161+ ],
1162 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
1163 const char *fname, bool more_than_one, void **knownsrcs)
1164 {
1165Index: elfutils-0.155/src/ld.h
1166===================================================================
1167--- elfutils-0.155.orig/src/ld.h
1168+++ elfutils-0.155/src/ld.h
1169@@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void);
1170
1171 /* Checked whether the symbol is undefined and referenced from a DSO. */
1172 extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
1173+#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
1174 #ifdef __GNUC_STDC_INLINE__
1175 __attribute__ ((__gnu_inline__))
1176 #endif
1177@@ -1131,5 +1132,6 @@ linked_from_dso_p (struct scninfo *scnin
1178
1179 return sym->defined && sym->in_dso;
1180 }
1181+#endif /* Optimizing and not GCC 4.2. */
1182
1183 #endif /* ld.h */
1184Index: elfutils-0.155/src/Makefile.am
1185===================================================================
1186--- elfutils-0.155.orig/src/Makefile.am
1187+++ elfutils-0.155/src/Makefile.am
1188@@ -95,6 +95,9 @@ addr2line_no_Wformat = yes
1189 # XXX While the file is not finished, don't warn about this
1190 ldgeneric_no_Wunused = yes
1191
1192+# Buggy old compilers.
1193+readelf_no_Werror = yes
1194+
1195 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1196 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
1197 $(demanglelib)
1198Index: elfutils-0.155/src/Makefile.in
1199===================================================================
1200--- elfutils-0.155.orig/src/Makefile.in
1201+++ elfutils-0.155/src/Makefile.in
1202@@ -40,7 +40,8 @@ host_triplet = @host@
1203 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
1204 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog \
1205 ldlex.c ldscript.c
1206-@MUDFLAP_TRUE@am__append_1 = -fmudflap
1207+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
1208+@MUDFLAP_TRUE@am__append_2 = -fmudflap
1209 bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEEXT) size$(EXEEXT) \
1210 strip$(EXEEXT) ld$(EXEEXT) elflint$(EXEEXT) \
1211 findtextrel$(EXEEXT) addr2line$(EXEEXT) elfcmp$(EXEEXT) \
1212@@ -49,9 +50,9 @@ bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEE
1213 @NATIVE_LD_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
1214 # We never build this library but we need to get the dependency files
1215 # of all the linker backends that might be used in a non-generic linker.
1216-@NEVER_TRUE@am__append_2 = libdummy.a
1217+@NEVER_TRUE@am__append_3 = libdummy.a
1218 # -ldl is always needed for libebl.
1219-@NATIVE_LD_TRUE@am__append_3 = libld_elf.a
1220+@NATIVE_LD_TRUE@am__append_4 = libld_elf.a
1221 @NATIVE_LD_TRUE@am_libld_elf_i386_pic_a_OBJECTS =
1222 subdir = src
1223 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1224@@ -115,7 +116,7 @@ am_ld_OBJECTS = ld.$(OBJEXT) ldgeneric.$
1225 versionhash.$(OBJEXT)
1226 ld_OBJECTS = $(am_ld_OBJECTS)
1227 ld_DEPENDENCIES = $(libebl) $(libelf) $(libeu) $(am__DEPENDENCIES_1) \
1228- $(am__append_3)
1229+ $(am__append_4)
1230 ld_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ld_LDFLAGS) $(LDFLAGS) -o \
1231 $@
1232 am_libld_elf_i386_so_OBJECTS =
1233@@ -235,6 +236,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
1234 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1235 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1236 LDFLAGS = @LDFLAGS@
1237+LD_AS_NEEDED = @LD_AS_NEEDED@
1238 LEX = @LEX@
1239 LEXLIB = @LEXLIB@
1240 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1241@@ -264,6 +266,7 @@ SHELL = @SHELL@
1242 STRIP = @STRIP@
1243 USE_NLS = @USE_NLS@
1244 VERSION = @VERSION@
1245+WEXTRA = @WEXTRA@
1246 XGETTEXT = @XGETTEXT@
1247 XGETTEXT_015 = @XGETTEXT_015@
1248 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1249@@ -327,10 +330,9 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
1250 -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
1251 -I$(srcdir)/../libasm
1252 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1253- $($(*F)_no_Werror),,-Werror) $(if \
1254- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1255+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1256 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1257- $(am__append_1)
1258+ $(am__append_1) $(am__append_2)
1259 @MUDFLAP_FALSE@libmudflap =
1260 @MUDFLAP_TRUE@libmudflap = -lmudflap
1261 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
1262@@ -346,8 +348,8 @@ AM_LFLAGS = -Pld -olex.yy.c
1263 native_ld = @native_ld@
1264 ld_dsos = libld_elf_i386_pic.a
1265 @NATIVE_LD_FALSE@noinst_LIBRARIES = libld_elf.a libar.a $(ld_dsos) \
1266-@NATIVE_LD_FALSE@ $(am__append_2)
1267-@NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a libar.a $(am__append_2)
1268+@NATIVE_LD_FALSE@ $(am__append_3)
1269+@NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a libar.a $(am__append_3)
1270 @NATIVE_LD_TRUE@native_ld_cflags = -DBASE_ELF_NAME=elf_$(base_cpu)
1271 @NEVER_TRUE@libdummy_a_SOURCES = i386_ld.c
1272 ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \
1273@@ -376,6 +378,9 @@ strings_no_Wformat = yes
1274 addr2line_no_Wformat = yes
1275 # XXX While the file is not finished, don't warn about this
1276 ldgeneric_no_Wunused = yes
1277+
1278+# Buggy old compilers.
1279+readelf_no_Werror = yes
1280 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1281 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
1282 $(demanglelib)
1283@@ -383,7 +388,7 @@ nm_LDADD = $(libdw) $(libebl) $(libelf)
1284 size_LDADD = $(libelf) $(libeu) $(libmudflap)
1285 strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1286 ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
1287- $(am__append_3)
1288+ $(am__append_4)
1289 ld_LDFLAGS = -rdynamic
1290 elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1291 findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap)
1292Index: elfutils-0.155/src/readelf.c
1293===================================================================
1294--- elfutils-0.155.orig/src/readelf.c
1295+++ elfutils-0.155/src/readelf.c
1296@@ -3949,10 +3949,11 @@ struct listptr
1297 #define listptr_offset_size(p) ((p)->dwarf64 ? 8 : 4)
1298 #define listptr_address_size(p) ((p)->addr64 ? 8 : 4)
1299
1300+static const char *listptr_name;
1301 static int
1302-compare_listptr (const void *a, const void *b, void *arg)
1303+compare_listptr (const void *a, const void *b)
1304 {
1305- const char *name = arg;
1306+ const char *const name = listptr_name;
1307 struct listptr *p1 = (void *) a;
1308 struct listptr *p2 = (void *) b;
1309
1310@@ -4033,8 +4034,11 @@ static void
1311 sort_listptr (struct listptr_table *table, const char *name)
1312 {
1313 if (table->n > 0)
1314- qsort_r (table->table, table->n, sizeof table->table[0],
1315- &compare_listptr, (void *) name);
1316+ {
1317+ listptr_name = name;
1318+ qsort (table->table, table->n, sizeof table->table[0],
1319+ &compare_listptr);
1320+ }
1321 }
1322
1323 static bool
1324@@ -8442,7 +8446,7 @@ dump_archive_index (Elf *elf, const char
1325 if (unlikely (elf_rand (elf, as_off) == 0)
1326 || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
1327 == NULL))
1328-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
1329+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
1330 while (1)
1331 #endif
1332 error (EXIT_FAILURE, 0,
1333Index: elfutils-0.155/src/strings.c
1334===================================================================
1335--- elfutils-0.155.orig/src/strings.c
1336+++ elfutils-0.155/src/strings.c
1337@@ -43,6 +43,10 @@
1338
1339 #include <system.h>
1340
1341+#ifndef MAP_POPULATE
1342+# define MAP_POPULATE 0
1343+#endif
1344+
1345
1346 /* Prototypes of local functions. */
1347 static int read_fd (int fd, const char *fname, off64_t fdlen);
1348@@ -483,8 +487,13 @@ map_file (int fd, off64_t start_off, off
1349 fd, start_off);
1350 if (mem != MAP_FAILED)
1351 {
1352+#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
1353+# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
1354+#endif
1355+#ifdef POSIX_MADV_SEQUENTIAL
1356 /* We will go through the mapping sequentially. */
1357 (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
1358+#endif
1359 break;
1360 }
1361 if (errno != EINVAL && errno != ENOMEM)
1362@@ -576,9 +585,11 @@ read_block (int fd, const char *fname, o
1363 elfmap_off = from & ~(ps - 1);
1364 elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
1365
1366+#ifdef POSIX_FADV_SEQUENTIAL
1367 if (unlikely (elfmap == MAP_FAILED))
1368 /* Let the kernel know we are going to read everything in sequence. */
1369 (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
1370+#endif
1371 }
1372
1373 if (unlikely (elfmap == MAP_FAILED))
1374Index: elfutils-0.155/src/strip.c
1375===================================================================
1376--- elfutils-0.155.orig/src/strip.c
1377+++ elfutils-0.155/src/strip.c
1378@@ -45,6 +45,12 @@
1379 #include <libebl.h>
1380 #include <system.h>
1381
1382+#ifdef HAVE_FUTIMES
1383+# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
1384+#else
1385+# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
1386+#endif
1387+
1388 typedef uint8_t GElf_Byte;
1389
1390 /* Name and version of program. */
1391@@ -318,8 +324,18 @@ process_file (const char *fname)
1392
1393 /* If we have to preserve the timestamp, we need it in the
1394 format utimes() understands. */
1395+#ifdef HAVE_STRUCT_STAT_ST_ATIM
1396 TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
1397+#else
1398+ tv[0].tv_sec = pre_st.st_atime;
1399+ tv[0].tv_usec = 0;
1400+#endif
1401+#ifdef HAVE_STRUCT_STAT_ST_MTIM
1402 TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
1403+#else
1404+ tv[1].tv_sec = pre_st.st_atime;
1405+ tv[1].tv_usec = 0;
1406+#endif
1407 }
1408
1409 /* Open the file. */
1410@@ -2055,7 +2071,7 @@ while computing checksum for debug infor
1411 /* If requested, preserve the timestamp. */
1412 if (tvp != NULL)
1413 {
1414- if (futimes (fd, tvp) != 0)
1415+ if (FUTIMES (fd, output_fname, tvp) != 0)
1416 {
1417 error (0, errno, gettext ("\
1418 cannot set access and modification date of '%s'"),
1419@@ -2112,7 +2128,7 @@ handle_ar (int fd, Elf *elf, const char
1420
1421 if (tvp != NULL)
1422 {
1423- if (unlikely (futimes (fd, tvp) != 0))
1424+ if (unlikely (FUTIMES (fd, fname, tvp) != 0))
1425 {
1426 error (0, errno, gettext ("\
1427 cannot set access and modification date of '%s'"), fname);
1428Index: elfutils-0.155/tests/ChangeLog
1429===================================================================
1430--- elfutils-0.155.orig/tests/ChangeLog
1431+++ elfutils-0.155/tests/ChangeLog
1432@@ -439,6 +439,8 @@
1433
1434 2008-01-21 Roland McGrath <roland@redhat.com>
1435
1436+ * line2addr.c (main): Revert last change.
1437+
1438 * testfile45.S.bz2: Add tests for cltq, cqto.
1439 * testfile45.expect.bz2: Adjust.
1440
1441@@ -1147,6 +1149,11 @@
1442 * Makefile.am (TESTS): Add run-elflint-test.sh.
1443 (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
1444
1445+2005-05-31 Roland McGrath <roland@redhat.com>
1446+
1447+ * Makefile.am (WEXTRA): New variable, substituted by configure.
1448+ (AM_CFLAGS): Use it in place of -Wextra.
1449+
1450 2005-05-24 Ulrich Drepper <drepper@redhat.com>
1451
1452 * get-files.c (main): Use correct format specifier.
1453Index: elfutils-0.155/tests/line2addr.c
1454===================================================================
1455--- elfutils-0.155.orig/tests/line2addr.c
1456+++ elfutils-0.155/tests/line2addr.c
1457@@ -124,7 +124,7 @@ main (int argc, char *argv[])
1458 {
1459 struct args a = { .arg = argv[cnt] };
1460
1461- switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
1462+ switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
1463 {
1464 default:
1465 case 0:
1466Index: elfutils-0.155/tests/Makefile.in
1467===================================================================
1468--- elfutils-0.155.orig/tests/Makefile.in
1469+++ elfutils-0.155/tests/Makefile.in
1470@@ -35,14 +35,15 @@ build_triplet = @build@
1471 host_triplet = @host@
1472 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
1473 $(top_srcdir)/config/eu.am ChangeLog
1474-@MUDFLAP_TRUE@am__append_1 = -fmudflap
1475-@STANDALONE_FALSE@am__append_2 = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
1476+@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,-Werror)
1477+@MUDFLAP_TRUE@am__append_2 = -fmudflap
1478+@STANDALONE_FALSE@am__append_3 = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
1479 @STANDALONE_FALSE@ -I$(top_srcdir)/libdwfl \
1480 @STANDALONE_FALSE@ -I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
1481 @STANDALONE_FALSE@ -I$(top_srcdir)/lib -I..
1482
1483-@STANDALONE_FALSE@am__append_3 = -Wl,-rpath-link,../libasm:../libdw:../libelf
1484-@TESTS_RPATH_TRUE@am__append_4 = -Wl,-rpath,$(BUILD_RPATH)
1485+@STANDALONE_FALSE@am__append_4 = -Wl,-rpath-link,../libasm:../libdw:../libelf
1486+@TESTS_RPATH_TRUE@am__append_5 = -Wl,-rpath,$(BUILD_RPATH)
1487 check_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \
1488 newfile$(EXEEXT) saridx$(EXEEXT) scnnames$(EXEEXT) \
1489 sectiondump$(EXEEXT) showptable$(EXEEXT) update1$(EXEEXT) \
1490@@ -92,12 +93,12 @@ TESTS = run-arextract.sh run-arsymtest.s
1491 run-readelf-gdb_index.sh run-unstrip-n.sh run-low_high_pc.sh \
1492 run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \
1493 run-test-archive64.sh $(am__EXEEXT_1) $(am__EXEEXT_3) \
1494- $(am__append_9)
1495-@STANDALONE_FALSE@am__append_5 = msg_tst md5-sha1-test
1496+ $(am__append_10)
1497 @STANDALONE_FALSE@am__append_6 = msg_tst md5-sha1-test
1498-@HAVE_LIBASM_TRUE@am__append_7 = $(asm_TESTS)
1499+@STANDALONE_FALSE@am__append_7 = msg_tst md5-sha1-test
1500 @HAVE_LIBASM_TRUE@am__append_8 = $(asm_TESTS)
1501-@ENABLE_DWZ_TRUE@am__append_9 = run-readelf-dwz-multi.sh
1502+@HAVE_LIBASM_TRUE@am__append_9 = $(asm_TESTS)
1503+@ENABLE_DWZ_TRUE@am__append_10 = run-readelf-dwz-multi.sh
1504 subdir = tests
1505 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1506 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
1507@@ -412,6 +413,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
1508 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1509 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1510 LDFLAGS = @LDFLAGS@
1511+LD_AS_NEEDED = @LD_AS_NEEDED@
1512 LEX = @LEX@
1513 LEXLIB = @LEXLIB@
1514 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1515@@ -441,6 +443,7 @@ SHELL = @SHELL@
1516 STRIP = @STRIP@
1517 USE_NLS = @USE_NLS@
1518 VERSION = @VERSION@
1519+WEXTRA = @WEXTRA@
1520 XGETTEXT = @XGETTEXT@
1521 XGETTEXT_015 = @XGETTEXT_015@
1522 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1523@@ -499,12 +502,11 @@ top_build_prefix = @top_build_prefix@
1524 top_builddir = @top_builddir@
1525 top_srcdir = @top_srcdir@
1526 zip_LIBS = @zip_LIBS@
1527-INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_2)
1528+INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_3)
1529 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1530- $($(*F)_no_Werror),,-Werror) $(if \
1531- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1532+ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1533 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1534- $(am__append_1)
1535+ $(am__append_1) $(am__append_2)
1536 @MUDFLAP_FALSE@libmudflap =
1537 @MUDFLAP_TRUE@libmudflap = -lmudflap
1538 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
1539@@ -514,7 +516,7 @@ CLEANFILES = *.gcno *.gcda
1540 textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
1541 @MUDFLAP_FALSE@BUILD_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
1542 @MUDFLAP_TRUE@BUILD_RPATH = \$$ORIGIN/../backends
1543-AM_LDFLAGS = $(am__append_3) $(am__append_4)
1544+AM_LDFLAGS = $(am__append_4) $(am__append_5)
1545 @TESTS_RPATH_FALSE@tests_rpath = no
1546 @TESTS_RPATH_TRUE@tests_rpath = yes
1547 asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \