diff mbox

: Fix Bug 65038 - [regression 5] Unable to find ftw.h for libgcov-util.c

Message ID CAEwic4Zr1hd_ZQMBaRM9f8_QEenqbJHOdhxtXEAk9N-JYmwMww@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Feb. 26, 2015, 2:49 p.m. UTC
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

Comments

Kai Tietz Feb. 27, 2015, 12:06 p.m. UTC | #1
Applied at rev.revision 221055.

--
Kai
H.J. Lu Feb. 27, 2015, 1:48 p.m. UTC | #2
On Thu, Feb 26, 2015 at 6:49 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 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.

I believe it breaks bootstrap on Linux/x86:

https://gcc.gnu.org/ml/gcc-regression/2015-02/msg00580.html
Kai Tietz Feb. 27, 2015, 2:30 p.m. UTC | #3
2015-02-27 14:48 GMT+01:00 H.J. Lu <hjl.tools@gmail.com>:
> On Thu, Feb 26, 2015 at 6:49 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> 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.
>
> I believe it breaks bootstrap on Linux/x86:
>
> https://gcc.gnu.org/ml/gcc-regression/2015-02/msg00580.html
>
> --
> H.J.

Already fixed.  See bug

--
Kai
diff mbox

Patch

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);