[packages] elfutils: update to 0.147, use PKG_INSTALL, add MD5SUM, fix URL, cleanup...
[openwrt/svn-archive/archive.git] / libs / elfutils / patches / 001-elfutils-portability.patch
1 --- a/backends/ChangeLog
2 +++ b/backends/ChangeLog
3 @@ -106,6 +106,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 @@ -433,6 +437,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 @@ -455,6 +464,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 --- a/backends/Makefile.am
37 +++ b/backends/Makefile.am
38 @@ -103,7 +103,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 --- a/backends/Makefile.in
48 +++ b/backends/Makefile.in
49 @@ -165,6 +165,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
50 INSTALL_SCRIPT = @INSTALL_SCRIPT@
51 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
52 LDFLAGS = @LDFLAGS@
53 +LD_AS_NEEDED = @LD_AS_NEEDED@
54 LEX = @LEX@
55 LEXLIB = @LEXLIB@
56 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
57 @@ -193,6 +194,7 @@ SHELL = @SHELL@
58 STRIP = @STRIP@
59 USE_NLS = @USE_NLS@
60 VERSION = @VERSION@
61 +WEXTRA = @WEXTRA@
62 XGETTEXT = @XGETTEXT@
63 XGETTEXT_015 = @XGETTEXT_015@
64 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
65 @@ -256,7 +258,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
66 -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
67 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
68 $($(*F)_no_Werror),,-Werror) $(if \
69 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
70 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
71 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
72 $(am__append_1)
73 @MUDFLAP_FALSE@libmudflap =
74 @@ -697,7 +699,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a
75 $(LINK) -shared -o $(@:.map=.so) \
76 -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
77 -Wl,--version-script,$(@:.so=.map) \
78 - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
79 + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
80 $(textrel_check)
81
82 libebl_i386.so: $(cpu_i386)
83 --- a/ChangeLog
84 +++ b/ChangeLog
85 @@ -2,6 +2,10 @@
86
87 * configure.ac (LOCALEDIR, DATADIRNAME): Removed.
88
89 +2009-11-22 Roland McGrath <roland@redhat.com>
90 +
91 + * configure.ac: Use sed and expr instead of modern bash extensions.
92 +
93 2009-09-21 Ulrich Drepper <drepper@redhat.com>
94
95 * configure.ac: Update for more modern autoconf.
96 @@ -10,6 +14,10 @@
97
98 * configure.ac (zip_LIBS): Check for liblzma too.
99
100 +2009-08-17 Roland McGrath <roland@redhat.com>
101 +
102 + * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
103 +
104 2009-04-19 Roland McGrath <roland@redhat.com>
105
106 * configure.ac (eu_version): Round down here, not in version.h macros.
107 @@ -21,6 +29,8 @@
108
109 2009-01-23 Roland McGrath <roland@redhat.com>
110
111 + * configure.ac: Check for __builtin_popcount.
112 +
113 * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
114
115 * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
116 @@ -101,6 +111,10 @@
117 * configure.ac: Add dummy automake conditional to get dependencies
118 for non-generic linker right. See src/Makefile.am.
119
120 +2005-11-22 Roland McGrath <roland@redhat.com>
121 +
122 + * configure.ac: Check for --as-needed linker option.
123 +
124 2005-11-18 Roland McGrath <roland@redhat.com>
125
126 * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
127 @@ -148,6 +162,17 @@
128 * Makefile.am (all_SUBDIRS): Add libdwfl.
129 * configure.ac: Write libdwfl/Makefile.
130
131 +2005-05-31 Roland McGrath <roland@redhat.com>
132 +
133 + * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
134 +
135 + * configure.ac: Check for struct stat st_?tim members.
136 + * src/strip.c (process_file): Use st_?time if st_?tim are not there.
137 +
138 + * configure.ac: Check for futimes function.
139 + * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
140 + (handle_ar) [! HAVE_FUTIMES]: Likewise.
141 +
142 2005-05-19 Roland McGrath <roland@redhat.com>
143
144 * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
145 --- a/config/eu.am
146 +++ b/config/eu.am
147 @@ -25,11 +25,14 @@
148 ## <http://www.openinventionnetwork.com>.
149 ##
150
151 +WEXTRA = @WEXTRA@
152 +LD_AS_NEEDED = @LD_AS_NEEDED@
153 +
154 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
155 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
156 AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
157 $(if $($(*F)_no_Werror),,-Werror) \
158 - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
159 + $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
160 $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
161 $($(*F)_CFLAGS)
162
163 --- a/config/Makefile.in
164 +++ b/config/Makefile.in
165 @@ -76,6 +76,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
166 INSTALL_SCRIPT = @INSTALL_SCRIPT@
167 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
168 LDFLAGS = @LDFLAGS@
169 +LD_AS_NEEDED = @LD_AS_NEEDED@
170 LEX = @LEX@
171 LEXLIB = @LEXLIB@
172 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
173 @@ -104,6 +105,7 @@ SHELL = @SHELL@
174 STRIP = @STRIP@
175 USE_NLS = @USE_NLS@
176 VERSION = @VERSION@
177 +WEXTRA = @WEXTRA@
178 XGETTEXT = @XGETTEXT@
179 XGETTEXT_015 = @XGETTEXT_015@
180 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
181 --- a/config.h.in
182 +++ b/config.h.in
183 @@ -1,5 +1,8 @@
184 /* config.h.in. Generated from configure.ac by autoheader. */
185
186 +/* Have __builtin_popcount. */
187 +#undef HAVE_BUILTIN_POPCOUNT
188 +
189 /* $libdir subdirectory containing libebl modules. */
190 #undef LIBEBL_SUBDIR
191
192 @@ -52,4 +55,7 @@
193 /* Define for large files, on AIX-style hosts. */
194 #undef _LARGE_FILES
195
196 +/* Stubbed out if missing compiler support. */
197 +#undef __thread
198 +
199 #include <eu-config.h>
200 --- a/configure
201 +++ b/configure
202 @@ -646,6 +646,8 @@ NEVER_TRUE
203 base_cpu
204 NATIVE_LD_FALSE
205 NATIVE_LD_TRUE
206 +LD_AS_NEEDED
207 +WEXTRA
208 LEXLIB
209 LEX_OUTPUT_ROOT
210 LEX
211 @@ -4098,6 +4100,205 @@ $as_echo "$as_me: error: gcc with C99 su
212 fi
213
214
215 +{ $as_echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
216 +$as_echo_n "checking for -Wextra option to $CC... " >&6; }
217 +if test "${ac_cv_cc_wextra+set}" = set; then
218 + $as_echo_n "(cached) " >&6
219 +else
220 + old_CFLAGS="$CFLAGS"
221 +CFLAGS="$CFLAGS -Wextra"
222 +cat >conftest.$ac_ext <<_ACEOF
223 +void foo (void) { }
224 +_ACEOF
225 +rm -f conftest.$ac_objext
226 +if { (ac_try="$ac_compile"
227 +case "(($ac_try" in
228 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
229 + *) ac_try_echo=$ac_try;;
230 +esac
231 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
232 +$as_echo "$ac_try_echo") >&5
233 + (eval "$ac_compile") 2>conftest.er1
234 + ac_status=$?
235 + grep -v '^ *+' conftest.er1 >conftest.err
236 + rm -f conftest.er1
237 + cat conftest.err >&5
238 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
239 + (exit $ac_status); } && {
240 + test -z "$ac_c_werror_flag" ||
241 + test ! -s conftest.err
242 + } && test -s conftest.$ac_objext; then
243 + ac_cv_cc_wextra=yes
244 +else
245 + $as_echo "$as_me: failed program was:" >&5
246 +sed 's/^/| /' conftest.$ac_ext >&5
247 +
248 + ac_cv_cc_wextra=no
249 +fi
250 +
251 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
252 +CFLAGS="$old_CFLAGS"
253 +fi
254 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
255 +$as_echo "$ac_cv_cc_wextra" >&6; }
256 +
257 +if test "x$ac_cv_cc_wextra" = xyes; then
258 + WEXTRA=-Wextra
259 +else
260 + WEXTRA=-W
261 +fi
262 +
263 +
264 +{ $as_echo "$as_me:$LINENO: checking for -fgnu89-inline option to $CC" >&5
265 +$as_echo_n "checking for -fgnu89-inline option to $CC... " >&6; }
266 +if test "${ac_cv_cc_gnu89_inline+set}" = set; then
267 + $as_echo_n "(cached) " >&6
268 +else
269 + old_CFLAGS="$CFLAGS"
270 +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
271 +cat >conftest.$ac_ext <<_ACEOF
272 +
273 +void foo (void)
274 +{
275 + inline void bar (void) {}
276 + bar ();
277 +}
278 +extern inline void baz (void) {}
279 +
280 +_ACEOF
281 +rm -f conftest.$ac_objext
282 +if { (ac_try="$ac_compile"
283 +case "(($ac_try" in
284 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
285 + *) ac_try_echo=$ac_try;;
286 +esac
287 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
288 +$as_echo "$ac_try_echo") >&5
289 + (eval "$ac_compile") 2>conftest.er1
290 + ac_status=$?
291 + grep -v '^ *+' conftest.er1 >conftest.err
292 + rm -f conftest.er1
293 + cat conftest.err >&5
294 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
295 + (exit $ac_status); } && {
296 + test -z "$ac_c_werror_flag" ||
297 + test ! -s conftest.err
298 + } && test -s conftest.$ac_objext; then
299 + ac_cv_cc_gnu89_inline=yes
300 +else
301 + $as_echo "$as_me: failed program was:" >&5
302 +sed 's/^/| /' conftest.$ac_ext >&5
303 +
304 + ac_cv_cc_gnu89_inline=no
305 +fi
306 +
307 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
308 +CFLAGS="$old_CFLAGS"
309 +fi
310 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cc_gnu89_inline" >&5
311 +$as_echo "$ac_cv_cc_gnu89_inline" >&6; }
312 +if test "x$ac_cv_cc_gnu89_inline" = xyes; then
313 + WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"
314 +fi
315 +
316 +
317 +{ $as_echo "$as_me:$LINENO: checking for --as-needed linker option" >&5
318 +$as_echo_n "checking for --as-needed linker option... " >&6; }
319 +if test "${ac_cv_as_needed+set}" = set; then
320 + $as_echo_n "(cached) " >&6
321 +else
322 + cat > conftest.c <<EOF
323 +int main (void) { return 0; }
324 +EOF
325 +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
326 + -fPIC -shared -o conftest.so conftest.c
327 + -Wl,--as-needed 1>&5'
328 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
329 + (eval $ac_try) 2>&5
330 + ac_status=$?
331 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
332 + (exit $ac_status); }; }
333 +then
334 + ac_cv_as_needed=yes
335 +else
336 + ac_cv_as_needed=no
337 +fi
338 +rm -f conftest*
339 +fi
340 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_as_needed" >&5
341 +$as_echo "$ac_cv_as_needed" >&6; }
342 +if test "x$ac_cv_as_needed" = xyes; then
343 + LD_AS_NEEDED=-Wl,--as-needed
344 +else
345 + LD_AS_NEEDED=
346 +fi
347 +
348 +
349 +
350 +{ $as_echo "$as_me:$LINENO: checking for __builtin_popcount" >&5
351 +$as_echo_n "checking for __builtin_popcount... " >&6; }
352 +if test "${ac_cv_popcount+set}" = set; then
353 + $as_echo_n "(cached) " >&6
354 +else
355 + cat >conftest.$ac_ext <<_ACEOF
356 +/* confdefs.h. */
357 +_ACEOF
358 +cat confdefs.h >>conftest.$ac_ext
359 +cat >>conftest.$ac_ext <<_ACEOF
360 +/* end confdefs.h. */
361 +
362 +int
363 +main ()
364 +{
365 +exit (__builtin_popcount (127));
366 + ;
367 + return 0;
368 +}
369 +_ACEOF
370 +rm -f conftest.$ac_objext conftest$ac_exeext
371 +if { (ac_try="$ac_link"
372 +case "(($ac_try" in
373 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
374 + *) ac_try_echo=$ac_try;;
375 +esac
376 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
377 +$as_echo "$ac_try_echo") >&5
378 + (eval "$ac_link") 2>conftest.er1
379 + ac_status=$?
380 + grep -v '^ *+' conftest.er1 >conftest.err
381 + rm -f conftest.er1
382 + cat conftest.err >&5
383 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
384 + (exit $ac_status); } && {
385 + test -z "$ac_c_werror_flag" ||
386 + test ! -s conftest.err
387 + } && test -s conftest$ac_exeext && {
388 + test "$cross_compiling" = yes ||
389 + $as_test_x conftest$ac_exeext
390 + }; then
391 + ac_cv_popcount=yes
392 +else
393 + $as_echo "$as_me: failed program was:" >&5
394 +sed 's/^/| /' conftest.$ac_ext >&5
395 +
396 + ac_cv_popcount=no
397 +fi
398 +
399 +rm -rf conftest.dSYM
400 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
401 + conftest$ac_exeext conftest.$ac_ext
402 +fi
403 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_popcount" >&5
404 +$as_echo "$ac_cv_popcount" >&6; }
405 +if test "x$ac_cv_popcount" = xyes; then
406 +
407 +cat >>confdefs.h <<\_ACEOF
408 +#define HAVE_BUILTIN_POPCOUNT 1
409 +_ACEOF
410 +
411 +fi
412 +
413 +
414 { $as_echo "$as_me:$LINENO: checking for __thread support" >&5
415 $as_echo_n "checking for __thread support... " >&6; }
416 if test "${ac_cv_tls+set}" = set; then
417 @@ -4163,9 +4364,18 @@ fi
418 { $as_echo "$as_me:$LINENO: result: $ac_cv_tls" >&5
419 $as_echo "$ac_cv_tls" >&6; }
420 if test "x$ac_cv_tls" != xyes; then
421 - { { $as_echo "$as_me:$LINENO: error: __thread support required" >&5
422 -$as_echo "$as_me: error: __thread support required" >&2;}
423 + if test "$use_locks" = yes; then
424 + { { $as_echo "$as_me:$LINENO: error: --enable-thread-safety requires __thread support" >&5
425 +$as_echo "$as_me: error: --enable-thread-safety requires __thread support" >&2;}
426 { (exit 1); exit 1; }; }
427 +else
428 +
429 +cat >>confdefs.h <<\_ACEOF
430 +#define __thread /* empty: no multi-thread support */
431 +_ACEOF
432 +
433 +fi
434 +
435 fi
436
437
438 @@ -5454,7 +5664,7 @@ ac_config_files="$ac_config_files versio
439
440 # 1.234<whatever> -> 1234<whatever>
441 case "$PACKAGE_VERSION" in
442 -[0-9].*) eu_version="${PACKAGE_VERSION/./}" ;;
443 +[0-9].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
444 *) { { $as_echo "$as_me:$LINENO: error: confused by version number '$PACKAGE_VERSION'" >&5
445 $as_echo "$as_me: error: confused by version number '$PACKAGE_VERSION'" >&2;}
446 { (exit 1); exit 1; }; } ;;
447 @@ -5489,7 +5699,7 @@ $as_echo "$as_me: error: confused by ver
448 esac
449
450 # Round up to the next release API (x.y) version.
451 -eu_version=$[($eu_version + 999) / 1000]
452 +eu_version=`expr \( $eu_version + 999 \) / 1000`
453
454 cat >confcache <<\_ACEOF
455 # This file is a shell script that caches the results of configure
456 --- a/configure.ac
457 +++ b/configure.ac
458 @@ -73,6 +73,54 @@ CFLAGS="$old_CFLAGS"])
459 AS_IF([test "x$ac_cv_c99" != xyes],
460 AC_MSG_ERROR([gcc with C99 support required]))
461
462 +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
463 +old_CFLAGS="$CFLAGS"
464 +CFLAGS="$CFLAGS -Wextra"
465 +AC_COMPILE_IFELSE([void foo (void) { }],
466 + ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
467 +CFLAGS="$old_CFLAGS"])
468 +AC_SUBST(WEXTRA)
469 +AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
470 +
471 +AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
472 +old_CFLAGS="$CFLAGS"
473 +CFLAGS="$CFLAGS -fgnu89-inline -Werror"
474 +AC_COMPILE_IFELSE([
475 +void foo (void)
476 +{
477 + inline void bar (void) {}
478 + bar ();
479 +}
480 +extern inline void baz (void) {}
481 +], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
482 +CFLAGS="$old_CFLAGS"])
483 +AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
484 + [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
485 +
486 +AC_CACHE_CHECK([for --as-needed linker option],
487 + ac_cv_as_needed, [dnl
488 +cat > conftest.c <<EOF
489 +int main (void) { return 0; }
490 +EOF
491 +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
492 + -fPIC -shared -o conftest.so conftest.c
493 + -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
494 +then
495 + ac_cv_as_needed=yes
496 +else
497 + ac_cv_as_needed=no
498 +fi
499 +rm -f conftest*])
500 +AS_IF([test "x$ac_cv_as_needed" = xyes],
501 + [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
502 +AC_SUBST(LD_AS_NEEDED)
503 +
504 +AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
505 +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
506 + ac_cv_popcount=yes, ac_cv_popcount=no)])
507 +AS_IF([test "x$ac_cv_popcount" = xyes],
508 + [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
509 +
510 AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
511 # Use the same flags that we use for our DSOs, so the test is representative.
512 # Some old compiler/linker/libc combinations fail some ways and not others.
513 @@ -88,7 +136,10 @@ static __thread int a; int foo (int b) {
514 CFLAGS="$save_CFLAGS"
515 LDFLAGS="$save_LDFLAGS"])
516 AS_IF([test "x$ac_cv_tls" != xyes],
517 - AC_MSG_ERROR([__thread support required]))
518 + [AS_IF([test "$use_locks" = yes],
519 + [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
520 + [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
521 + [Stubbed out if missing compiler support.])])])
522
523 dnl This test must come as early as possible after the compiler configuration
524 dnl tests, because the choice of the file model can (in principle) affect
525 @@ -251,7 +302,7 @@ AC_SUBST([eu_version])
526
527 # 1.234<whatever> -> 1234<whatever>
528 case "$PACKAGE_VERSION" in
529 -[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
530 +[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
531 *) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
532 esac
533 case "$eu_version" in
534 @@ -280,6 +331,6 @@ case "$eu_version" in
535 esac
536
537 # Round up to the next release API (x.y) version.
538 -[eu_version=$[($eu_version + 999) / 1000]]
539 +eu_version=`expr \( $eu_version + 999 \) / 1000`
540
541 AC_OUTPUT
542 --- a/lib/ChangeLog
543 +++ b/lib/ChangeLog
544 @@ -8,6 +8,9 @@
545
546 2009-01-23 Roland McGrath <roland@redhat.com>
547
548 + * eu-config.h [! HAVE_BUILTIN_POPCOUNT]
549 + (__builtin_popcount): New inline function.
550 +
551 * eu-config.h: Add multiple inclusion protection.
552
553 2009-01-17 Ulrich Drepper <drepper@redhat.com>
554 @@ -64,6 +67,11 @@
555 * Makefile.am (libeu_a_SOURCES): Add it.
556 * system.h: Declare crc32_file.
557
558 +2005-02-07 Roland McGrath <roland@redhat.com>
559 +
560 + * Makefile.am (WEXTRA): New variable, substituted by configure.
561 + (AM_CFLAGS): Use it in place of -Wextra.
562 +
563 2005-04-30 Ulrich Drepper <drepper@redhat.com>
564
565 * Makefile.am: Use -ffunction-sections for xmalloc.c.
566 --- a/lib/eu-config.h
567 +++ b/lib/eu-config.h
568 @@ -182,6 +182,17 @@ asm (".section predict_data, \"aw\"; .pr
569 /* This macro is used by the tests conditionalize for standalone building. */
570 #define ELFUTILS_HEADER(name) <lib##name.h>
571
572 +#ifndef HAVE_BUILTIN_POPCOUNT
573 +# define __builtin_popcount hakmem_popcount
574 +static inline unsigned int __attribute__ ((unused))
575 +hakmem_popcount (unsigned int x)
576 +{
577 + /* HAKMEM 169 */
578 + unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
579 + return ((n + (n >> 3)) & 030707070707) % 63;
580 +}
581 +#endif /* HAVE_BUILTIN_POPCOUNT */
582 +
583
584 #ifdef SHARED
585 # define OLD_VERSION(name, version) \
586 --- a/lib/Makefile.in
587 +++ b/lib/Makefile.in
588 @@ -99,6 +99,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
589 INSTALL_SCRIPT = @INSTALL_SCRIPT@
590 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
591 LDFLAGS = @LDFLAGS@
592 +LD_AS_NEEDED = @LD_AS_NEEDED@
593 LEX = @LEX@
594 LEXLIB = @LEXLIB@
595 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
596 @@ -127,6 +128,7 @@ SHELL = @SHELL@
597 STRIP = @STRIP@
598 USE_NLS = @USE_NLS@
599 VERSION = @VERSION@
600 +WEXTRA = @WEXTRA@
601 XGETTEXT = @XGETTEXT@
602 XGETTEXT_015 = @XGETTEXT_015@
603 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
604 @@ -189,7 +191,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
605 -I$(srcdir)/../libelf
606 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
607 $($(*F)_no_Werror),,-Werror) $(if \
608 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
609 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
610 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
611 $(am__append_1) -fpic
612 @MUDFLAP_FALSE@libmudflap =
613 --- a/libasm/ChangeLog
614 +++ b/libasm/ChangeLog
615 @@ -67,6 +67,11 @@
616 * asm_error.c: Add new error ASM_E_IOERROR.
617 * libasmP.h: Add ASM_E_IOERROR definition.
618
619 +2005-05-31 Roland McGrath <roland@redhat.com>
620 +
621 + * Makefile.am (WEXTRA): New variable, substituted by configure.
622 + (AM_CFLAGS): Use it in place of -Wextra.
623 +
624 2005-02-15 Ulrich Drepper <drepper@redhat.com>
625
626 * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
627 --- a/libasm/Makefile.in
628 +++ b/libasm/Makefile.in
629 @@ -147,6 +147,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
630 INSTALL_SCRIPT = @INSTALL_SCRIPT@
631 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
632 LDFLAGS = @LDFLAGS@
633 +LD_AS_NEEDED = @LD_AS_NEEDED@
634 LEX = @LEX@
635 LEXLIB = @LEXLIB@
636 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
637 @@ -175,6 +176,7 @@ SHELL = @SHELL@
638 STRIP = @STRIP@
639 USE_NLS = @USE_NLS@
640 VERSION = 1
641 +WEXTRA = @WEXTRA@
642 XGETTEXT = @XGETTEXT@
643 XGETTEXT_015 = @XGETTEXT_015@
644 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
645 @@ -238,7 +240,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
646 -I$(top_srcdir)/libdw
647 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
648 $($(*F)_no_Werror),,-Werror) $(if \
649 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
650 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
651 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
652 $(am__append_1)
653 @MUDFLAP_FALSE@libmudflap =
654 --- a/libcpu/ChangeLog
655 +++ b/libcpu/ChangeLog
656 @@ -9,6 +9,9 @@
657
658 2009-01-23 Roland McGrath <roland@redhat.com>
659
660 + * i386_disasm.c (i386_disasm): Add abort after assert-constant for old
661 + compilers that don't realize it's noreturn.
662 +
663 * Makefile.am (i386_parse_CFLAGS): Use quotes around command
664 substitution that can produce leading whitespace.
665
666 @@ -338,6 +341,11 @@
667 * defs/i386.doc: New file.
668 * defs/x86_64: New file.
669
670 +2005-04-04 Roland McGrath <roland@redhat.com>
671 +
672 + * Makefile.am (WEXTRA): New variable, substituted by configure.
673 + (AM_CFLAGS): Use it instead of -Wextra.
674 +
675 2005-02-15 Ulrich Drepper <drepper@redhat.com>
676
677 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
678 --- a/libcpu/i386_disasm.c
679 +++ b/libcpu/i386_disasm.c
680 @@ -791,6 +791,7 @@ i386_disasm (const uint8_t **startp, con
681
682 default:
683 assert (! "INVALID not handled");
684 + abort ();
685 }
686 }
687 else
688 --- a/libcpu/Makefile.in
689 +++ b/libcpu/Makefile.in
690 @@ -116,6 +116,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
691 INSTALL_SCRIPT = @INSTALL_SCRIPT@
692 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
693 LDFLAGS = @LDFLAGS@
694 +LD_AS_NEEDED = @LD_AS_NEEDED@
695 LEX = @LEX@
696 LEXLIB = @LEXLIB@
697 LEX_OUTPUT_ROOT = lex.$(<F:lex.l=)
698 @@ -144,6 +145,7 @@ SHELL = @SHELL@
699 STRIP = @STRIP@
700 USE_NLS = @USE_NLS@
701 VERSION = @VERSION@
702 +WEXTRA = @WEXTRA@
703 XGETTEXT = @XGETTEXT@
704 XGETTEXT_015 = @XGETTEXT_015@
705 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
706 @@ -207,7 +209,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
707 -I$(srcdir)/../libdw -I$(srcdir)/../libasm
708 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
709 $($(*F)_no_Werror),,-Werror) $(if \
710 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
711 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
712 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
713 $(am__append_1) -fpic -fdollars-in-identifiers
714 @MUDFLAP_FALSE@libmudflap =
715 --- a/libdw/ChangeLog
716 +++ b/libdw/ChangeLog
717 @@ -82,6 +82,10 @@
718
719 * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
720
721 +2009-08-17 Roland McGrath <roland@redhat.com>
722 +
723 + * libdw.h: Disable extern inlines for GCC 4.2.
724 +
725 2009-08-10 Roland McGrath <roland@redhat.com>
726
727 * dwarf_getscopevar.c: Use dwarf_diename.
728 @@ -850,6 +854,11 @@
729
730 2005-05-31 Roland McGrath <roland@redhat.com>
731
732 + * Makefile.am (WEXTRA): New variable, substituted by configure.
733 + (AM_CFLAGS): Use it in place of -Wextra.
734 +
735 +2005-05-31 Roland McGrath <roland@redhat.com>
736 +
737 * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
738 formref offset.
739
740 --- a/libdw/libdw.h
741 +++ b/libdw/libdw.h
742 @@ -814,7 +814,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (
743
744
745 /* Inline optimizations. */
746 -#ifdef __OPTIMIZE__
747 +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
748 /* Return attribute code of given attribute. */
749 __libdw_extern_inline unsigned int
750 dwarf_whatattr (Dwarf_Attribute *attr)
751 --- a/libdw/Makefile.in
752 +++ b/libdw/Makefile.in
753 @@ -189,6 +189,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
754 INSTALL_SCRIPT = @INSTALL_SCRIPT@
755 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
756 LDFLAGS = @LDFLAGS@
757 +LD_AS_NEEDED = @LD_AS_NEEDED@
758 LEX = @LEX@
759 LEXLIB = @LEXLIB@
760 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
761 @@ -217,6 +218,7 @@ SHELL = @SHELL@
762 STRIP = @STRIP@
763 USE_NLS = @USE_NLS@
764 VERSION = 1
765 +WEXTRA = @WEXTRA@
766 XGETTEXT = @XGETTEXT@
767 XGETTEXT_015 = @XGETTEXT_015@
768 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
769 @@ -279,7 +281,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
770 -I$(srcdir)/../libelf
771 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
772 $($(*F)_no_Werror),,-Werror) $(if \
773 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
774 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
775 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
776 $(am__append_1) $(am__append_2)
777 @MUDFLAP_FALSE@libmudflap =
778 --- a/libdwfl/ChangeLog
779 +++ b/libdwfl/ChangeLog
780 @@ -1207,6 +1207,11 @@
781
782 2005-07-21 Roland McGrath <roland@redhat.com>
783
784 + * Makefile.am (WEXTRA): New variable, substituted by configure.
785 + (AM_CFLAGS): Use it in place of -Wextra.
786 +
787 +2005-07-21 Roland McGrath <roland@redhat.com>
788 +
789 * Makefile.am (noinst_HEADERS): Add loc2c.c.
790
791 * test2.c (main): Check sscanf result to quiet warning.
792 --- a/libdwfl/Makefile.in
793 +++ b/libdwfl/Makefile.in
794 @@ -181,6 +181,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
795 INSTALL_SCRIPT = @INSTALL_SCRIPT@
796 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
797 LDFLAGS = @LDFLAGS@
798 +LD_AS_NEEDED = @LD_AS_NEEDED@
799 LEX = @LEX@
800 LEXLIB = @LEXLIB@
801 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
802 @@ -209,6 +210,7 @@ SHELL = @SHELL@
803 STRIP = @STRIP@
804 USE_NLS = @USE_NLS@
805 VERSION = 1
806 +WEXTRA = @WEXTRA@
807 XGETTEXT = @XGETTEXT@
808 XGETTEXT_015 = @XGETTEXT_015@
809 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
810 @@ -272,7 +274,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
811 -I$(srcdir)/../libdw
812 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
813 $($(*F)_no_Werror),,-Werror) $(if \
814 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
815 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
816 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
817 $(am__append_1)
818 @MUDFLAP_FALSE@libmudflap =
819 --- a/libebl/ChangeLog
820 +++ b/libebl/ChangeLog
821 @@ -624,6 +624,11 @@
822 * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
823 tracking works right.
824
825 +2005-05-31 Roland McGrath <roland@redhat.com>
826 +
827 + * Makefile.am (WEXTRA): New variable, substituted by configure.
828 + (AM_CFLAGS): Use it in place of -Wextra.
829 +
830 2005-05-21 Ulrich Drepper <drepper@redhat.com>
831
832 * libebl_x86_64.map: Add x86_64_core_note.
833 --- a/libebl/Makefile.in
834 +++ b/libebl/Makefile.in
835 @@ -143,6 +143,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
836 INSTALL_SCRIPT = @INSTALL_SCRIPT@
837 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
838 LDFLAGS = @LDFLAGS@
839 +LD_AS_NEEDED = @LD_AS_NEEDED@
840 LEX = @LEX@
841 LEXLIB = @LEXLIB@
842 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
843 @@ -171,6 +172,7 @@ SHELL = @SHELL@
844 STRIP = @STRIP@
845 USE_NLS = @USE_NLS@
846 VERSION = 1
847 +WEXTRA = @WEXTRA@
848 XGETTEXT = @XGETTEXT@
849 XGETTEXT_015 = @XGETTEXT_015@
850 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
851 @@ -234,7 +236,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
852 -I$(srcdir)/../libasm
853 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
854 $($(*F)_no_Werror),,-Werror) $(if \
855 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
856 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
857 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
858 $(am__append_1) -fpic
859 @MUDFLAP_FALSE@libmudflap =
860 --- a/libelf/ChangeLog
861 +++ b/libelf/ChangeLog
862 @@ -651,6 +651,11 @@
863
864 * elf.h: Update from glibc.
865
866 +2005-05-31 Roland McGrath <roland@redhat.com>
867 +
868 + * Makefile.am (WEXTRA): New variable, substituted by configure.
869 + (AM_CFLAGS): Use it in place of -Wextra.
870 +
871 2005-05-08 Roland McGrath <roland@redhat.com>
872
873 * elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
874 --- a/libelf/common.h
875 +++ b/libelf/common.h
876 @@ -160,7 +160,7 @@ libelf_release_all (Elf *elf)
877 (Var) = (sizeof (Var) == 1 \
878 ? (unsigned char) (Var) \
879 : (sizeof (Var) == 2 \
880 - ? bswap_16 (Var) \
881 + ? (unsigned short int) bswap_16 (Var) \
882 : (sizeof (Var) == 4 \
883 ? bswap_32 (Var) \
884 : bswap_64 (Var))))
885 @@ -169,7 +169,7 @@ libelf_release_all (Elf *elf)
886 (Dst) = (sizeof (Var) == 1 \
887 ? (unsigned char) (Var) \
888 : (sizeof (Var) == 2 \
889 - ? bswap_16 (Var) \
890 + ? (unsigned short int) bswap_16 (Var) \
891 : (sizeof (Var) == 4 \
892 ? bswap_32 (Var) \
893 : bswap_64 (Var))))
894 --- a/libelf/Makefile.in
895 +++ b/libelf/Makefile.in
896 @@ -189,6 +189,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
897 INSTALL_SCRIPT = @INSTALL_SCRIPT@
898 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
899 LDFLAGS = @LDFLAGS@
900 +LD_AS_NEEDED = @LD_AS_NEEDED@
901 LEX = @LEX@
902 LEXLIB = @LEXLIB@
903 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
904 @@ -217,6 +218,7 @@ SHELL = @SHELL@
905 STRIP = @STRIP@
906 USE_NLS = @USE_NLS@
907 VERSION = 1
908 +WEXTRA = @WEXTRA@
909 XGETTEXT = @XGETTEXT@
910 XGETTEXT_015 = @XGETTEXT_015@
911 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
912 @@ -278,7 +280,7 @@ zip_LIBS = @zip_LIBS@
913 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
914 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
915 $($(*F)_no_Werror),,-Werror) $(if \
916 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
917 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
918 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
919 $(am__append_1) $(am__append_2)
920 @MUDFLAP_FALSE@libmudflap =
921 --- a/m4/Makefile.in
922 +++ b/m4/Makefile.in
923 @@ -75,6 +75,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
924 INSTALL_SCRIPT = @INSTALL_SCRIPT@
925 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
926 LDFLAGS = @LDFLAGS@
927 +LD_AS_NEEDED = @LD_AS_NEEDED@
928 LEX = @LEX@
929 LEXLIB = @LEXLIB@
930 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
931 @@ -103,6 +104,7 @@ SHELL = @SHELL@
932 STRIP = @STRIP@
933 USE_NLS = @USE_NLS@
934 VERSION = @VERSION@
935 +WEXTRA = @WEXTRA@
936 XGETTEXT = @XGETTEXT@
937 XGETTEXT_015 = @XGETTEXT_015@
938 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
939 --- a/Makefile.in
940 +++ b/Makefile.in
941 @@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
942 INSTALL_SCRIPT = @INSTALL_SCRIPT@
943 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
944 LDFLAGS = @LDFLAGS@
945 +LD_AS_NEEDED = @LD_AS_NEEDED@
946 LEX = @LEX@
947 LEXLIB = @LEXLIB@
948 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
949 @@ -183,6 +184,7 @@ SHELL = @SHELL@
950 STRIP = @STRIP@
951 USE_NLS = @USE_NLS@
952 VERSION = @VERSION@
953 +WEXTRA = @WEXTRA@
954 XGETTEXT = @XGETTEXT@
955 XGETTEXT_015 = @XGETTEXT_015@
956 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
957 --- a/src/addr2line.c
958 +++ b/src/addr2line.c
959 @@ -447,10 +447,10 @@ handle_address (const char *string, Dwfl
960 bool parsed = false;
961 int n;
962 char *name = NULL;
963 - if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2
964 + if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2
965 && string[n] == '\0')
966 parsed = adjust_to_section (name, &addr, dwfl);
967 - else if (sscanf (string, "%m[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2
968 + else if (sscanf (string, "%a[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2
969 && string[n] == '\0')
970 {
971 /* It was symbol+offset. */
972 --- a/src/ChangeLog
973 +++ b/src/ChangeLog
974 @@ -98,8 +98,16 @@
975 * readelf.c (attr_callback): Use print_block only when we don't use
976 print_ops.
977
978 +2009-08-17 Roland McGrath <roland@redhat.com>
979 +
980 + * ld.h: Disable extern inlines for GCC 4.2.
981 +
982 2009-08-14 Roland McGrath <roland@redhat.com>
983
984 + * strings.c (read_block): Conditionalize posix_fadvise use
985 + on [POSIX_FADV_SEQUENTIAL].
986 + From Petr Salinger <Petr.Salinger@seznam.cz>.
987 +
988 * ar.c (do_oper_extract): Use pathconf instead of statfs.
989
990 2009-08-01 Ulrich Drepper <drepper@redhat.com>
991 @@ -263,6 +271,8 @@
992 * readelf.c (print_debug_frame_section): Use t instead of j formats
993 for ptrdiff_t OFFSET.
994
995 + * addr2line.c (handle_address): Use %a instead of %m for compatibility.
996 +
997 2009-01-21 Ulrich Drepper <drepper@redhat.com>
998
999 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
1000 @@ -446,6 +456,11 @@
1001 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
1002 is valid in RELRO.
1003
1004 +2008-03-01 Roland McGrath <roland@redhat.com>
1005 +
1006 + * readelf.c (dump_archive_index): Tweak portability hack
1007 + to match [__GNUC__ < 4] too.
1008 +
1009 2008-02-29 Roland McGrath <roland@redhat.com>
1010
1011 * readelf.c (print_attributes): Add a cast.
1012 @@ -697,6 +712,8 @@
1013
1014 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
1015
1016 + * Makefile.am (readelf_no_Werror): New variable.
1017 +
1018 2007-10-15 Roland McGrath <roland@redhat.com>
1019
1020 * make-debug-archive.in: New file.
1021 @@ -1136,6 +1153,10 @@
1022 * elflint.c (valid_e_machine): Add EM_ALPHA.
1023 Reported by Christian Aichinger <Greek0@gmx.net>.
1024
1025 + * strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
1026 + MADV_SEQUENTIAL if undefined. Don't call posix_madvise
1027 + if neither is defined.
1028 +
1029 2006-08-08 Ulrich Drepper <drepper@redhat.com>
1030
1031 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
1032 @@ -1212,6 +1233,10 @@
1033 * Makefile.am: Add hacks to create dependency files for non-generic
1034 linker.
1035
1036 +2006-04-05 Roland McGrath <roland@redhat.com>
1037 +
1038 + * strings.c (MAP_POPULATE): Define to 0 if undefined.
1039 +
1040 2006-06-12 Ulrich Drepper <drepper@redhat.com>
1041
1042 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
1043 @@ -1560,6 +1585,11 @@
1044 * readelf.c (print_debug_loc_section): Fix indentation for larger
1045 address size.
1046
1047 +2005-05-31 Roland McGrath <roland@redhat.com>
1048 +
1049 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1050 + (AM_CFLAGS): Use it in place of -Wextra.
1051 +
1052 2005-05-30 Roland McGrath <roland@redhat.com>
1053
1054 * readelf.c (print_debug_line_section): Print section offset of each
1055 --- a/src/findtextrel.c
1056 +++ b/src/findtextrel.c
1057 @@ -490,7 +490,11 @@ ptrcompare (const void *p1, const void *
1058
1059
1060 static void
1061 -check_rel (size_t nsegments, struct segments segments[nsegments],
1062 +check_rel (size_t nsegments, struct segments segments[
1063 +#if __GNUC__ >= 4
1064 + nsegments
1065 +#endif
1066 + ],
1067 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
1068 const char *fname, bool more_than_one, void **knownsrcs)
1069 {
1070 --- a/src/ld.h
1071 +++ b/src/ld.h
1072 @@ -1122,6 +1122,7 @@ extern bool dynamically_linked_p (void);
1073
1074 /* Checked whether the symbol is undefined and referenced from a DSO. */
1075 extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
1076 +#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
1077 #ifdef __GNUC_STDC_INLINE__
1078 __attribute__ ((__gnu_inline__))
1079 #endif
1080 @@ -1139,5 +1140,6 @@ linked_from_dso_p (struct scninfo *scnin
1081
1082 return sym->defined && sym->in_dso;
1083 }
1084 +#endif /* Optimizing and not GCC 4.2. */
1085
1086 #endif /* ld.h */
1087 --- a/src/Makefile.am
1088 +++ b/src/Makefile.am
1089 @@ -99,6 +99,9 @@ addr2line_no_Wformat = yes
1090 # XXX While the file is not finished, don't warn about this
1091 ldgeneric_no_Wunused = yes
1092
1093 +# Buggy old compilers.
1094 +readelf_no_Werror = yes
1095 +
1096 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1097 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1098 size_LDADD = $(libelf) $(libeu) $(libmudflap)
1099 --- a/src/Makefile.in
1100 +++ b/src/Makefile.in
1101 @@ -228,6 +228,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
1102 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1103 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1104 LDFLAGS = @LDFLAGS@
1105 +LD_AS_NEEDED = @LD_AS_NEEDED@
1106 LEX = @LEX@
1107 LEXLIB = @LEXLIB@
1108 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1109 @@ -256,6 +257,7 @@ SHELL = @SHELL@
1110 STRIP = @STRIP@
1111 USE_NLS = @USE_NLS@
1112 VERSION = @VERSION@
1113 +WEXTRA = @WEXTRA@
1114 XGETTEXT = @XGETTEXT@
1115 XGETTEXT_015 = @XGETTEXT_015@
1116 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1117 @@ -320,7 +322,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi
1118 -I$(srcdir)/../libasm
1119 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1120 $($(*F)_no_Werror),,-Werror) $(if \
1121 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1122 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1123 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1124 $(am__append_1)
1125 @MUDFLAP_FALSE@libmudflap =
1126 @@ -367,6 +369,9 @@ strings_no_Wformat = yes
1127 addr2line_no_Wformat = yes
1128 # XXX While the file is not finished, don't warn about this
1129 ldgeneric_no_Wunused = yes
1130 +
1131 +# Buggy old compilers.
1132 +readelf_no_Werror = yes
1133 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1134 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
1135 size_LDADD = $(libelf) $(libeu) $(libmudflap)
1136 --- a/src/readelf.c
1137 +++ b/src/readelf.c
1138 @@ -7655,7 +7655,7 @@ dump_archive_index (Elf *elf, const char
1139 if (unlikely (elf_rand (elf, as_off) == 0)
1140 || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
1141 == NULL))
1142 -#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
1143 +#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
1144 while (1)
1145 #endif
1146 error (EXIT_FAILURE, 0,
1147 --- a/src/strings.c
1148 +++ b/src/strings.c
1149 @@ -51,6 +51,10 @@
1150
1151 #include <system.h>
1152
1153 +#ifndef MAP_POPULATE
1154 +# define MAP_POPULATE 0
1155 +#endif
1156 +
1157
1158 /* Prototypes of local functions. */
1159 static int read_fd (int fd, const char *fname, off64_t fdlen);
1160 @@ -491,8 +495,13 @@ map_file (int fd, off64_t start_off, off
1161 fd, start_off);
1162 if (mem != MAP_FAILED)
1163 {
1164 +#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
1165 +# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
1166 +#endif
1167 +#ifdef POSIX_MADV_SEQUENTIAL
1168 /* We will go through the mapping sequentially. */
1169 (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
1170 +#endif
1171 break;
1172 }
1173 if (errno != EINVAL && errno != ENOMEM)
1174 @@ -586,9 +595,11 @@ read_block (int fd, const char *fname, o
1175 elfmap_off = from & ~(ps - 1);
1176 elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
1177
1178 +#ifdef POSIX_FADV_SEQUENTIAL
1179 if (unlikely (elfmap == MAP_FAILED))
1180 /* Let the kernel know we are going to read everything in sequence. */
1181 (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
1182 +#endif
1183 }
1184
1185 if (unlikely (elfmap == MAP_FAILED))
1186 --- a/src/strip.c
1187 +++ b/src/strip.c
1188 @@ -53,6 +53,12 @@
1189 #include <libebl.h>
1190 #include <system.h>
1191
1192 +#ifdef HAVE_FUTIMES
1193 +# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
1194 +#else
1195 +# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
1196 +#endif
1197 +
1198
1199 /* Name and version of program. */
1200 static void print_version (FILE *stream, struct argp_state *state);
1201 @@ -301,8 +307,18 @@ process_file (const char *fname)
1202
1203 /* If we have to preserve the timestamp, we need it in the
1204 format utimes() understands. */
1205 +#ifdef HAVE_STRUCT_STAT_ST_ATIM
1206 TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
1207 +#else
1208 + tv[0].tv_sec = pre_st.st_atime;
1209 + tv[0].tv_usec = 0;
1210 +#endif
1211 +#ifdef HAVE_STRUCT_STAT_ST_MTIM
1212 TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
1213 +#else
1214 + tv[1].tv_sec = pre_st.st_atime;
1215 + tv[1].tv_usec = 0;
1216 +#endif
1217 }
1218
1219 /* Open the file. */
1220 @@ -1747,7 +1763,7 @@ handle_elf (int fd, Elf *elf, const char
1221 /* If requested, preserve the timestamp. */
1222 if (tvp != NULL)
1223 {
1224 - if (futimes (fd, tvp) != 0)
1225 + if (FUTIMES (fd, output_fname, tvp) != 0)
1226 {
1227 error (0, errno, gettext ("\
1228 cannot set access and modification date of '%s'"),
1229 @@ -1804,7 +1820,7 @@ handle_ar (int fd, Elf *elf, const char
1230
1231 if (tvp != NULL)
1232 {
1233 - if (unlikely (futimes (fd, tvp) != 0))
1234 + if (unlikely (FUTIMES (fd, fname, tvp) != 0))
1235 {
1236 error (0, errno, gettext ("\
1237 cannot set access and modification date of '%s'"), fname);
1238 --- a/tests/ChangeLog
1239 +++ b/tests/ChangeLog
1240 @@ -150,6 +150,8 @@
1241
1242 2008-01-21 Roland McGrath <roland@redhat.com>
1243
1244 + * line2addr.c (main): Revert last change.
1245 +
1246 * testfile45.S.bz2: Add tests for cltq, cqto.
1247 * testfile45.expect.bz2: Adjust.
1248
1249 @@ -858,6 +860,11 @@
1250 * Makefile.am (TESTS): Add run-elflint-test.sh.
1251 (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
1252
1253 +2005-05-31 Roland McGrath <roland@redhat.com>
1254 +
1255 + * Makefile.am (WEXTRA): New variable, substituted by configure.
1256 + (AM_CFLAGS): Use it in place of -Wextra.
1257 +
1258 2005-05-24 Ulrich Drepper <drepper@redhat.com>
1259
1260 * get-files.c (main): Use correct format specifier.
1261 --- a/tests/line2addr.c
1262 +++ b/tests/line2addr.c
1263 @@ -132,7 +132,7 @@ main (int argc, char *argv[])
1264 {
1265 struct args a = { .arg = argv[cnt] };
1266
1267 - switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
1268 + switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
1269 {
1270 default:
1271 case 0:
1272 --- a/tests/Makefile.in
1273 +++ b/tests/Makefile.in
1274 @@ -372,6 +372,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
1275 INSTALL_SCRIPT = @INSTALL_SCRIPT@
1276 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
1277 LDFLAGS = @LDFLAGS@
1278 +LD_AS_NEEDED = @LD_AS_NEEDED@
1279 LEX = @LEX@
1280 LEXLIB = @LEXLIB@
1281 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
1282 @@ -400,6 +401,7 @@ SHELL = @SHELL@
1283 STRIP = @STRIP@
1284 USE_NLS = @USE_NLS@
1285 VERSION = @VERSION@
1286 +WEXTRA = @WEXTRA@
1287 XGETTEXT = @XGETTEXT@
1288 XGETTEXT_015 = @XGETTEXT_015@
1289 XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
1290 @@ -461,7 +463,7 @@ zip_LIBS = @zip_LIBS@
1291 INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_2)
1292 AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \
1293 $($(*F)_no_Werror),,-Werror) $(if \
1294 - $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \
1295 + $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \
1296 $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \
1297 $(am__append_1)
1298 @MUDFLAP_FALSE@libmudflap =