211 lines
6.3 KiB
Diff
211 lines
6.3 KiB
Diff
2005-02-07 Roland McGrath <roland@frob.com>
|
|
|
|
* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
|
|
|
|
2003-08-12 Roland McGrath <roland@redhat.com>
|
|
|
|
* configure.ac: Check for struct stat st_?tim members.
|
|
* src/strip.c (process_file): Use st_?time if st_?tim are not there.
|
|
|
|
* configure.ac: Check for futimes function.
|
|
* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
|
|
(handle_ar) [! HAVE_FUTIMES]: Likewise.
|
|
|
|
--- elfutils/configure.ac
|
|
+++ elfutils/configure.ac
|
|
@@ -66,6 +66,15 @@ CFLAGS="$old_CFLAGS"])
|
|
AS_IF([test "x$ac_cv_c99" != xyes],
|
|
AC_MSG_ERROR([gcc with C99 support required]))
|
|
|
|
+AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
|
|
+old_CFLAGS="$CFLAGS"
|
|
+CFLAGS="$CFLAGS -Wextra"
|
|
+AC_COMPILE_IFELSE([void foo (void) { }],
|
|
+ ac_cv_cc_wextra, ac_cv_cc_wextra=no)
|
|
+CFLAGS="$old_CFLAGS"])
|
|
+AC_SUBST(WEXTRA)
|
|
+AS_IF([test "x$ac_cv_cc_wextra" = yes], [WEXTRA=-Wextra])
|
|
+
|
|
LOCALEDIR=$datadir
|
|
AC_SUBST(LOCALEDIR)
|
|
AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
|
|
--- elfutils/lib/ChangeLog
|
|
+++ elfutils/lib/ChangeLog
|
|
@@ -1,3 +1,8 @@
|
|
+2005-02-07 Roland McGrath <roland@redhat.com>
|
|
+
|
|
+ * Makefile.am (WEXTRA): New variable, substituted by configure.
|
|
+ (AM_CFLAGS): Use it in place of -Wextra.
|
|
+
|
|
2005-02-15 Ulrich Drepper <drepper@redhat.com>
|
|
|
|
* dynamicsizehash.c (lookup): Mark val parameter as possibly unused.
|
|
--- elfutils/lib/Makefile.am
|
|
+++ elfutils/lib/Makefile.am
|
|
@@ -17,12 +17,13 @@
|
|
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
##
|
|
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
|
|
+WEXTRA = @WEXTRA@
|
|
if MUDFLAP
|
|
AM_CFLAGS = -fmudflap
|
|
else
|
|
AM_CFLAGS =
|
|
endif
|
|
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra $($(*F)_CFLAGS)
|
|
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS)
|
|
INCLUDES = -I$(srcdir)/../libelf -I..
|
|
|
|
noinst_LIBRARIES = libeu.a
|
|
--- elfutils/libasm/Makefile.am
|
|
+++ elfutils/libasm/Makefile.am
|
|
@@ -14,12 +14,13 @@
|
|
## 3001 King Ranch Road, Ukiah, CA 95482.
|
|
##
|
|
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
|
|
+WEXTRA = @WEXTRA@
|
|
if MUDFLAP
|
|
AM_CFLAGS = -fmudflap
|
|
else
|
|
AM_CFLAGS =
|
|
endif
|
|
-AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
|
|
+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2
|
|
INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl \
|
|
-I$(top_srcdir)/lib
|
|
GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
|
|
--- elfutils/libcpu/Makefile.am
|
|
+++ elfutils/libcpu/Makefile.am
|
|
@@ -13,7 +13,8 @@
|
|
## 3001 King Ranch Road, Ukiah, CA 95482.
|
|
##
|
|
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
|
|
-AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
|
|
+WEXTRA = @WEXTRA@
|
|
+AM_CFLAGS = -Wall -Wshadow -Werror $(WEXTRA) -Wformat=2 -Wunused
|
|
INCLUDES = -I$(srcdir)
|
|
|
|
noinst_LIBRARIES = libcpu_i386.a
|
|
--- elfutils/libdw/Makefile.am
|
|
+++ elfutils/libdw/Makefile.am
|
|
@@ -14,12 +14,13 @@
|
|
## 3001 King Ranch Road, Ukiah, CA 95482.
|
|
##
|
|
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
|
|
+WEXTRA = @WEXTRA@
|
|
if MUDFLAP
|
|
AM_CFLAGS = -fmudflap
|
|
else
|
|
AM_CFLAGS =
|
|
endif
|
|
-AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
|
|
+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99
|
|
INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib
|
|
VERSION = 1
|
|
|
|
--- elfutils/libebl/Makefile.am
|
|
+++ elfutils/libebl/Makefile.am
|
|
@@ -14,12 +14,13 @@
|
|
## 3001 King Ranch Road, Ukiah, CA 95482.
|
|
##
|
|
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
|
|
+WEXTRA = @WEXTRA@
|
|
if MUDFLAP
|
|
AM_CFLAGS = -fmudflap
|
|
else
|
|
AM_CFLAGS =
|
|
endif
|
|
-AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \
|
|
+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \
|
|
-std=gnu99
|
|
|
|
INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/lib -I..
|
|
--- elfutils/libelf/Makefile.am
|
|
+++ elfutils/libelf/Makefile.am
|
|
@@ -17,12 +17,13 @@
|
|
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
##
|
|
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
|
|
+WEXTRA = @WEXTRA@
|
|
if MUDFLAP
|
|
AM_CFLAGS = -fpic -fmudflap
|
|
else
|
|
AM_CFLAGS =
|
|
endif
|
|
-AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
|
|
+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
|
|
$($(*F)_CFLAGS)
|
|
INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
|
|
GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
|
|
--- elfutils/src/Makefile.am
|
|
+++ elfutils/src/Makefile.am
|
|
@@ -15,14 +15,15 @@
|
|
##
|
|
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
|
|
-DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
|
|
+WEXTRA = @WEXTRA@
|
|
if MUDFLAP
|
|
-AM_CFLAGS = -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fmudflap \
|
|
+AM_CFLAGS = -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fmudflap \
|
|
$(native_ld_cflags) $(if $($(*F)_no_Wunused),,-Wunused) \
|
|
$(if $($(*F)_no_Wformat),,-Wformat=2)
|
|
else
|
|
AM_CFLAGS = -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
|
|
$(if $($(*F)_no_Werror),,-Werror) \
|
|
- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
|
|
+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
|
|
$(if $($(*F)_no_Wformat),,-Wformat=2)
|
|
endif
|
|
if MUDFLAP
|
|
--- elfutils/src/strip.c
|
|
+++ elfutils/src/strip.c
|
|
@@ -245,8 +245,18 @@ process_file (const char *fname)
|
|
|
|
/* If we have to preserve the timestamp, we need it in the
|
|
format utimes() understands. */
|
|
+#ifdef HAVE_STRUCT_STAT_ST_ATIM
|
|
TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
|
|
+#else
|
|
+ tv[0].tv_sec = pre_st.st_atime;
|
|
+ tv[0].tv_usec = 0;
|
|
+#endif
|
|
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
|
|
TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
|
|
+#else
|
|
+ tv[1].tv_sec = pre_st.st_atime;
|
|
+ tv[1].tv_usec = 0;
|
|
+#endif
|
|
}
|
|
|
|
/* Open the file. */
|
|
@@ -1677,7 +1687,13 @@ handle_elf (int fd, Elf *elf, const char
|
|
/* If requested, preserve the timestamp. */
|
|
if (tvp != NULL)
|
|
{
|
|
- if (futimes (fd, tvp) != 0)
|
|
+ if (
|
|
+#ifdef HAVE_FUTIMES
|
|
+ futimes (fd, tvp) != 0
|
|
+#else
|
|
+ utimes (output_fname, tvp) != 0
|
|
+#endif
|
|
+ )
|
|
{
|
|
error (0, errno, gettext ("\
|
|
cannot set access and modification date of \"%s\""),
|
|
@@ -1734,7 +1750,13 @@ handle_ar (int fd, Elf *elf, const char
|
|
|
|
if (tvp != NULL)
|
|
{
|
|
- if (unlikely (futimes (fd, tvp) != 0))
|
|
+ if (unlikely (
|
|
+#ifdef HAVE_FUTIMES
|
|
+ futimes (fd, tvp)
|
|
+#else
|
|
+ utimes (fname, tvp)
|
|
+#endif
|
|
+ != 0))
|
|
{
|
|
error (0, errno, gettext ("\
|
|
cannot set access and modification date of \"%s\""), fname);
|