patches/binutils-2.23.2-musl.diff: factor out texinfo part
[rofl0r-mmix-cross.git] / patches / elfutils-0.154-musl.diff
blobffbd905d1c578487d50c36cbe3624e695daa2c5c
1 diff --git a/ChangeLog b/ChangeLog
2 --- a/ChangeLog
3 +++ b/ChangeLog
4 @@ -4,6 +4,8 @@
6 2012-01-24 Mark Wielaard <mjw@redhat.com>
8 + * configure.ac: Wrap AC_COMPILE_IFELSE sources in AC_LANG_SOURCE.
10 * COPYING: Fix address. Updated version from gnulib.
12 2012-01-23 Mark Wielaard <mjw@redhat.com>
13 @@ -22,6 +24,9 @@
15 2011-10-08 Mike Frysinger <vapier@gentoo.org>
17 + * configure.ac (--disable-werror): Handle it, controlling BUILD_WERROR
18 + automake option.
20 * configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly.
22 2011-10-02 Ulrich Drepper <drepper@gmail.com>
23 @@ -43,6 +48,10 @@
25 * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
27 +2009-11-22 Roland McGrath <roland@redhat.com>
29 + * configure.ac: Use sed and expr instead of modern bash extensions.
31 2009-09-21 Ulrich Drepper <drepper@redhat.com>
33 * configure.ac: Update for more modern autoconf.
34 @@ -51,6 +60,10 @@
36 * configure.ac (zip_LIBS): Check for liblzma too.
38 +2009-08-17 Roland McGrath <roland@redhat.com>
40 + * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
42 2009-04-19 Roland McGrath <roland@redhat.com>
44 * configure.ac (eu_version): Round down here, not in version.h macros.
45 @@ -62,6 +75,8 @@
47 2009-01-23 Roland McGrath <roland@redhat.com>
49 + * configure.ac: Check for __builtin_popcount.
51 * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
53 * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
54 @@ -142,6 +157,10 @@
55 * configure.ac: Add dummy automake conditional to get dependencies
56 for non-generic linker right. See src/Makefile.am.
58 +2005-11-22 Roland McGrath <roland@redhat.com>
60 + * configure.ac: Check for --as-needed linker option.
62 2005-11-18 Roland McGrath <roland@redhat.com>
64 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
65 @@ -189,6 +208,17 @@
66 * Makefile.am (all_SUBDIRS): Add libdwfl.
67 * configure.ac: Write libdwfl/Makefile.
69 +2005-05-31 Roland McGrath <roland@redhat.com>
71 + * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
73 + * configure.ac: Check for struct stat st_?tim members.
74 + * src/strip.c (process_file): Use st_?time if st_?tim are not there.
76 + * configure.ac: Check for futimes function.
77 + * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
78 + (handle_ar) [! HAVE_FUTIMES]: Likewise.
80 2005-05-19 Roland McGrath <roland@redhat.com>
82 * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
83 diff --git a/Makefile.in b/Makefile.in
84 --- a/Makefile.in
85 +++ b/Makefile.in
86 @@ -155,6 +155,7 @@
87 INSTALL_SCRIPT = @INSTALL_SCRIPT@
88 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
89 LDFLAGS = @LDFLAGS@
90 +LD_AS_NEEDED = @LD_AS_NEEDED@
91 LEX = @LEX@
92 LEXLIB = @LEXLIB@
93 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
94 @@ -184,6 +185,7 @@
95 STRIP = @STRIP@
96 USE_NLS = @USE_NLS@
97 VERSION = @VERSION@
98 +WEXTRA = @WEXTRA@
99 XGETTEXT = @XGETTEXT@
100 XGETTEXT_015 = @XGETTEXT_015@
101 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
102 diff --git a/backends/ChangeLog b/backends/ChangeLog
103 --- a/backends/ChangeLog
104 +++ b/backends/ChangeLog
105 @@ -121,6 +121,10 @@
106 * ppc_attrs.c (ppc_check_object_attribute): Handle tag
107 GNU_Power_ABI_Struct_Return.
109 +2009-01-23 Roland McGrath <roland@redhat.com>
111 + * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
113 2008-10-04 Ulrich Drepper <drepper@redhat.com>
115 * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
116 @@ -448,6 +452,11 @@
117 * sparc_init.c: Likewise.
118 * x86_64_init.c: Likewise.
120 +2005-11-22 Roland McGrath <roland@redhat.com>
122 + * Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
123 + (libebl_%.so rule): Use it in place of -Wl,--as-needed.
125 2005-11-19 Roland McGrath <roland@redhat.com>
127 * ppc64_reloc.def: REL30 -> ADDR30.
128 @@ -470,6 +479,9 @@
129 * Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
130 (CLEANFILES): Add libebl_$(m).so.
132 + * Makefile.am (WEXTRA): New variable, substituted by configure.
133 + (AM_CFLAGS): Use it in place of -Wextra.
135 * ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
136 * ppc64_reloc.def: Likewise.
138 diff --git a/backends/Makefile.am b/backends/Makefile.am
139 --- a/backends/Makefile.am
140 +++ b/backends/Makefile.am
141 @@ -105,7 +105,7 @@
142 $(LINK) -shared -o $(@:.map=.so) \
143 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
144 -Wl,--version-script,$(@:.so=.map) \
145 - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
146 + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
147 $(textrel_check)
149 libebl_i386.so: $(cpu_i386)
150 diff --git a/backends/Makefile.in b/backends/Makefile.in
151 --- a/backends/Makefile.in
152 +++ b/backends/Makefile.in
153 @@ -38,7 +38,8 @@
154 host_triplet = @host@
155 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
156 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog
157 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
158 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
159 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
160 subdir = backends
161 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
162 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
163 @@ -165,6 +166,7 @@
164 INSTALL_SCRIPT = @INSTALL_SCRIPT@
165 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
166 LDFLAGS = @LDFLAGS@
167 +LD_AS_NEEDED = @LD_AS_NEEDED@
168 LEX = @LEX@
169 LEXLIB = @LEXLIB@
170 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
171 @@ -194,6 +196,7 @@
172 STRIP = @STRIP@
173 USE_NLS = @USE_NLS@
174 VERSION = @VERSION@
175 +WEXTRA = @WEXTRA@
176 XGETTEXT = @XGETTEXT@
177 XGETTEXT_015 = @XGETTEXT_015@
178 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
179 @@ -256,10 +259,9 @@
180 -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
181 -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
182 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
183 - $($(*F)_no_Werror),,-Werror) $(if \
184 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
185 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
186 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
187 - $(am__append_1)
188 + $(am__append_1) $(am__append_2)
189 @MUDFLAP_FALSE@libmudflap =
190 @MUDFLAP_TRUE@libmudflap = -lmudflap
191 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
192 @@ -267,7 +269,7 @@
194 CLEANFILES = *.gcno *.gcda $(foreach m,$(modules), libebl_$(m).map \
195 libebl_$(m).so $(am_libebl_$(m)_pic_a_OBJECTS))
196 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
197 +textrel_check =
198 modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390
199 libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
200 libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
201 @@ -698,7 +700,7 @@
202 $(LINK) -shared -o $(@:.map=.so) \
203 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
204 -Wl,--version-script,$(@:.so=.map) \
205 - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
206 + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
207 $(textrel_check)
209 libebl_i386.so: $(cpu_i386)
210 diff --git a/config.h.in b/config.h.in
211 --- a/config.h.in
212 +++ b/config.h.in
213 @@ -3,6 +3,9 @@
214 /* Should ar and ranlib use -D behavior by default? */
215 #undef DEFAULT_AR_DETERMINISTIC
217 +/* Have __builtin_popcount. */
218 +#undef HAVE_BUILTIN_POPCOUNT
220 /* $libdir subdirectory containing libebl modules. */
221 #undef LIBEBL_SUBDIR
223 @@ -61,4 +64,7 @@
224 /* Define for large files, on AIX-style hosts. */
225 #undef _LARGE_FILES
227 +/* Stubbed out if missing compiler support. */
228 +#undef __thread
230 #include <eu-config.h>
231 diff --git a/config/ChangeLog b/config/ChangeLog
232 --- a/config/ChangeLog
233 +++ b/config/ChangeLog
234 @@ -10,6 +10,10 @@
236 * known-dwarf.awk: Use gawk.
238 +2011-10-08 Mike Frysinger <vapier@gentoo.org>
240 + * eu.am [BUILD_WERROR]: Conditionalize -Werror use on this.
242 2010-07-02 Ulrich Drepper <drepper@redhat.com>
244 * elfutils.spec.in: Add more BuildRequires.
245 diff --git a/config/Makefile.in b/config/Makefile.in
246 --- a/config/Makefile.in
247 +++ b/config/Makefile.in
248 @@ -76,6 +76,7 @@
249 INSTALL_SCRIPT = @INSTALL_SCRIPT@
250 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
251 LDFLAGS = @LDFLAGS@
252 +LD_AS_NEEDED = @LD_AS_NEEDED@
253 LEX = @LEX@
254 LEXLIB = @LEXLIB@
255 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
256 @@ -105,6 +106,7 @@
257 STRIP = @STRIP@
258 USE_NLS = @USE_NLS@
259 VERSION = @VERSION@
260 +WEXTRA = @WEXTRA@
261 XGETTEXT = @XGETTEXT@
262 XGETTEXT_015 = @XGETTEXT_015@
263 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
264 diff --git a/config/eu.am b/config/eu.am
265 --- a/config/eu.am
266 +++ b/config/eu.am
267 @@ -1,6 +1,6 @@
268 ## Common automake fragments for elfutils subdirectory makefiles.
270 -## Copyright (C) 2010 Red Hat, Inc.
271 +## Copyright (C) 2010-2011 Red Hat, Inc.
273 ## This file is part of elfutils.
275 @@ -29,14 +29,20 @@
276 ## not, see <http://www.gnu.org/licenses/>.
279 +WEXTRA = @WEXTRA@
280 +LD_AS_NEEDED = @LD_AS_NEEDED@
282 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
283 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
284 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
285 - $(if $($(*F)_no_Werror),,-Werror) \
286 - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
287 + $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
288 $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
289 $($(*F)_CFLAGS)
291 +if BUILD_WERROR
292 +AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror)
293 +endif
295 if MUDFLAP
296 AM_CFLAGS += -fmudflap
297 libmudflap = -lmudflap
298 diff --git a/configure b/configure
299 --- a/configure
300 +++ b/configure
301 @@ -598,6 +598,8 @@
302 LIBEBL_SUBDIR
303 TESTS_RPATH_FALSE
304 TESTS_RPATH_TRUE
305 +BUILD_WERROR_FALSE
306 +BUILD_WERROR_TRUE
307 BUILD_STATIC_FALSE
308 BUILD_STATIC_TRUE
309 GCOV_FALSE
310 @@ -612,6 +614,8 @@
311 base_cpu
312 NATIVE_LD_FALSE
313 NATIVE_LD_TRUE
314 +LD_AS_NEEDED
315 +WEXTRA
316 LEXLIB
317 LEX_OUTPUT_ROOT
319 @@ -722,6 +726,7 @@
320 enable_debugpred
321 enable_gprof
322 enable_gcov
323 +enable_werror
324 enable_tests_rpath
325 enable_libebl_subdir
326 with_zlib
327 @@ -1373,6 +1378,7 @@
328 prediction
329 --enable-gprof build binaries with gprof support
330 --enable-gcov build binaries with gcov support
331 + --disable-werror do not build with -Werror
332 --enable-tests-rpath build $ORIGIN-using rpath into tests
333 --enable-libebl-subdir=DIR
334 install libebl_CPU modules in $(libdir)/DIR
335 @@ -3890,6 +3896,130 @@
336 as_fn_error $? "gcc with C99 support required" "$LINENO" 5
339 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra option to $CC" >&5
340 +$as_echo_n "checking for -Wextra option to $CC... " >&6; }
341 +if ${ac_cv_cc_wextra+:} false; then :
342 + $as_echo_n "(cached) " >&6
343 +else
344 + old_CFLAGS="$CFLAGS"
345 +CFLAGS="$CFLAGS -Wextra"
346 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
347 +/* end confdefs.h. */
348 +void foo (void) { }
349 +_ACEOF
350 +if ac_fn_c_try_compile "$LINENO"; then :
351 + ac_cv_cc_wextra=yes
352 +else
353 + ac_cv_cc_wextra=no
355 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
356 +CFLAGS="$old_CFLAGS"
358 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_wextra" >&5
359 +$as_echo "$ac_cv_cc_wextra" >&6; }
361 +if test "x$ac_cv_cc_wextra" = xyes; then :
362 + WEXTRA=-Wextra
363 +else
364 + WEXTRA=-W
367 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fgnu89-inline option to $CC" >&5
368 +$as_echo_n "checking for -fgnu89-inline option to $CC... " >&6; }
369 +if ${ac_cv_cc_gnu89_inline+:} false; then :
370 + $as_echo_n "(cached) " >&6
371 +else
372 + old_CFLAGS="$CFLAGS"
373 +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
374 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
375 +/* end confdefs.h. */
377 +void foo (void)
379 + inline void bar (void) {}
380 + bar ();
382 +extern inline void baz (void) {}
384 +_ACEOF
385 +if ac_fn_c_try_compile "$LINENO"; then :
386 + ac_cv_cc_gnu89_inline=yes
387 +else
388 + ac_cv_cc_gnu89_inline=no
390 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
391 +CFLAGS="$old_CFLAGS"
393 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_gnu89_inline" >&5
394 +$as_echo "$ac_cv_cc_gnu89_inline" >&6; }
395 +if test "x$ac_cv_cc_gnu89_inline" = xyes; then :
396 + WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"
399 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --as-needed linker option" >&5
400 +$as_echo_n "checking for --as-needed linker option... " >&6; }
401 +if ${ac_cv_as_needed+:} false; then :
402 + $as_echo_n "(cached) " >&6
403 +else
404 + cat > conftest.c <<EOF
405 +int main (void) { return 0; }
406 +EOF
407 +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
408 + -fPIC -shared -o conftest.so conftest.c
409 + -Wl,--as-needed 1>&5'
410 + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
411 + (eval $ac_try) 2>&5
412 + ac_status=$?
413 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
414 + test $ac_status = 0; }; }
415 +then
416 + ac_cv_as_needed=yes
417 +else
418 + ac_cv_as_needed=no
420 +rm -f conftest*
422 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_as_needed" >&5
423 +$as_echo "$ac_cv_as_needed" >&6; }
424 +if test "x$ac_cv_as_needed" = xyes; then :
425 + LD_AS_NEEDED=-Wl,--as-needed
426 +else
427 + LD_AS_NEEDED=
431 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5
432 +$as_echo_n "checking for __builtin_popcount... " >&6; }
433 +if ${ac_cv_popcount+:} false; then :
434 + $as_echo_n "(cached) " >&6
435 +else
436 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
437 +/* end confdefs.h. */
439 +int
440 +main ()
442 +exit (__builtin_popcount (127));
444 + return 0;
446 +_ACEOF
447 +if ac_fn_c_try_link "$LINENO"; then :
448 + ac_cv_popcount=yes
449 +else
450 + ac_cv_popcount=no
452 +rm -f core conftest.err conftest.$ac_objext \
453 + conftest$ac_exeext conftest.$ac_ext
455 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_popcount" >&5
456 +$as_echo "$ac_cv_popcount" >&6; }
457 +if test "x$ac_cv_popcount" = xyes; then :
459 +$as_echo "#define HAVE_BUILTIN_POPCOUNT 1" >>confdefs.h
463 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __thread support" >&5
464 $as_echo_n "checking for __thread support... " >&6; }
465 if ${ac_cv_tls+:} false; then :
466 @@ -3926,7 +4056,13 @@
467 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
468 $as_echo "$ac_cv_tls" >&6; }
469 if test "x$ac_cv_tls" != xyes; then :
470 - as_fn_error $? "__thread support required" "$LINENO" 5
471 + if test "$use_locks" = yes; then :
472 + as_fn_error $? "--enable-thread-safety requires __thread support" "$LINENO" 5
473 +else
475 +$as_echo "#define __thread /* empty: no multi-thread support */" >>confdefs.h
480 # Check whether --enable-largefile was given.
481 @@ -4275,6 +4411,22 @@
485 +# Check whether --enable-werror was given.
486 +if test "${enable_werror+set}" = set; then :
487 + enableval=$enable_werror; enable_werror=$enableval
488 +else
489 + enable_werror=yes
492 + if test "$enable_werror" = yes; then
493 + BUILD_WERROR_TRUE=
494 + BUILD_WERROR_FALSE='#'
495 +else
496 + BUILD_WERROR_TRUE='#'
497 + BUILD_WERROR_FALSE=
501 # Check whether --enable-tests-rpath was given.
502 if test "${enable_tests_rpath+set}" = set; then :
503 enableval=$enable_tests_rpath; tests_use_rpath=$enableval
504 @@ -4995,7 +5147,7 @@
505 esac
507 # Round up to the next release API (x.y) version.
508 -eu_version=$(( (eu_version + 999) / 1000 ))
509 +eu_version=`expr \( $eu_version + 999 \) / 1000`
511 cat >confcache <<\_ACEOF
512 # This file is a shell script that caches the results of configure
513 @@ -5154,6 +5306,10 @@
514 as_fn_error $? "conditional \"BUILD_STATIC\" was never defined.
515 Usually this means the macro was only invoked conditionally." "$LINENO" 5
517 +if test -z "${BUILD_WERROR_TRUE}" && test -z "${BUILD_WERROR_FALSE}"; then
518 + as_fn_error $? "conditional \"BUILD_WERROR\" was never defined.
519 +Usually this means the macro was only invoked conditionally." "$LINENO" 5
521 if test -z "${TESTS_RPATH_TRUE}" && test -z "${TESTS_RPATH_FALSE}"; then
522 as_fn_error $? "conditional \"TESTS_RPATH\" was never defined.
523 Usually this means the macro was only invoked conditionally." "$LINENO" 5
524 diff --git a/configure.ac b/configure.ac
525 --- a/configure.ac
526 +++ b/configure.ac
527 @@ -82,6 +82,54 @@
528 AS_IF([test "x$ac_cv_c99" != xyes],
529 AC_MSG_ERROR([gcc with C99 support required]))
531 +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
532 +old_CFLAGS="$CFLAGS"
533 +CFLAGS="$CFLAGS -Wextra"
534 +AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo (void) { }])],
535 + ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
536 +CFLAGS="$old_CFLAGS"])
537 +AC_SUBST(WEXTRA)
538 +AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
540 +AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
541 +old_CFLAGS="$CFLAGS"
542 +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
543 +AC_COMPILE_IFELSE([AC_LANG_SOURCE([
544 +void foo (void)
546 + inline void bar (void) {}
547 + bar ();
549 +extern inline void baz (void) {}
550 +])], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
551 +CFLAGS="$old_CFLAGS"])
552 +AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
553 + [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
555 +AC_CACHE_CHECK([for --as-needed linker option],
556 + ac_cv_as_needed, [dnl
557 +cat > conftest.c <<EOF
558 +int main (void) { return 0; }
559 +EOF
560 +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
561 + -fPIC -shared -o conftest.so conftest.c
562 + -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
563 +then
564 + ac_cv_as_needed=yes
565 +else
566 + ac_cv_as_needed=no
568 +rm -f conftest*])
569 +AS_IF([test "x$ac_cv_as_needed" = xyes],
570 + [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
571 +AC_SUBST(LD_AS_NEEDED)
573 +AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
574 +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
575 + ac_cv_popcount=yes, ac_cv_popcount=no)])
576 +AS_IF([test "x$ac_cv_popcount" = xyes],
577 + [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
579 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
580 # Use the same flags that we use for our DSOs, so the test is representative.
581 # Some old compiler/linker/libc combinations fail some ways and not others.
582 @@ -97,7 +145,10 @@
583 CFLAGS="$save_CFLAGS"
584 LDFLAGS="$save_LDFLAGS"])
585 AS_IF([test "x$ac_cv_tls" != xyes],
586 - AC_MSG_ERROR([__thread support required]))
587 + [AS_IF([test "$use_locks" = yes],
588 + [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
589 + [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
590 + [Stubbed out if missing compiler support.])])])
592 dnl This test must come as early as possible after the compiler configuration
593 dnl tests, because the choice of the file model can (in principle) affect
594 @@ -185,6 +236,11 @@
595 AM_CONDITIONAL(BUILD_STATIC, [dnl
596 test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes])
598 +AC_ARG_ENABLE([werror],
599 +AS_HELP_STRING([--disable-werror],[do not build with -Werror]),
600 + [enable_werror=$enableval], [enable_werror=yes])
601 +AM_CONDITIONAL(BUILD_WERROR, test "$enable_werror" = yes)
603 AC_ARG_ENABLE([tests-rpath],
604 AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
605 [tests_use_rpath=$enableval], [tests_use_rpath=no])
606 @@ -296,6 +352,6 @@
607 esac
609 # Round up to the next release API (x.y) version.
610 -eu_version=$(( (eu_version + 999) / 1000 ))
611 +eu_version=`expr \( $eu_version + 999 \) / 1000`
613 AC_OUTPUT
614 diff --git a/lib/ChangeLog b/lib/ChangeLog
615 --- a/lib/ChangeLog
616 +++ b/lib/ChangeLog
617 @@ -35,6 +35,9 @@
619 2009-01-23 Roland McGrath <roland@redhat.com>
621 + * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
622 + (__builtin_popcount): New inline function.
624 * eu-config.h: Add multiple inclusion protection.
626 2009-01-17 Ulrich Drepper <drepper@redhat.com>
627 @@ -91,6 +94,11 @@
628 * Makefile.am (libeu_a_SOURCES): Add it.
629 * system.h: Declare crc32_file.
631 +2005-02-07 Roland McGrath <roland@redhat.com>
633 + * Makefile.am (WEXTRA): New variable, substituted by configure.
634 + (AM_CFLAGS): Use it in place of -Wextra.
636 2005-04-30 Ulrich Drepper <drepper@redhat.com>
638 * Makefile.am: Use -ffunction-sections for xmalloc.c.
639 diff --git a/lib/Makefile.in b/lib/Makefile.in
640 --- a/lib/Makefile.in
641 +++ b/lib/Makefile.in
642 @@ -37,7 +37,8 @@
643 host_triplet = @host@
644 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
645 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog
646 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
647 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
648 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
649 subdir = lib
650 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
651 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
652 @@ -100,6 +101,7 @@
653 INSTALL_SCRIPT = @INSTALL_SCRIPT@
654 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
655 LDFLAGS = @LDFLAGS@
656 +LD_AS_NEEDED = @LD_AS_NEEDED@
657 LEX = @LEX@
658 LEXLIB = @LEXLIB@
659 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
660 @@ -129,6 +131,7 @@
661 STRIP = @STRIP@
662 USE_NLS = @USE_NLS@
663 VERSION = @VERSION@
664 +WEXTRA = @WEXTRA@
665 XGETTEXT = @XGETTEXT@
666 XGETTEXT_015 = @XGETTEXT_015@
667 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
668 @@ -190,17 +193,16 @@
669 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
670 -I$(srcdir)/../libelf
671 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
672 - $($(*F)_no_Werror),,-Werror) $(if \
673 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
674 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
675 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
676 - $(am__append_1) -fpic
677 + $(am__append_1) $(am__append_2) -fpic
678 @MUDFLAP_FALSE@libmudflap =
679 @MUDFLAP_TRUE@libmudflap = -lmudflap
680 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
681 $(COMPILE))
683 CLEANFILES = *.gcno *.gcda
684 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
685 +textrel_check =
686 noinst_LIBRARIES = libeu.a
687 libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
688 crc32.c crc32_file.c md5.c sha1.c \
689 diff --git a/lib/eu-config.h b/lib/eu-config.h
690 --- a/lib/eu-config.h
691 +++ b/lib/eu-config.h
692 @@ -162,6 +162,17 @@
693 /* This macro is used by the tests conditionalize for standalone building. */
694 #define ELFUTILS_HEADER(name) <lib##name.h>
696 +#ifndef HAVE_BUILTIN_POPCOUNT
697 +# define __builtin_popcount hakmem_popcount
698 +static inline unsigned int __attribute__ ((unused))
699 +hakmem_popcount (unsigned int x)
701 + /* HAKMEM 169 */
702 + unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
703 + return ((n + (n >> 3)) & 030707070707) % 63;
705 +#endif /* HAVE_BUILTIN_POPCOUNT */
708 #ifdef SHARED
709 # define OLD_VERSION(name, version) \
710 diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
711 --- a/lib/fixedsizehash.h
712 +++ b/lib/fixedsizehash.h
713 @@ -30,7 +30,6 @@
714 #include <errno.h>
715 #include <stdlib.h>
716 #include <string.h>
717 -#include <sys/cdefs.h>
718 #include <sys/param.h>
720 #include <system.h>
721 diff --git a/lib/system.h b/lib/system.h
722 --- a/lib/system.h
723 +++ b/lib/system.h
724 @@ -32,6 +32,8 @@
725 #include <argp.h>
726 #include <stddef.h>
727 #include <stdint.h>
728 +#define TEMP_FAILURE_RETRY(x) x
729 +#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
730 #include <endian.h>
731 #include <byteswap.h>
733 diff --git a/libasm/ChangeLog b/libasm/ChangeLog
734 --- a/libasm/ChangeLog
735 +++ b/libasm/ChangeLog
736 @@ -71,6 +71,11 @@
737 * asm_error.c: Add new error ASM_E_IOERROR.
738 * libasmP.h: Add ASM_E_IOERROR definition.
740 +2005-05-31 Roland McGrath <roland@redhat.com>
742 + * Makefile.am (WEXTRA): New variable, substituted by configure.
743 + (AM_CFLAGS): Use it in place of -Wextra.
745 2005-02-15 Ulrich Drepper <drepper@redhat.com>
747 * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
748 diff --git a/libasm/Makefile.in b/libasm/Makefile.in
749 --- a/libasm/Makefile.in
750 +++ b/libasm/Makefile.in
751 @@ -39,10 +39,11 @@
752 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
753 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
754 $(top_srcdir)/config/eu.am ChangeLog
755 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
756 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
757 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
758 @MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
759 @MUDFLAP_TRUE@am_libasm_pic_a_OBJECTS =
760 -@MUDFLAP_FALSE@@USE_LOCKS_TRUE@am__append_2 = -lpthread
761 +@MUDFLAP_FALSE@@USE_LOCKS_TRUE@am__append_3 = -lpthread
762 subdir = libasm
763 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
764 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
765 @@ -147,6 +148,7 @@
766 INSTALL_SCRIPT = @INSTALL_SCRIPT@
767 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
768 LDFLAGS = @LDFLAGS@
769 +LD_AS_NEEDED = @LD_AS_NEEDED@
770 LEX = @LEX@
771 LEXLIB = @LEXLIB@
772 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
773 @@ -176,6 +178,7 @@
774 STRIP = @STRIP@
775 USE_NLS = @USE_NLS@
776 VERSION = 1
777 +WEXTRA = @WEXTRA@
778 XGETTEXT = @XGETTEXT@
779 XGETTEXT_015 = @XGETTEXT_015@
780 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
781 @@ -238,10 +241,9 @@
782 -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
783 -I$(top_srcdir)/libdw
784 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
785 - $($(*F)_no_Werror),,-Werror) $(if \
786 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
787 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
788 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
789 - $(am__append_1)
790 + $(am__append_1) $(am__append_2)
791 @MUDFLAP_FALSE@libmudflap =
792 @MUDFLAP_TRUE@libmudflap = -lmudflap
793 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
794 @@ -249,7 +251,7 @@
796 CLEANFILES = *.gcno *.gcda $(am_libasm_pic_a_OBJECTS) \
797 libasm.so.$(VERSION)
798 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
799 +textrel_check =
800 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
801 lib_LIBRARIES = libasm.a
802 @MUDFLAP_FALSE@noinst_LIBRARIES = libasm_pic.a
803 @@ -270,7 +272,7 @@
805 @MUDFLAP_FALSE@libasm_pic_a_SOURCES =
806 @MUDFLAP_FALSE@am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os)
807 -@MUDFLAP_FALSE@libasm_so_LDLIBS = $(am__append_2)
808 +@MUDFLAP_FALSE@libasm_so_LDLIBS = $(am__append_3)
809 @MUDFLAP_FALSE@libasm_so_SOURCES =
810 noinst_HEADERS = libasmP.h symbolhash.h
811 EXTRA_DIST = libasm.map
812 @@ -646,7 +648,7 @@
813 @MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
814 @MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION) \
815 @MUDFLAP_FALSE@ ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
816 -@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
817 +@MUDFLAP_FALSE@
818 @MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION)
820 @MUDFLAP_FALSE@install: install-am libasm.so
821 diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
822 --- a/libcpu/ChangeLog
823 +++ b/libcpu/ChangeLog
824 @@ -34,6 +34,9 @@
826 2009-01-23 Roland McGrath <roland@redhat.com>
828 + * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
829 + compilers that don't realize it's noreturn.
831 * Makefile.am (i386_parse_CFLAGS): Use quotes around command
832 substitution that can produce leading whitespace.
834 @@ -363,6 +366,11 @@
835 * defs/i386.doc: New file.
836 * defs/x86_64: New file.
838 +2005-04-04 Roland McGrath <roland@redhat.com>
840 + * Makefile.am (WEXTRA): New variable, substituted by configure.
841 + (AM_CFLAGS): Use it instead of -Wextra.
843 2005-02-15 Ulrich Drepper <drepper@redhat.com>
845 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
846 diff --git a/libcpu/Makefile.in b/libcpu/Makefile.in
847 --- a/libcpu/Makefile.in
848 +++ b/libcpu/Makefile.in
849 @@ -39,7 +39,8 @@
850 DIST_COMMON = $(am__noinst_HEADERS_DIST) $(srcdir)/Makefile.am \
851 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog \
852 i386_lex.c i386_parse.c
853 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
854 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
855 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
856 @MAINTAINER_MODE_TRUE@noinst_PROGRAMS = i386_gendis$(EXEEXT)
857 subdir = libcpu
858 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
859 @@ -117,6 +118,7 @@
860 INSTALL_SCRIPT = @INSTALL_SCRIPT@
861 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
862 LDFLAGS = @LDFLAGS@
863 +LD_AS_NEEDED = @LD_AS_NEEDED@
864 LEX = @LEX@
865 LEXLIB = @LEXLIB@
866 LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
867 @@ -146,6 +148,7 @@
868 STRIP = @STRIP@
869 USE_NLS = @USE_NLS@
870 VERSION = @VERSION@
871 +WEXTRA = @WEXTRA@
872 XGETTEXT = @XGETTEXT@
873 XGETTEXT_015 = @XGETTEXT_015@
874 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
875 @@ -208,10 +211,9 @@
876 -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
877 -I$(srcdir)/../libdw -I$(srcdir)/../libasm
878 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
879 - $($(*F)_no_Werror),,-Werror) $(if \
880 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
881 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
882 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
883 - $(am__append_1) -fpic -fdollars-in-identifiers
884 + $(am__append_1) $(am__append_2) -fpic -fdollars-in-identifiers
885 @MUDFLAP_FALSE@libmudflap =
886 @MUDFLAP_TRUE@libmudflap = -lmudflap
887 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
888 @@ -219,7 +221,7 @@
890 CLEANFILES = *.gcno *.gcda $(foreach P,i386 x86_64,$P_defs \
891 $P.mnemonics)
892 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
893 +textrel_check =
894 LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) -P$(<F:lex.l=)
895 AM_YFLAGS = -p$(<F:parse.y=)
896 noinst_LIBRARIES = libcpu_i386.a libcpu_x86_64.a
897 diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
898 --- a/libcpu/i386_disasm.c
899 +++ b/libcpu/i386_disasm.c
900 @@ -822,6 +822,7 @@
902 default:
903 assert (! "INVALID not handled");
904 + abort ();
907 else
908 diff --git a/libdw/ChangeLog b/libdw/ChangeLog
909 --- a/libdw/ChangeLog
910 +++ b/libdw/ChangeLog
911 @@ -17,6 +17,10 @@
913 * Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
915 +2011-07-20 Mark Wielaard <mjw@redhat.com>
917 + * dwarf_begin_elf.c: Add fallback for be64toh if not defined.
919 2011-07-14 Mark Wielaard <mjw@redhat.com>
921 * libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
922 @@ -376,6 +380,10 @@
924 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
926 +2009-08-17 Roland McGrath <roland@redhat.com>
928 + * libdw.h: Disable extern inlines for GCC 4.2.
930 2009-08-10 Roland McGrath <roland@redhat.com>
932 * dwarf_getscopevar.c: Use dwarf_diename.
933 @@ -1144,6 +1152,11 @@
935 2005-05-31 Roland McGrath <roland@redhat.com>
937 + * Makefile.am (WEXTRA): New variable, substituted by configure.
938 + (AM_CFLAGS): Use it in place of -Wextra.
940 +2005-05-31 Roland McGrath <roland@redhat.com>
942 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
943 formref offset.
945 diff --git a/libdw/Makefile.in b/libdw/Makefile.in
946 --- a/libdw/Makefile.in
947 +++ b/libdw/Makefile.in
948 @@ -39,8 +39,9 @@
949 DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
950 $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
951 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog
952 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
953 -@BUILD_STATIC_TRUE@am__append_2 = -fpic
954 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
955 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
956 +@BUILD_STATIC_TRUE@am__append_3 = -fpic
957 @MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
958 @MUDFLAP_TRUE@am_libdw_pic_a_OBJECTS =
959 subdir = libdw
960 @@ -192,6 +193,7 @@
961 INSTALL_SCRIPT = @INSTALL_SCRIPT@
962 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
963 LDFLAGS = @LDFLAGS@
964 +LD_AS_NEEDED = @LD_AS_NEEDED@
965 LEX = @LEX@
966 LEXLIB = @LEXLIB@
967 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
968 @@ -221,6 +223,7 @@
969 STRIP = @STRIP@
970 USE_NLS = @USE_NLS@
971 VERSION = 1
972 +WEXTRA = @WEXTRA@
973 XGETTEXT = @XGETTEXT@
974 XGETTEXT_015 = @XGETTEXT_015@
975 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
976 @@ -282,17 +285,16 @@
977 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. \
978 -I$(srcdir)/../libelf
979 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
980 - $($(*F)_no_Werror),,-Werror) $(if \
981 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
982 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
983 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
984 - $(am__append_1) $(am__append_2)
985 + $(am__append_1) $(am__append_2) $(am__append_3)
986 @MUDFLAP_FALSE@libmudflap =
987 @MUDFLAP_TRUE@libmudflap = -lmudflap
988 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
989 $(COMPILE))
991 CLEANFILES = *.gcno *.gcda
992 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
993 +textrel_check =
994 lib_LIBRARIES = libdw.a
995 @MUDFLAP_FALSE@noinst_LIBRARIES = libdw_pic.a
996 include_HEADERS = dwarf.h
997 @@ -838,7 +840,7 @@
998 @MUDFLAP_FALSE@ -Wl,--version-script,$<,--no-undefined \
999 @MUDFLAP_FALSE@ -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
1000 @MUDFLAP_FALSE@ -ldl $(zip_LIBS)
1001 -@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
1002 +@MUDFLAP_FALSE@
1003 @MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION)
1005 @MUDFLAP_FALSE@install: install-am libdw.so
1006 diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
1007 --- a/libdw/dwarf_begin_elf.c
1008 +++ b/libdw/dwarf_begin_elf.c
1009 @@ -43,6 +43,14 @@
1010 #if USE_ZLIB
1011 # include <endian.h>
1012 # define crc32 loser_crc32
1013 +# ifndef be64toh
1014 +# include <byteswap.h>
1015 +# if __BYTE_ORDER == __LITTLE_ENDIAN
1016 +# define be64toh(x) bswap_64 (x)
1017 +# else
1018 +# define be64toh(x) (x)
1019 +# endif
1020 +# endif
1021 # include <zlib.h>
1022 # undef crc32
1023 #endif
1024 diff --git a/libdw/libdw.h b/libdw/libdw.h
1025 --- a/libdw/libdw.h
1026 +++ b/libdw/libdw.h
1027 @@ -831,7 +831,7 @@
1030 /* Inline optimizations. */
1031 -#ifdef __OPTIMIZE__
1032 +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
1033 /* Return attribute code of given attribute. */
1034 __libdw_extern_inline unsigned int
1035 dwarf_whatattr (Dwarf_Attribute *attr)
1036 diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
1037 --- a/libdwfl/ChangeLog
1038 +++ b/libdwfl/ChangeLog
1039 @@ -1416,6 +1416,11 @@
1041 2005-07-21 Roland McGrath <roland@redhat.com>
1043 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1044 + (AM_CFLAGS): Use it in place of -Wextra.
1046 +2005-07-21 Roland McGrath <roland@redhat.com>
1048 * Makefile.am (noinst_HEADERS): Add loc2c.c.
1050 * test2.c (main): Check sscanf result to quiet warning.
1051 diff --git a/libdwfl/Makefile.in b/libdwfl/Makefile.in
1052 --- a/libdwfl/Makefile.in
1053 +++ b/libdwfl/Makefile.in
1054 @@ -38,11 +38,12 @@
1055 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
1056 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
1057 $(top_srcdir)/config/eu.am ChangeLog
1058 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
1059 -@MUDFLAP_FALSE@am__append_2 = libdwfl_pic.a
1060 -@ZLIB_TRUE@am__append_3 = gzip.c
1061 -@BZLIB_TRUE@am__append_4 = bzip2.c
1062 -@LZMA_TRUE@am__append_5 = lzma.c
1063 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
1064 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
1065 +@MUDFLAP_FALSE@am__append_3 = libdwfl_pic.a
1066 +@ZLIB_TRUE@am__append_4 = gzip.c
1067 +@BZLIB_TRUE@am__append_5 = bzip2.c
1068 +@LZMA_TRUE@am__append_6 = lzma.c
1069 @MUDFLAP_TRUE@am_libdwfl_pic_a_OBJECTS =
1070 subdir = libdwfl
1071 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1072 @@ -182,6 +183,7 @@
1073 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1074 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1075 LDFLAGS = @LDFLAGS@
1076 +LD_AS_NEEDED = @LD_AS_NEEDED@
1077 LEX = @LEX@
1078 LEXLIB = @LEXLIB@
1079 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1080 @@ -211,6 +213,7 @@
1081 STRIP = @STRIP@
1082 USE_NLS = @USE_NLS@
1083 VERSION = 1
1084 +WEXTRA = @WEXTRA@
1085 XGETTEXT = @XGETTEXT@
1086 XGETTEXT_015 = @XGETTEXT_015@
1087 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1088 @@ -273,18 +276,17 @@
1089 -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
1090 -I$(srcdir)/../libdw
1091 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1092 - $($(*F)_no_Werror),,-Werror) $(if \
1093 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1094 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1095 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1096 - $(am__append_1)
1097 + $(am__append_1) $(am__append_2)
1098 @MUDFLAP_FALSE@libmudflap =
1099 @MUDFLAP_TRUE@libmudflap = -lmudflap
1100 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
1101 $(COMPILE))
1103 CLEANFILES = *.gcno *.gcda $(am_libdwfl_pic_a_OBJECTS)
1104 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
1105 -noinst_LIBRARIES = libdwfl.a $(am__append_2)
1106 +textrel_check =
1107 +noinst_LIBRARIES = libdwfl.a $(am__append_3)
1108 pkginclude_HEADERS = libdwfl.h
1109 libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c \
1110 dwfl_version.c dwfl_module.c dwfl_report_elf.c relocate.c \
1111 @@ -305,8 +307,8 @@
1112 dwfl_module_getsym.c dwfl_module_addrname.c \
1113 dwfl_module_addrsym.c dwfl_module_return_value_location.c \
1114 dwfl_module_register_names.c dwfl_segment_report_module.c \
1115 - link_map.c core-file.c open.c image-header.c $(am__append_3) \
1116 - $(am__append_4) $(am__append_5)
1117 + link_map.c core-file.c open.c image-header.c $(am__append_4) \
1118 + $(am__append_5) $(am__append_6)
1119 @MUDFLAP_FALSE@libdwfl = $(libdw)
1120 @MUDFLAP_TRUE@libdwfl = libdwfl.a $(libdw) $(libebl) $(libelf) $(libeu)
1121 @MUDFLAP_FALSE@libdw = ../libdw/libdw.so
1122 diff --git a/libebl/ChangeLog b/libebl/ChangeLog
1123 --- a/libebl/ChangeLog
1124 +++ b/libebl/ChangeLog
1125 @@ -650,6 +650,11 @@
1126 * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
1127 tracking works right.
1129 +2005-05-31 Roland McGrath <roland@redhat.com>
1131 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1132 + (AM_CFLAGS): Use it in place of -Wextra.
1134 2005-05-21 Ulrich Drepper <drepper@redhat.com>
1136 * libebl_x86_64.map: Add x86_64_core_note.
1137 diff --git a/libebl/Makefile.in b/libebl/Makefile.in
1138 --- a/libebl/Makefile.in
1139 +++ b/libebl/Makefile.in
1140 @@ -38,7 +38,8 @@
1141 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
1142 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
1143 $(top_srcdir)/config/eu.am ChangeLog
1144 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
1145 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
1146 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
1147 subdir = libebl
1148 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1149 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
1150 @@ -144,6 +145,7 @@
1151 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1152 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1153 LDFLAGS = @LDFLAGS@
1154 +LD_AS_NEEDED = @LD_AS_NEEDED@
1155 LEX = @LEX@
1156 LEXLIB = @LEXLIB@
1157 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1158 @@ -173,6 +175,7 @@
1159 STRIP = @STRIP@
1160 USE_NLS = @USE_NLS@
1161 VERSION = 1
1162 +WEXTRA = @WEXTRA@
1163 XGETTEXT = @XGETTEXT@
1164 XGETTEXT_015 = @XGETTEXT_015@
1165 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1166 @@ -235,17 +238,16 @@
1167 -I$(srcdir)/../libelf -I$(srcdir)/../libdw \
1168 -I$(srcdir)/../libasm
1169 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1170 - $($(*F)_no_Werror),,-Werror) $(if \
1171 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1172 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1173 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1174 - $(am__append_1) -fpic
1175 + $(am__append_1) $(am__append_2) -fpic
1176 @MUDFLAP_FALSE@libmudflap =
1177 @MUDFLAP_TRUE@libmudflap = -lmudflap
1178 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
1179 $(COMPILE))
1181 CLEANFILES = *.gcno *.gcda $(am_libebl_pic_a_OBJECTS)
1182 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
1183 +textrel_check =
1184 lib_LIBRARIES = libebl.a
1185 pkginclude_HEADERS = libebl.h
1186 gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \
1187 diff --git a/libelf/ChangeLog b/libelf/ChangeLog
1188 --- a/libelf/ChangeLog
1189 +++ b/libelf/ChangeLog
1190 @@ -7,6 +7,11 @@
1192 * elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
1194 +2011-03-10 Roland McGrath <roland@redhat.com>
1196 + * gnuhash_xlate.h (elf_cvt_gnuhash): Avoid post-increment in bswap_32
1197 + argument, since some implementations are buggy macros.
1199 2011-02-26 Mark Wielaard <mjw@redhat.com>
1201 * elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
1202 @@ -684,6 +689,11 @@
1204 * elf.h: Update from glibc.
1206 +2005-05-31 Roland McGrath <roland@redhat.com>
1208 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1209 + (AM_CFLAGS): Use it in place of -Wextra.
1211 2005-05-08 Roland McGrath <roland@redhat.com>
1213 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
1214 diff --git a/libelf/Makefile.in b/libelf/Makefile.in
1215 --- a/libelf/Makefile.in
1216 +++ b/libelf/Makefile.in
1217 @@ -39,11 +39,12 @@
1218 DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
1219 $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
1220 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog
1221 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
1222 -@BUILD_STATIC_TRUE@am__append_2 = -fpic
1223 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
1224 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
1225 +@BUILD_STATIC_TRUE@am__append_3 = -fpic
1226 @MUDFLAP_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
1227 @MUDFLAP_TRUE@am_libelf_pic_a_OBJECTS =
1228 -@MUDFLAP_FALSE@@USE_LOCKS_TRUE@am__append_3 = -lpthread
1229 +@MUDFLAP_FALSE@@USE_LOCKS_TRUE@am__append_4 = -lpthread
1230 subdir = libelf
1231 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1232 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
1233 @@ -141,7 +142,7 @@
1234 libelf_pic_a_AR = $(AR) $(ARFLAGS)
1235 libelf_pic_a_LIBADD =
1236 libelf_pic_a_OBJECTS = $(am_libelf_pic_a_OBJECTS)
1237 -@MUDFLAP_FALSE@am__EXEEXT_1 = libelf.so$(EXEEXT)
1238 +@MUDFLAP_FALSE@
1239 PROGRAMS = $(noinst_PROGRAMS)
1240 am_libelf_so_OBJECTS =
1241 libelf_so_OBJECTS = $(am_libelf_so_OBJECTS)
1242 @@ -189,6 +190,7 @@
1243 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1244 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1245 LDFLAGS = @LDFLAGS@
1246 +LD_AS_NEEDED = @LD_AS_NEEDED@
1247 LEX = @LEX@
1248 LEXLIB = @LEXLIB@
1249 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1250 @@ -218,6 +220,7 @@
1251 STRIP = @STRIP@
1252 USE_NLS = @USE_NLS@
1253 VERSION = 1
1254 +WEXTRA = @WEXTRA@
1255 XGETTEXT = @XGETTEXT@
1256 XGETTEXT_015 = @XGETTEXT_015@
1257 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1258 @@ -278,10 +281,9 @@
1259 zip_LIBS = @zip_LIBS@
1260 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
1261 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1262 - $($(*F)_no_Werror),,-Werror) $(if \
1263 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1264 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1265 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1266 - $(am__append_1) $(am__append_2)
1267 + $(am__append_1) $(am__append_2) $(am__append_3)
1268 @MUDFLAP_FALSE@libmudflap =
1269 @MUDFLAP_TRUE@libmudflap = -lmudflap
1270 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
1271 @@ -289,7 +291,7 @@
1273 CLEANFILES = *.gcno *.gcda $(am_libelf_pic_a_OBJECTS) \
1274 libelf.so.$(VERSION)
1275 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
1276 +textrel_check =
1277 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
1278 lib_LIBRARIES = libelf.a
1279 @MUDFLAP_FALSE@noinst_LIBRARIES = libelf_pic.a
1280 @@ -346,7 +348,7 @@
1282 @MUDFLAP_FALSE@libelf_pic_a_SOURCES =
1283 @MUDFLAP_FALSE@am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
1284 -@MUDFLAP_FALSE@libelf_so_LDLIBS = $(am__append_3)
1285 +@MUDFLAP_FALSE@libelf_so_LDLIBS = $(am__append_4)
1286 @MUDFLAP_FALSE@libelf_so_SOURCES =
1287 noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
1288 version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h
1289 @@ -824,10 +826,13 @@
1290 @MUDFLAP_FALSE@ $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
1291 @MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \
1292 @MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro $(libelf_so_LDLIBS)
1293 -@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
1294 +@MUDFLAP_FALSE@
1295 @MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION)
1297 -@MUDFLAP_FALSE@install: install-am libelf.so
1298 +@MUDFLAP_FALSE@install: install-am
1300 +foobar:
1302 @MUDFLAP_FALSE@ $(mkinstalldirs) $(DESTDIR)$(libdir)
1303 @MUDFLAP_FALSE@ $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
1304 @MUDFLAP_FALSE@ ln -fs libelf-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libelf.so.$(VERSION)
1305 diff --git a/libelf/ar.h b/libelf/ar.h
1306 new file mode 100644
1307 --- /dev/null
1308 +++ b/libelf/ar.h
1309 @@ -0,0 +1,55 @@
1310 +/* archive file definition for GNU software
1312 + Copyright 2001, 2008, 2010 Free Software Foundation, Inc.
1314 + This program is free software; you can redistribute it and/or modify
1315 + it under the terms of the GNU General Public License as published by
1316 + the Free Software Foundation; either version 3 of the License, or
1317 + (at your option) any later version.
1319 + This program is distributed in the hope that it will be useful,
1320 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1321 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1322 + GNU General Public License for more details.
1324 + You should have received a copy of the GNU General Public License
1325 + along with this program; if not, write to the Free Software
1326 + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1327 + MA 02110-1301, USA. */
1329 +/* So far this is correct for BSDish archives. Don't forget that
1330 + files must begin on an even byte boundary. */
1332 +#ifndef __GNU_AR_H__
1333 +#define __GNU_AR_H__
1335 +/* Note that the usual '\n' in magic strings may translate to different
1336 + characters, as allowed by ANSI. '\012' has a fixed value, and remains
1337 + compatible with existing BSDish archives. */
1339 +#define ARMAG "!<arch>\012" /* For COFF and a.out archives. */
1340 +#define ARMAGB "!<bout>\012" /* For b.out archives. */
1341 +#define ARMAGT "!<thin>\012" /* For thin archives. */
1342 +#define SARMAG 8
1343 +#define ARFMAG "`\012"
1345 +/* The ar_date field of the armap (__.SYMDEF) member of an archive
1346 + must be greater than the modified date of the entire file, or
1347 + BSD-derived linkers complain. We originally write the ar_date with
1348 + this offset from the real file's mod-time. After finishing the
1349 + file, we rewrite ar_date if it's not still greater than the mod date. */
1351 +#define ARMAP_TIME_OFFSET 60
1353 +struct ar_hdr
1355 + char ar_name[16]; /* Name of this member. */
1356 + char ar_date[12]; /* File mtime. */
1357 + char ar_uid[6]; /* Owner uid; printed as decimal. */
1358 + char ar_gid[6]; /* Owner gid; printed as decimal. */
1359 + char ar_mode[8]; /* File mode, printed as octal. */
1360 + char ar_size[10]; /* File size, printed as decimal. */
1361 + char ar_fmag[2]; /* Should contain ARFMAG. */
1364 +#endif /* __GNU_AR_H__ */
1365 diff --git a/libelf/common.h b/libelf/common.h
1366 --- a/libelf/common.h
1367 +++ b/libelf/common.h
1368 @@ -30,7 +30,7 @@
1369 #ifndef _COMMON_H
1370 #define _COMMON_H 1
1372 -#include <ar.h>
1373 +#include "ar.h"
1374 #include <byteswap.h>
1375 #include <endian.h>
1376 #include <stdlib.h>
1377 @@ -139,7 +139,7 @@
1378 (Var) = (sizeof (Var) == 1 \
1379 ? (unsigned char) (Var) \
1380 : (sizeof (Var) == 2 \
1381 - ? bswap_16 (Var) \
1382 + ? (unsigned short int) bswap_16 (Var) \
1383 : (sizeof (Var) == 4 \
1384 ? bswap_32 (Var) \
1385 : bswap_64 (Var))))
1386 @@ -148,7 +148,7 @@
1387 (Dst) = (sizeof (Var) == 1 \
1388 ? (unsigned char) (Var) \
1389 : (sizeof (Var) == 2 \
1390 - ? bswap_16 (Var) \
1391 + ? (unsigned short int) bswap_16 (Var) \
1392 : (sizeof (Var) == 4 \
1393 ? bswap_32 (Var) \
1394 : bswap_64 (Var))))
1395 diff --git a/libelf/elf.h b/libelf/elf.h
1396 --- a/libelf/elf.h
1397 +++ b/libelf/elf.h
1398 @@ -23,7 +23,9 @@
1400 #include <features.h>
1402 -__BEGIN_DECLS
1403 +#ifdef __cplusplus
1404 +extern "C" {
1405 +#endif
1407 /* Standard ELF types. */
1409 @@ -2794,6 +2796,8 @@
1410 #define R_M32R_NUM 256 /* Keep this the last entry. */
1413 -__END_DECLS
1414 +#ifdef __cplusplus
1416 +#endif
1418 #endif /* elf.h */
1419 diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c
1420 --- a/libelf/elf_begin.c
1421 +++ b/libelf/elf_begin.c
1422 @@ -775,7 +775,7 @@
1425 /* Copy the raw name over to a NUL terminated buffer. */
1426 - *((char *) __mempcpy (elf->state.ar.raw_name, ar_hdr->ar_name, 16)) = '\0';
1427 + *((char *) mempcpy (elf->state.ar.raw_name, ar_hdr->ar_name, 16)) = '\0';
1429 elf_ar_hdr = &elf->state.ar.elf_ar_hdr;
1431 @@ -867,7 +867,7 @@
1432 const char *string = ar_hdr->FIELD; \
1433 if (ar_hdr->FIELD[sizeof (ar_hdr->FIELD) - 1] != ' ') \
1435 - *((char *) __mempcpy (buf, ar_hdr->FIELD, sizeof (ar_hdr->FIELD))) \
1436 + *((char *) mempcpy (buf, ar_hdr->FIELD, sizeof (ar_hdr->FIELD))) \
1437 = '\0'; \
1438 string = buf; \
1440 diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
1441 --- a/libelf/gnuhash_xlate.h
1442 +++ b/libelf/gnuhash_xlate.h
1443 @@ -1,5 +1,5 @@
1444 /* Conversion functions for versioning information.
1445 - Copyright (C) 2006, 2007 Red Hat, Inc.
1446 + Copyright (C) 2006-2011 Red Hat, Inc.
1447 This file is part of elfutils.
1448 Written by Ulrich Drepper <drepper@redhat.com>, 2006.
1450 @@ -68,7 +68,9 @@
1451 dest32 = (Elf32_Word *) &dest64[bitmask_words];
1452 while (len >= 4)
1454 - *dest32++ = bswap_32 (*src32++);
1455 + *dest32 = bswap_32 (*src32);
1456 + ++dest32;
1457 + ++src32;
1458 len -= 4;
1461 diff --git a/libelf/libelf.h b/libelf/libelf.h
1462 --- a/libelf/libelf.h
1463 +++ b/libelf/libelf.h
1464 @@ -74,7 +74,7 @@
1465 Elf_Type d_type; /* Type of this piece of data. */
1466 unsigned int d_version; /* ELF version. */
1467 size_t d_size; /* Size in bytes. */
1468 - loff_t d_off; /* Offset into section. */
1469 + off_t d_off; /* Offset into section. */
1470 size_t d_align; /* Alignment in section. */
1471 } Elf_Data;
1473 @@ -136,7 +136,7 @@
1474 uid_t ar_uid; /* User ID. */
1475 gid_t ar_gid; /* Group ID. */
1476 mode_t ar_mode; /* File mode. */
1477 - loff_t ar_size; /* File size. */
1478 + off_t ar_size; /* File size. */
1479 char *ar_rawname; /* Original name of archive member. */
1480 } Elf_Arhdr;
1482 @@ -177,13 +177,13 @@
1483 extern int elf_end (Elf *__elf);
1485 /* Update ELF descriptor and write file to disk. */
1486 -extern loff_t elf_update (Elf *__elf, Elf_Cmd __cmd);
1487 +extern off_t elf_update (Elf *__elf, Elf_Cmd __cmd);
1489 /* Determine what kind of file is associated with ELF. */
1490 extern Elf_Kind elf_kind (Elf *__elf) __attribute__ ((__pure__));
1492 /* Get the base offset for an object file. */
1493 -extern loff_t elf_getbase (Elf *__elf);
1494 +extern off_t elf_getbase (Elf *__elf);
1497 /* Retrieve file identification data. */
1498 @@ -301,7 +301,7 @@
1499 would be for TYPE. The resulting Elf_Data pointer is valid until
1500 elf_end (ELF) is called. */
1501 extern Elf_Data *elf_getdata_rawchunk (Elf *__elf,
1502 - loff_t __offset, size_t __size,
1503 + off_t __offset, size_t __size,
1504 Elf_Type __type);
1507 @@ -313,7 +313,7 @@
1508 extern Elf_Arhdr *elf_getarhdr (Elf *__elf);
1510 /* Return offset in archive for current file ELF. */
1511 -extern loff_t elf_getaroff (Elf *__elf);
1512 +extern off_t elf_getaroff (Elf *__elf);
1514 /* Select archive element at OFFSET. */
1515 extern size_t elf_rand (Elf *__elf, size_t __offset);
1516 diff --git a/libelf/libelfP.h b/libelf/libelfP.h
1517 --- a/libelf/libelfP.h
1518 +++ b/libelf/libelfP.h
1519 @@ -34,7 +34,7 @@
1520 # include <config.h>
1521 #endif
1523 -#include <ar.h>
1524 +#include "ar.h"
1525 #include <gelf.h>
1527 #include <errno.h>
1528 @@ -42,6 +42,19 @@
1529 #include <stdio.h>
1530 #include <string.h>
1532 +#ifndef MIN
1533 +# define MIN(a,b) (((a)<(b))?(a):(b))
1534 +#endif
1535 +#ifndef MAX
1536 +# define MAX(a,b) (((a)>(b))?(a):(b))
1537 +#endif
1538 +#ifndef powerof2
1539 +# define powerof2(x) ((((x) - 1) & (x)) == 0)
1540 +#endif
1541 +#ifndef __CONCAT
1542 +#define __CONCAT(x,y) x ## y
1543 +#endif
1545 /* gettext helper macros. */
1546 #define _(Str) dgettext ("elfutils", Str)
1548 diff --git a/m4/Makefile.in b/m4/Makefile.in
1549 --- a/m4/Makefile.in
1550 +++ b/m4/Makefile.in
1551 @@ -75,6 +75,7 @@
1552 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1553 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1554 LDFLAGS = @LDFLAGS@
1555 +LD_AS_NEEDED = @LD_AS_NEEDED@
1556 LEX = @LEX@
1557 LEXLIB = @LEXLIB@
1558 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1559 @@ -104,6 +105,7 @@
1560 STRIP = @STRIP@
1561 USE_NLS = @USE_NLS@
1562 VERSION = @VERSION@
1563 +WEXTRA = @WEXTRA@
1564 XGETTEXT = @XGETTEXT@
1565 XGETTEXT_015 = @XGETTEXT_015@
1566 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1567 diff --git a/src/ChangeLog b/src/ChangeLog
1568 --- a/src/ChangeLog
1569 +++ b/src/ChangeLog
1570 @@ -519,8 +519,16 @@
1571 * readelf.c (attr_callback): Use print_block only when we don't use
1572 print_ops.
1574 +2009-08-17 Roland McGrath <roland@redhat.com>
1576 + * ld.h: Disable extern inlines for GCC 4.2.
1578 2009-08-14 Roland McGrath <roland@redhat.com>
1580 + * strings.c (read_block): Conditionalize posix_fadvise use
1581 + on [POSIX_FADV_SEQUENTIAL].
1582 + From Petr Salinger <Petr.Salinger@seznam.cz>.
1584 * ar.c (do_oper_extract): Use pathconf instead of statfs.
1586 2009-08-01 Ulrich Drepper <drepper@redhat.com>
1587 @@ -684,6 +692,8 @@
1588 * readelf.c (print_debug_frame_section): Use t instead of j formats
1589 for ptrdiff_t OFFSET.
1591 + * addr2line.c (handle_address): Use %a instead of %m for compatibility.
1593 2009-01-21 Ulrich Drepper <drepper@redhat.com>
1595 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
1596 @@ -867,6 +877,11 @@
1597 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
1598 is valid in RELRO.
1600 +2008-03-01 Roland McGrath <roland@redhat.com>
1602 + * readelf.c (dump_archive_index): Tweak portability hack
1603 + to match [__GNUC__ < 4] too.
1605 2008-02-29 Roland McGrath <roland@redhat.com>
1607 * readelf.c (print_attributes): Add a cast.
1608 @@ -1118,6 +1133,8 @@
1610 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
1612 + * Makefile.am (readelf_no_Werror): New variable.
1614 2007-10-15 Roland McGrath <roland@redhat.com>
1616 * make-debug-archive.in: New file.
1617 @@ -1557,6 +1574,10 @@
1618 * elflint.c (valid_e_machine): Add EM_ALPHA.
1619 Reported by Christian Aichinger <Greek0@gmx.net>.
1621 + * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
1622 + MADV_SEQUENTIAL if undefined. Don't call posix_madvise
1623 + if neither is defined.
1625 2006-08-08 Ulrich Drepper <drepper@redhat.com>
1627 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
1628 @@ -1633,6 +1654,10 @@
1629 * Makefile.am: Add hacks to create dependency files for non-generic
1630 linker.
1632 +2006-04-05 Roland McGrath <roland@redhat.com>
1634 + * strings.c (MAP_POPULATE): Define to 0 if undefined.
1636 2006-06-12 Ulrich Drepper <drepper@redhat.com>
1638 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
1639 @@ -1981,6 +2006,11 @@
1640 * readelf.c (print_debug_loc_section): Fix indentation for larger
1641 address size.
1643 +2005-05-31 Roland McGrath <roland@redhat.com>
1645 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1646 + (AM_CFLAGS): Use it in place of -Wextra.
1648 2005-05-30 Roland McGrath <roland@redhat.com>
1650 * readelf.c (print_debug_line_section): Print section offset of each
1651 diff --git a/src/Makefile.am b/src/Makefile.am
1652 --- a/src/Makefile.am
1653 +++ b/src/Makefile.am
1654 @@ -95,6 +95,9 @@
1655 # XXX While the file is not finished, don't warn about this
1656 ldgeneric_no_Wunused = yes
1658 +# Buggy old compilers.
1659 +readelf_no_Werror = yes
1661 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1662 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
1663 $(demanglelib)
1664 diff --git a/src/Makefile.in b/src/Makefile.in
1665 --- a/src/Makefile.in
1666 +++ b/src/Makefile.in
1667 @@ -40,7 +40,8 @@
1668 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
1669 $(srcdir)/Makefile.in $(top_srcdir)/config/eu.am ChangeLog \
1670 ldlex.c ldscript.c
1671 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
1672 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
1673 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
1674 bin_PROGRAMS = readelf$(EXEEXT) nm$(EXEEXT) size$(EXEEXT) \
1675 strip$(EXEEXT) ld$(EXEEXT) elflint$(EXEEXT) \
1676 findtextrel$(EXEEXT) addr2line$(EXEEXT) elfcmp$(EXEEXT) \
1677 @@ -49,9 +50,9 @@
1678 @NATIVE_LD_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1)
1679 # We never build this library but we need to get the dependency files
1680 # of all the linker backends that might be used in a non-generic linker.
1681 -@NEVER_TRUE@am__append_2 = libdummy.a
1682 +@NEVER_TRUE@am__append_3 = libdummy.a
1683 # -ldl is always needed for libebl.
1684 -@NATIVE_LD_TRUE@am__append_3 = libld_elf.a
1685 +@NATIVE_LD_TRUE@am__append_4 = libld_elf.a
1686 @NATIVE_LD_TRUE@am_libld_elf_i386_pic_a_OBJECTS =
1687 subdir = src
1688 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
1689 @@ -115,7 +116,7 @@
1690 versionhash.$(OBJEXT)
1691 ld_OBJECTS = $(am_ld_OBJECTS)
1692 ld_DEPENDENCIES = $(libebl) $(libelf) $(libeu) $(am__DEPENDENCIES_1) \
1693 - $(am__append_3)
1694 + $(am__append_4)
1695 ld_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ld_LDFLAGS) $(LDFLAGS) -o \
1697 am_libld_elf_i386_so_OBJECTS =
1698 @@ -229,6 +230,7 @@
1699 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1700 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1701 LDFLAGS = @LDFLAGS@
1702 +LD_AS_NEEDED = @LD_AS_NEEDED@
1703 LEX = @LEX@
1704 LEXLIB = @LEXLIB@
1705 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1706 @@ -258,6 +260,7 @@
1707 STRIP = @STRIP@
1708 USE_NLS = @USE_NLS@
1709 VERSION = @VERSION@
1710 +WEXTRA = @WEXTRA@
1711 XGETTEXT = @XGETTEXT@
1712 XGETTEXT_015 = @XGETTEXT_015@
1713 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1714 @@ -321,10 +324,9 @@
1715 -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
1716 -I$(srcdir)/../libasm
1717 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1718 - $($(*F)_no_Werror),,-Werror) $(if \
1719 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1720 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1721 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1722 - $(am__append_1)
1723 + $(am__append_1) $(am__append_2)
1724 @MUDFLAP_FALSE@libmudflap =
1725 @MUDFLAP_TRUE@libmudflap = -lmudflap
1726 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
1727 @@ -332,7 +334,7 @@
1729 CLEANFILES = *.gcno *.gcda make-debug-archive none_ld.os \
1730 $(ld_modules:.c=.os) *.gconv
1731 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
1732 +textrel_check =
1733 AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw
1734 no_mudflap.os = -fmudflap
1735 AM_YFLAGS = -pld
1736 @@ -340,8 +342,8 @@
1737 native_ld = @native_ld@
1738 ld_dsos = libld_elf_i386_pic.a
1739 @NATIVE_LD_FALSE@noinst_LIBRARIES = libld_elf.a libar.a $(ld_dsos) \
1740 -@NATIVE_LD_FALSE@ $(am__append_2)
1741 -@NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a libar.a $(am__append_2)
1742 +@NATIVE_LD_FALSE@ $(am__append_3)
1743 +@NATIVE_LD_TRUE@noinst_LIBRARIES = libld_elf.a libar.a $(am__append_3)
1744 @NATIVE_LD_TRUE@native_ld_cflags = -DBASE_ELF_NAME=elf_$(base_cpu)
1745 @NEVER_TRUE@libdummy_a_SOURCES = i386_ld.c
1746 ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \
1747 @@ -370,6 +372,9 @@
1748 addr2line_no_Wformat = yes
1749 # XXX While the file is not finished, don't warn about this
1750 ldgeneric_no_Wunused = yes
1752 +# Buggy old compilers.
1753 +readelf_no_Werror = yes
1754 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1755 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
1756 $(demanglelib)
1757 @@ -377,7 +382,7 @@
1758 size_LDADD = $(libelf) $(libeu) $(libmudflap)
1759 strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1760 ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
1761 - $(am__append_3)
1762 + $(am__append_4)
1763 ld_LDFLAGS = -rdynamic
1764 elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1765 findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap)
1766 diff --git a/src/addr2line.c b/src/addr2line.c
1767 --- a/src/addr2line.c
1768 +++ b/src/addr2line.c
1769 @@ -447,10 +447,10 @@
1770 bool parsed = false;
1771 int i, j;
1772 char *name = NULL;
1773 - if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
1774 + if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
1775 && string[i] == '\0')
1776 parsed = adjust_to_section (name, &addr, dwfl);
1777 - switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
1778 + switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
1780 default:
1781 break;
1782 diff --git a/src/findtextrel.c b/src/findtextrel.c
1783 --- a/src/findtextrel.c
1784 +++ b/src/findtextrel.c
1785 @@ -496,7 +496,11 @@
1788 static void
1789 -check_rel (size_t nsegments, struct segments segments[nsegments],
1790 +check_rel (size_t nsegments, struct segments segments[
1791 +#if __GNUC__ >= 4
1792 + nsegments
1793 +#endif
1794 + ],
1795 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
1796 const char *fname, bool more_than_one, void **knownsrcs)
1798 diff --git a/src/ld.h b/src/ld.h
1799 --- a/src/ld.h
1800 +++ b/src/ld.h
1801 @@ -1114,6 +1114,7 @@
1803 /* Checked whether the symbol is undefined and referenced from a DSO. */
1804 extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
1805 +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
1806 #ifdef __GNUC_STDC_INLINE__
1807 __attribute__ ((__gnu_inline__))
1808 #endif
1809 @@ -1131,5 +1132,6 @@
1811 return sym->defined && sym->in_dso;
1813 +#endif /* Optimizing and not GCC 4.2. */
1815 #endif /* ld.h */
1816 diff --git a/src/readelf.c b/src/readelf.c
1817 --- a/src/readelf.c
1818 +++ b/src/readelf.c
1819 @@ -4429,10 +4429,11 @@
1820 #define listptr_offset_size(p) ((p)->dwarf64 ? 8 : 4)
1821 #define listptr_address_size(p) ((p)->addr64 ? 8 : 4)
1823 +static const char *listptr_name;
1824 static int
1825 -compare_listptr (const void *a, const void *b, void *arg)
1827 - const char *name = arg;
1828 +compare_listptr (const void *a, const void *b)
1830 + const char *const name = listptr_name;
1831 struct listptr *p1 = (void *) a;
1832 struct listptr *p2 = (void *) b;
1834 @@ -4513,8 +4514,11 @@
1835 sort_listptr (struct listptr_table *table, const char *name)
1837 if (table->n > 0)
1838 - qsort_r (table->table, table->n, sizeof table->table[0],
1839 - &compare_listptr, (void *) name);
1841 + listptr_name = name;
1842 + qsort (table->table, table->n, sizeof table->table[0],
1843 + &compare_listptr);
1847 static bool
1848 @@ -8478,7 +8482,7 @@
1849 if (unlikely (elf_rand (elf, as_off) == 0)
1850 || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
1851 == NULL))
1852 -#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
1853 +#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
1854 while (1)
1855 #endif
1856 error (EXIT_FAILURE, 0,
1857 diff --git a/src/strings.c b/src/strings.c
1858 --- a/src/strings.c
1859 +++ b/src/strings.c
1860 @@ -43,6 +43,10 @@
1862 #include <system.h>
1864 +#ifndef MAP_POPULATE
1865 +# define MAP_POPULATE 0
1866 +#endif
1869 /* Prototypes of local functions. */
1870 static int read_fd (int fd, const char *fname, off64_t fdlen);
1871 @@ -483,8 +487,13 @@
1872 fd, start_off);
1873 if (mem != MAP_FAILED)
1875 +#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
1876 +# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
1877 +#endif
1878 +#ifdef POSIX_MADV_SEQUENTIAL
1879 /* We will go through the mapping sequentially. */
1880 (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
1881 +#endif
1882 break;
1884 if (errno != EINVAL && errno != ENOMEM)
1885 @@ -576,9 +585,11 @@
1886 elfmap_off = from & ~(ps - 1);
1887 elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
1889 +#ifdef POSIX_FADV_SEQUENTIAL
1890 if (unlikely (elfmap == MAP_FAILED))
1891 /* Let the kernel know we are going to read everything in sequence. */
1892 (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
1893 +#endif
1896 if (unlikely (elfmap == MAP_FAILED))
1897 diff --git a/src/strip.c b/src/strip.c
1898 --- a/src/strip.c
1899 +++ b/src/strip.c
1900 @@ -45,6 +45,12 @@
1901 #include <libebl.h>
1902 #include <system.h>
1904 +#ifdef HAVE_FUTIMES
1905 +# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
1906 +#else
1907 +# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
1908 +#endif
1910 typedef uint8_t GElf_Byte;
1912 /* Name and version of program. */
1913 @@ -318,8 +324,18 @@
1915 /* If we have to preserve the timestamp, we need it in the
1916 format utimes() understands. */
1917 +#ifdef HAVE_STRUCT_STAT_ST_ATIM
1918 TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
1919 +#else
1920 + tv[0].tv_sec = pre_st.st_atime;
1921 + tv[0].tv_usec = 0;
1922 +#endif
1923 +#ifdef HAVE_STRUCT_STAT_ST_MTIM
1924 TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
1925 +#else
1926 + tv[1].tv_sec = pre_st.st_atime;
1927 + tv[1].tv_usec = 0;
1928 +#endif
1931 /* Open the file. */
1932 @@ -2055,7 +2071,7 @@
1933 /* If requested, preserve the timestamp. */
1934 if (tvp != NULL)
1936 - if (futimes (fd, tvp) != 0)
1937 + if (FUTIMES (fd, output_fname, tvp) != 0)
1939 error (0, errno, gettext ("\
1940 cannot set access and modification date of '%s'"),
1941 @@ -2112,7 +2128,7 @@
1943 if (tvp != NULL)
1945 - if (unlikely (futimes (fd, tvp) != 0))
1946 + if (unlikely (FUTIMES (fd, fname, tvp) != 0))
1948 error (0, errno, gettext ("\
1949 cannot set access and modification date of '%s'"), fname);
1950 diff --git a/tests/ChangeLog b/tests/ChangeLog
1951 --- a/tests/ChangeLog
1952 +++ b/tests/ChangeLog
1953 @@ -333,6 +333,8 @@
1955 2008-01-21 Roland McGrath <roland@redhat.com>
1957 + * line2addr.c (main): Revert last change.
1959 * testfile45.S.bz2: Add tests for cltq, cqto.
1960 * testfile45.expect.bz2: Adjust.
1962 @@ -1041,6 +1043,11 @@
1963 * Makefile.am (TESTS): Add run-elflint-test.sh.
1964 (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
1966 +2005-05-31 Roland McGrath <roland@redhat.com>
1968 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1969 + (AM_CFLAGS): Use it in place of -Wextra.
1971 2005-05-24 Ulrich Drepper <drepper@redhat.com>
1973 * get-files.c (main): Use correct format specifier.
1974 diff --git a/tests/Makefile.in b/tests/Makefile.in
1975 --- a/tests/Makefile.in
1976 +++ b/tests/Makefile.in
1977 @@ -36,14 +36,15 @@
1978 host_triplet = @host@
1979 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
1980 $(top_srcdir)/config/eu.am ChangeLog
1981 -@MUDFLAP_TRUE@am__append_1 = -fmudflap
1982 -@STANDALONE_FALSE@am__append_2 = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
1983 +@BUILD_WERROR_TRUE@am__append_1 = $(if $($(*F)_no_Werror),,)
1984 +@MUDFLAP_TRUE@am__append_2 = -fmudflap
1985 +@STANDALONE_FALSE@am__append_3 = -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
1986 @STANDALONE_FALSE@ -I$(top_srcdir)/libdwfl \
1987 @STANDALONE_FALSE@ -I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
1988 @STANDALONE_FALSE@ -I$(top_srcdir)/lib -I..
1990 -@STANDALONE_FALSE@am__append_3 = -Wl,-rpath-link,../libasm:../libdw:../libelf
1991 -@TESTS_RPATH_TRUE@am__append_4 = -Wl,-rpath,$(BUILD_RPATH)
1992 +@STANDALONE_FALSE@am__append_4 = -Wl,-rpath-link,../libasm:../libdw:../libelf
1993 +@TESTS_RPATH_TRUE@am__append_5 = -Wl,-rpath,$(BUILD_RPATH)
1994 noinst_PROGRAMS = arextract$(EXEEXT) arsymtest$(EXEEXT) \
1995 newfile$(EXEEXT) saridx$(EXEEXT) scnnames$(EXEEXT) \
1996 sectiondump$(EXEEXT) showptable$(EXEEXT) update1$(EXEEXT) \
1997 @@ -89,10 +90,10 @@
1998 run-rerequest_tag.sh run-typeiter.sh run-readelf-d.sh \
1999 run-unstrip-n.sh run-low_high_pc.sh $(am__EXEEXT_1) \
2000 $(am__EXEEXT_3)
2001 -@STANDALONE_FALSE@am__append_5 = msg_tst md5-sha1-test
2002 @STANDALONE_FALSE@am__append_6 = msg_tst md5-sha1-test
2003 -@HAVE_LIBASM_TRUE@am__append_7 = $(asm_TESTS)
2004 +@STANDALONE_FALSE@am__append_7 = msg_tst md5-sha1-test
2005 @HAVE_LIBASM_TRUE@am__append_8 = $(asm_TESTS)
2006 +@HAVE_LIBASM_TRUE@am__append_9 = $(asm_TESTS)
2007 subdir = tests
2008 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
2009 am__aclocal_m4_deps = $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
2010 @@ -403,6 +404,7 @@
2011 INSTALL_SCRIPT = @INSTALL_SCRIPT@
2012 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
2013 LDFLAGS = @LDFLAGS@
2014 +LD_AS_NEEDED = @LD_AS_NEEDED@
2015 LEX = @LEX@
2016 LEXLIB = @LEXLIB@
2017 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
2018 @@ -432,6 +434,7 @@
2019 STRIP = @STRIP@
2020 USE_NLS = @USE_NLS@
2021 VERSION = @VERSION@
2022 +WEXTRA = @WEXTRA@
2023 XGETTEXT = @XGETTEXT@
2024 XGETTEXT_015 = @XGETTEXT_015@
2025 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
2026 @@ -490,22 +493,21 @@
2027 top_builddir = @top_builddir@
2028 top_srcdir = @top_srcdir@
2029 zip_LIBS = @zip_LIBS@
2030 -INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_2)
2031 +INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_3)
2032 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
2033 - $($(*F)_no_Werror),,-Werror) $(if \
2034 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
2035 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
2036 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
2037 - $(am__append_1)
2038 + $(am__append_1) $(am__append_2)
2039 @MUDFLAP_FALSE@libmudflap =
2040 @MUDFLAP_TRUE@libmudflap = -lmudflap
2041 COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage $(no_mudflap.os),\
2042 $(COMPILE))
2044 CLEANFILES = *.gcno *.gcda
2045 -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
2046 +textrel_check =
2047 @MUDFLAP_FALSE@BUILD_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
2048 @MUDFLAP_TRUE@BUILD_RPATH = \$$ORIGIN/../backends
2049 -AM_LDFLAGS = $(am__append_3) $(am__append_4)
2050 +AM_LDFLAGS = $(am__append_4) $(am__append_5)
2051 @TESTS_RPATH_FALSE@tests_rpath = no
2052 @TESTS_RPATH_TRUE@tests_rpath = yes
2053 asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
2054 diff --git a/tests/line2addr.c b/tests/line2addr.c
2055 --- a/tests/line2addr.c
2056 +++ b/tests/line2addr.c
2057 @@ -124,7 +124,7 @@
2059 struct args a = { .arg = argv[cnt] };
2061 - switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
2062 + switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
2064 default:
2065 case 0: