summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-10 03:40:20 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-10 03:40:20 +0000
commiteb4b8219e641b8f0f4b13105846650c40283e603 (patch)
tree87a98579e2db1bcfc8d7777f92b50a7acd6ca54b
parentdea9fb757f4d07bee5fce77f9a552a1081c3ea08 (diff)
downloadgcc-eb4b8219e641b8f0f4b13105846650c40283e603.tar.gz
Support gcov-tool without ftw.h
gcc/ PR gcov-profile/61889 * config.in: regenerate. * configure.in: Likewise. * configure.ac: Check for ftw.h. * gcov-tool.c: Check for ftw.h before using nftw. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220566 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config.in6
-rwxr-xr-xgcc/configure2
-rw-r--r--gcc/configure.ac2
-rw-r--r--gcc/gcov-tool.c11
5 files changed, 26 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d98276b80b3..f21856768d2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2015-02-09 Trevor Saunders <tsaunders@mozilla.com>
+ PR gcov-profile/61889
+ * config.in: regenerate.
+ * configure.in: Likewise.
+ * configure.ac: Check for ftw.h.
+ * gcov-tool.c: Check for ftw.h before using nftw.
+
+2015-02-09 Trevor Saunders <tsaunders@mozilla.com>
+
PR lto/64076
* ipa-visibility.c (update_visibility_by_resolution_info): Only
assert when not in lto mode.
diff --git a/gcc/config.in b/gcc/config.in
index f34adb57e6d..7bde5b1509d 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1098,6 +1098,12 @@
#endif
+/* Define to 1 if you have the <ftw.h> header file. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_FTW_H
+#endif
+
+
/* Define to 1 if you have the `fwrite_unlocked' function. */
#ifndef USED_FOR_TARGET
#undef HAVE_FWRITE_UNLOCKED
diff --git a/gcc/configure b/gcc/configure
index 1bf43589ae6..1a35d5a186a 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -8448,7 +8448,7 @@ $as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h
fi
for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
- fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
+ fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h
do :
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 102dab966fd..a553a653f92 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1028,7 +1028,7 @@ ACX_HEADER_STRING
AC_HEADER_SYS_WAIT
AC_HEADER_TIOCGWINSZ
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
- fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
+ fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h)
diff --git a/gcc/gcov-tool.c b/gcc/gcov-tool.c
index 0f97b532d7f..d63ad1c102e 100644
--- a/gcc/gcov-tool.c
+++ b/gcc/gcov-tool.c
@@ -35,7 +35,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
+#if HAVE_FTW_H
#include <ftw.h>
+#endif
#include <getopt.h>
extern int gcov_profile_merge (struct gcov_info*, struct gcov_info*, int, int);
@@ -49,6 +51,8 @@ extern void gcov_set_verbose (void);
/* Set to verbose output mode. */
static bool verbose;
+#if HAVE_FTW_H
+
/* Remove file NAME if it has a gcda suffix. */
static int
@@ -69,13 +73,18 @@ unlink_gcda_file (const char *name,
return ret;
}
+#endif
/* Remove the gcda files in PATH recursively. */
static int
-unlink_profile_dir (const char *path)
+unlink_profile_dir (const char *path ATTRIBUTE_UNUSED)
{
+#if HAVE_FTW_H
return nftw(path, unlink_gcda_file, 64, FTW_DEPTH | FTW_PHYS);
+#else
+ return -1;
+#endif
}
/* Output GCOV_INFO lists PROFILE to directory OUT. Note that