This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch]: Fix Bug 65038 - [regression 5] Unable to find ftw.h for libgcov-util.c
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: terry dot gua at arm dot com
- Date: Thu, 26 Feb 2015 15:49:13 +0100
- Subject: [patch]: Fix Bug 65038 - [regression 5] Unable to find ftw.h for libgcov-util.c
- Authentication-results: sourceware.org; auth=none
Hi,
This is the remaining fix for re-enabling native boostrap for
Windows-variant of gcc without disabling -Werror for libgcc.
ChangeLog
2015-02-26 Kai Tietz <ktietz@redhat.com>
PR target/65038
* config.in: Regenerated.
* configure: Likewise.
* configure.ac (AC_HEADER_STDC): Add explicit.
(AC_CHECK_HEADERS): Check for default headers
plus for ftw.h one.
* libgcov-util.c (gcov_read_profile_dir): Disable use
of ftw-function, if header not found.
(ftw_read_file): Don't translate if ftw header isn't
present.
Regression-tested for x86_64-unknown-linux-gnu. Bootstrapped for
i686-pc-mingw32.
I will apply soon, if there are no objections.
Regards.
Kai
Index: configure.ac
===================================================================
--- configure.ac (Revision 220969)
+++ configure.ac (Arbeitskopie)
@@ -47,6 +47,12 @@ AC_SUBST(libgcc_topdir)
AC_CONFIG_AUX_DIR($libgcc_topdir)
AC_CONFIG_HEADER(auto-target.h:config.in)
+AC_CHECK_HEADERS(inttypes.h \
+ stdint.h stdlib.h \
+ ftw.h unistd.h sys/stat.h sys/types.h \
+ string.h strings.h memory.h)
+AC_HEADER_STDC
+
AC_ARG_ENABLE(shared,
[ --disable-shared don't provide a shared libgcc],
[
Index: libgcov-util.c
===================================================================
--- libgcov-util.c (Revision 220969)
+++ libgcov-util.c (Arbeitskopie)
@@ -52,7 +52,9 @@ void gcov_set_verbose (void)
#include "obstack.h"
#include <unistd.h>
+#ifdef HAVE_FTW_H
#include <ftw.h>
+#endif
static void tag_function (unsigned, unsigned);
static void tag_blocks (unsigned, unsigned);
@@ -380,6 +382,7 @@ read_gcda_file (const char *filename)
return obj_info;
}
+#ifdef HAVE_FTW_H
/* This will be called by ftw(). It opens and read a gcda file FILENAME.
Return a non-zero value to stop the tree walk. */
@@ -417,6 +420,7 @@ ftw_read_file (const char *filename,
return 0;
}
+#endif
/* Initializer for reading a profile dir. */
@@ -451,7 +455,9 @@ gcov_read_profile_dir (const char* dir_name, int r
fnotice (stderr, "%s is not a directory\n", dir_name);
return NULL;
}
+#ifdef HAVE_FTW_H
ftw (".", ftw_read_file, 50);
+#endif
ret = chdir (pwd);
free (pwd);