4 +2005-02-07 Roland McGrath <roland@frob.com>
6 + * configure.ac (WEXTRA): Check for -Wextra and set this substitution.
8 +2003-08-12 Roland McGrath <roland@redhat.com>
10 + * configure.ac: Check for struct stat st_?tim members.
11 + * src/strip.c (process_file): Use st_?time if st_?tim are not there.
13 + * configure.ac: Check for futimes function.
14 + * src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
15 + (handle_ar) [! HAVE_FUTIMES]: Likewise.
17 2005-02-22 Ulrich Drepper <drepper@redhat.com>
19 * Makefile.am (all_SUBDIRS): Don't add doc subdir for now.
20 --- elfutils/Makefile.in
21 +++ elfutils/Makefile.in
22 @@ -127,6 +127,7 @@ SHELL = @SHELL@
30 --- elfutils/config/Makefile.in
31 +++ elfutils/config/Makefile.in
32 @@ -105,6 +105,7 @@ SHELL = @SHELL@
40 --- elfutils/configure
41 +++ elfutils/configure
42 @@ -277,7 +277,7 @@ PACKAGE_STRING='Red Hat elfutils 0.108'
43 PACKAGE_BUGREPORT='http://bugzilla.redhat.com/bugzilla/'
45 ac_unique_file="libelf/libelf.h"
46 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu MUDFLAP_TRUE MUDFLAP_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBOBJS LTLIBOBJS'
47 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC LEX LEXLIB LEX_OUTPUT_ROOT WEXTRA LOCALEDIR DATADIRNAME NATIVE_LD_TRUE NATIVE_LD_FALSE base_cpu MUDFLAP_TRUE MUDFLAP_FALSE USE_NLS MKINSTALLDIRS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBOBJS LTLIBOBJS'
50 # Initialize some variables set by options.
51 @@ -3373,6 +3373,58 @@ echo "$as_me: error: gcc with C99 suppor
55 +echo "$as_me:$LINENO: checking for -Wextra option to $CC" >&5
56 +echo $ECHO_N "checking for -Wextra option to $CC... $ECHO_C" >&6
57 +if test "${ac_cv_cc_wextra+set}" = set; then
58 + echo $ECHO_N "(cached) $ECHO_C" >&6
60 + old_CFLAGS="$CFLAGS"
61 +CFLAGS="$CFLAGS -Wextra"
62 +cat >conftest.$ac_ext <<_ACEOF
65 +rm -f conftest.$ac_objext
66 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
67 + (eval $ac_compile) 2>conftest.er1
69 + grep -v '^ *+' conftest.er1 >conftest.err
71 + cat conftest.err >&5
72 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
73 + (exit $ac_status); } &&
74 + { ac_try='test -z "$ac_c_werror_flag"
75 + || test ! -s conftest.err'
76 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
79 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
80 + (exit $ac_status); }; } &&
81 + { ac_try='test -s conftest.$ac_objext'
82 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
85 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
86 + (exit $ac_status); }; }; then
89 + echo "$as_me: failed program was:" >&5
90 +sed 's/^/| /' conftest.$ac_ext >&5
94 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
97 +echo "$as_me:$LINENO: result: $ac_cv_cc_wextra" >&5
98 +echo "${ECHO_T}$ac_cv_cc_wextra" >&6
100 +if test "x$ac_cv_cc_wextra" = yes; then
109 cat >>confdefs.h <<_ACEOF
110 @@ -4818,6 +4870,7 @@ s,@YACC@,$YACC,;t t
112 s,@LEXLIB@,$LEXLIB,;t t
113 s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
114 +s,@WEXTRA@,$WEXTRA,;t t
115 s,@LOCALEDIR@,$LOCALEDIR,;t t
116 s,@DATADIRNAME@,$DATADIRNAME,;t t
117 s,@NATIVE_LD_TRUE@,$NATIVE_LD_TRUE,;t t
118 --- elfutils/configure.ac
119 +++ elfutils/configure.ac
120 @@ -64,6 +64,15 @@ CFLAGS="$old_CFLAGS"])
121 AS_IF([test "x$ac_cv_c99" != xyes],
122 AC_MSG_ERROR([gcc with C99 support required]))
124 +AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
125 +old_CFLAGS="$CFLAGS"
126 +CFLAGS="$CFLAGS -Wextra"
127 +AC_COMPILE_IFELSE([void foo (void) { }],
128 + ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
129 +CFLAGS="$old_CFLAGS"])
131 +AS_IF([test "x$ac_cv_cc_wextra" = yes], [WEXTRA=-Wextra], [WEXTRA=-W])
135 AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
136 --- elfutils/lib/ChangeLog
137 +++ elfutils/lib/ChangeLog
139 * Makefile.am (libeu_a_SOURCES): Add it.
140 * system.h: Declare crc32_file.
142 +2005-02-07 Roland McGrath <roland@redhat.com>
144 + * Makefile.am (WEXTRA): New variable, substituted by configure.
145 + (AM_CFLAGS): Use it in place of -Wextra.
147 2005-04-30 Ulrich Drepper <drepper@redhat.com>
149 * Makefile.am: Use -ffunction-sections for xmalloc.c.
150 --- elfutils/lib/Makefile.am
151 +++ elfutils/lib/Makefile.am
153 ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
155 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
158 AM_CFLAGS = -fmudflap
162 -AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra $($(*F)_CFLAGS)
163 +AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS)
164 INCLUDES = -I$(srcdir)/../libelf -I..
166 noinst_LIBRARIES = libeu.a
167 --- elfutils/lib/Makefile.in
168 +++ elfutils/lib/Makefile.in
169 @@ -127,6 +127,7 @@ SHELL = @SHELL@
174 XGETTEXT = @XGETTEXT@
176 ac_ct_CC = @ac_ct_CC@
177 @@ -169,9 +170,9 @@ sharedstatedir = @sharedstatedir@
178 sysconfdir = @sysconfdir@
179 target_alias = @target_alias@
180 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
181 -@MUDFLAP_FALSE@ -Wextra $($(*F)_CFLAGS)
182 +@MUDFLAP_FALSE@ $(WEXTRA) $($(*F)_CFLAGS)
183 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
184 -@MUDFLAP_TRUE@ -Wunused -Wextra $($(*F)_CFLAGS)
185 +@MUDFLAP_TRUE@ -Wunused $(WEXTRA) $($(*F)_CFLAGS)
186 INCLUDES = -I$(srcdir)/../libelf -I..
187 noinst_LIBRARIES = libeu.a
188 libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
189 --- elfutils/libasm/Makefile.am
190 +++ elfutils/libasm/Makefile.am
192 ## 3001 King Ranch Road, Ukiah, CA 95482.
194 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
197 AM_CFLAGS = -fmudflap
201 -AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
202 +AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2
203 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
205 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
206 --- elfutils/libasm/Makefile.in
207 +++ elfutils/libasm/Makefile.in
208 @@ -159,6 +159,7 @@ SHELL = @SHELL@
213 XGETTEXT = @XGETTEXT@
215 ac_ct_CC = @ac_ct_CC@
216 @@ -200,10 +201,10 @@ sbindir = @sbindir@
217 sharedstatedir = @sharedstatedir@
218 sysconfdir = @sysconfdir@
219 target_alias = @target_alias@
220 -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused -Wextra \
221 +@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused $(WEXTRA) \
222 @MUDFLAP_FALSE@ -Wformat=2
223 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -Werror -Wunused \
224 -@MUDFLAP_TRUE@ -Wextra -Wformat=2
225 +@MUDFLAP_TRUE@ $(WEXTRA) -Wformat=2
226 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
229 --- elfutils/libcpu/ChangeLog
230 +++ elfutils/libcpu/ChangeLog
232 +2005-04-04 Roland McGrath <roland@redhat.com>
234 + * Makefile.am (WEXTRA): New variable, substituted by configure.
235 + (AM_CFLAGS): Use it instead of -Wextra.
237 2005-02-15 Ulrich Drepper <drepper@redhat.com>
239 * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
240 --- elfutils/libcpu/Makefile.am
241 +++ elfutils/libcpu/Makefile.am
243 ## 3001 King Ranch Road, Ukiah, CA 95482.
245 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
246 -AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
248 +AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
249 INCLUDES = -I$(srcdir)
251 noinst_LIBRARIES = libcpu_i386.a
252 --- elfutils/libcpu/Makefile.in
253 +++ elfutils/libcpu/Makefile.in
254 @@ -122,6 +122,7 @@ SHELL = @SHELL@
259 XGETTEXT = @XGETTEXT@
261 ac_ct_CC = @ac_ct_CC@
262 @@ -163,7 +164,7 @@ sbindir = @sbindir@
263 sharedstatedir = @sharedstatedir@
264 sysconfdir = @sysconfdir@
265 target_alias = @target_alias@
266 -AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
267 +AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
268 INCLUDES = -I$(srcdir)
269 noinst_LIBRARIES = libcpu_i386.a
270 libcpu_i386_a_SOURCES = i386_dis.c
271 --- elfutils/libdw/Makefile.am
272 +++ elfutils/libdw/Makefile.am
274 ## 3001 King Ranch Road, Ukiah, CA 95482.
276 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
279 AM_CFLAGS = -fmudflap
283 -AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
284 +AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
285 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
288 --- elfutils/libdw/Makefile.in
289 +++ elfutils/libdw/Makefile.in
290 @@ -190,6 +190,7 @@ SHELL = @SHELL@
295 XGETTEXT = @XGETTEXT@
297 ac_ct_CC = @ac_ct_CC@
298 @@ -232,9 +233,9 @@ sharedstatedir = @sharedstatedir@
299 sysconfdir = @sysconfdir@
300 target_alias = @target_alias@
301 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
302 -@MUDFLAP_FALSE@ -Wextra -std=gnu99
303 +@MUDFLAP_FALSE@ $(WEXTRA) -std=gnu99
304 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \
305 -@MUDFLAP_TRUE@ -Wformat=2 -Wextra -std=gnu99
306 +@MUDFLAP_TRUE@ -Wformat=2 $(WEXTRA) -std=gnu99
307 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
308 lib_LIBRARIES = libdw.a
309 @MUDFLAP_FALSE@noinst_LIBRARIES = libdw_pic.a
310 --- elfutils/libebl/Makefile.am
311 +++ elfutils/libebl/Makefile.am
313 ## 3001 King Ranch Road, Ukiah, CA 95482.
315 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
318 AM_CFLAGS = -fmudflap
322 -AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
323 +AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
326 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I..
327 --- elfutils/libebl/Makefile.in
328 +++ elfutils/libebl/Makefile.in
329 @@ -236,6 +236,7 @@ SHELL = @SHELL@
334 XGETTEXT = @XGETTEXT@
336 ac_ct_CC = @ac_ct_CC@
337 @@ -278,9 +279,9 @@ sharedstatedir = @sharedstatedir@
338 sysconfdir = @sysconfdir@
339 target_alias = @target_alias@
340 @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
341 -@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99
342 +@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 -std=gnu99
343 @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \
344 -@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99
345 +@MUDFLAP_TRUE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99
346 INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I..
347 lib_LIBRARIES = libebl.a
348 modules = i386 sh mips x86_64 ia64 alpha arm sparc ppc ppc64
349 --- elfutils/libelf/Makefile.am
350 +++ elfutils/libelf/Makefile.am
352 ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
354 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
357 AM_CFLAGS = -fpic -fmudflap
361 -AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
362 +AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
364 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
365 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
366 --- elfutils/libelf/Makefile.in
367 +++ elfutils/libelf/Makefile.in
368 @@ -199,6 +199,7 @@ SHELL = @SHELL@
373 XGETTEXT = @XGETTEXT@
375 ac_ct_CC = @ac_ct_CC@
376 @@ -240,10 +241,10 @@ sbindir = @sbindir@
377 sharedstatedir = @sharedstatedir@
378 sysconfdir = @sysconfdir@
379 target_alias = @target_alias@
380 -@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused -Wextra \
381 +@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -Werror -Wunused $(WEXTRA) \
382 @MUDFLAP_FALSE@ -Wformat=2 -std=gnu99 $($(*F)_CFLAGS)
383 @MUDFLAP_TRUE@AM_CFLAGS = -fpic -fmudflap -Wall -Wshadow -Werror \
384 -@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99 \
385 +@MUDFLAP_TRUE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
386 @MUDFLAP_TRUE@ $($(*F)_CFLAGS)
387 INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
388 GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
389 --- elfutils/m4/Makefile.in
390 +++ elfutils/m4/Makefile.in
391 @@ -103,6 +103,7 @@ SHELL = @SHELL@
396 XGETTEXT = @XGETTEXT@
398 ac_ct_CC = @ac_ct_CC@
399 --- elfutils/src/Makefile.am
400 +++ elfutils/src/Makefile.am
403 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
404 -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
407 -AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \
408 +AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fmudflap \
409 $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \
410 $(if $($(*F)_no_Wformat),,-Wformat=2)
412 AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
413 $(if $($(*F)_no_Werror),,-Werror) \
414 - $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
415 + $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
416 $(if $($(*F)_no_Wformat),,-Wformat=2)
419 --- elfutils/src/Makefile.in
420 +++ elfutils/src/Makefile.in
421 @@ -194,6 +194,7 @@ SHELL = @SHELL@
426 XGETTEXT = @XGETTEXT@
428 ac_ct_CC = @ac_ct_CC@
429 @@ -237,10 +238,10 @@ sysconfdir = @sysconfdir@
430 target_alias = @target_alias@
431 @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
432 @MUDFLAP_FALSE@ $(if $($(*F)_no_Werror),,-Werror) \
433 -@MUDFLAP_FALSE@ $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
434 +@MUDFLAP_FALSE@ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
435 @MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),,-Wformat=2)
437 -@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \
438 +@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fmudflap \
439 @MUDFLAP_TRUE@ $(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \
440 @MUDFLAP_TRUE@ $(if $($(*F)_no_Wformat),,-Wformat=2)
442 --- elfutils/src/findtextrel.c
443 +++ elfutils/src/findtextrel.c
444 @@ -476,7 +476,11 @@ ptrcompare (const void *p1, const void *
448 -check_rel (size_t nsegments, struct segments segments[nsegments],
449 +check_rel (size_t nsegments, struct segments segments[
454 GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
455 const char *fname, bool more_than_one, void **knownsrcs)
457 --- elfutils/src/strip.c
458 +++ elfutils/src/strip.c
464 +# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
466 +# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
470 /* Name and version of program. */
471 static void print_version (FILE *stream, struct argp_state *state);
472 @@ -269,8 +275,18 @@ process_file (const char *fname)
474 /* If we have to preserve the timestamp, we need it in the
475 format utimes() understands. */
476 +#ifdef HAVE_STRUCT_STAT_ST_ATIM
477 TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
479 + tv[0].tv_sec = pre_st.st_atime;
482 +#ifdef HAVE_STRUCT_STAT_ST_MTIM
483 TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
485 + tv[1].tv_sec = pre_st.st_atime;
491 @@ -1677,7 +1693,7 @@ handle_elf (int fd, Elf *elf, const char
492 /* If requested, preserve the timestamp. */
495 - if (futimes (fd, tvp) != 0)
496 + if (FUTIMES (fd, output_fname, tvp) != 0)
498 error (0, errno, gettext ("\
499 cannot set access and modification date of '%s'"),
500 @@ -1734,7 +1750,7 @@ handle_ar (int fd, Elf *elf, const char
504 - if (unlikely (futimes (fd, tvp) != 0))
505 + if (unlikely (FUTIMES (fd, fname, tvp) != 0))
507 error (0, errno, gettext ("\
508 cannot set access and modification date of '%s'"), fname);
509 --- elfutils/tests/Makefile.in
510 +++ elfutils/tests/Makefile.in
511 @@ -266,6 +266,7 @@ SHELL = @SHELL@
516 XGETTEXT = @XGETTEXT@
518 ac_ct_CC = @ac_ct_CC@