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