diff mbox

[BUILDROBOT] gcov patch

Message ID CAF1bQ=QQqDWEdBjMd-xCioKOFJ4LWOd1-AzFTcWHoxBO7Ldi7w@mail.gmail.com
State New
Headers show

Commit Message

Rong Xu July 11, 2014, 2:28 p.m. UTC
Sorry. This code meant to work with the different mkdir api in
windows. I used wrong ifdef.

Here is the patch. OK for checkin?

Thanks,

-Rong

2014-07-11  Rong Xu  <xur@google.com>

        * gcov-tool.c (gcov_output_files): Fix build error.


On Fri, Jul 11, 2014 at 6:08 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Fri, 2014-07-11 15:03:06 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>> See eg. http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=289639,
>> it breaks like this:
>>
>> [...]
>> g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I/home/jbglaw/repos/gcc/gcc -I/home/jbglaw/repos/gcc/gcc/. -I/home/jbglaw/repos/gcc/gcc/../include -I/home/jbglaw/repos/gcc/gcc/../libcpp/include  -I/home/jbglaw/repos/gcc/gcc/../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/jbglaw/repos/gcc/gcc/../libbacktrace    -o gcov-tool.o -MT gcov-tool.o -MMD -MP -MF ./.deps/gcov-tool.TPo /home/jbglaw/repos/gcc/gcc/gcov-tool.c
>> /usr/include/sys/stat.h: In function ‘void gcov_output_files(const char*, gcov_info*)’:
>> /usr/include/sys/stat.h:323: error: too few arguments to function ‘int mkdir(const char*, __mode_t)’
>> /home/jbglaw/repos/gcc/gcc/gcov-tool.c:96: error: at this point in file
>> make[1]: *** [gcov-tool.o] Error 1
>> make[1]: Leaving directory `/home/jbglaw/build/rl78-elf/build-gcc/gcc'
>> make: *** [all-gcc] Error 2
>
> [...]
>
> +#ifdef TARGET_POSIX_IO
> +      if (mkdir (out, 0755) == -1 && errno != EEXIST)
> +#else
> +      if (mkdir (out) == -1 && errno != EEXIST)
> +#endif
>
>
> And with POSIX I/O, this should probably use the S_I* macros for the
> mode bits?
>
> MfG, JBG
>
> --
>       Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
>  Signature of:                    Arroganz verkürzt fruchtlose Gespräche.
>  the second  :                                   -- Jan-Benedict Glaw

Comments

Jan Hubicka July 11, 2014, 3:06 p.m. UTC | #1
> Sorry. This code meant to work with the different mkdir api in
> windows. I used wrong ifdef.
> 
> Here is the patch. OK for checkin?
OK. I also see the following with LTO bootstrap:
../../gcc/../libgcc/libgcov-util.c:41:24: error: type of �gcov_max_filename� does not match original declaration [-Werror]
 extern gcov_unsigned_t gcov_max_filename;
                        ^
../../gcc/../libgcc/libgcov-driver.c:88:8: note: previously declared here
 size_t gcov_max_filename = 0;
Probably both can be size_t?

Honza

> 
> Thanks,
> 
> -Rong
> 
> 2014-07-11  Rong Xu  <xur@google.com>
> 
>         * gcov-tool.c (gcov_output_files): Fix build error.
> 
> Index: gcov-tool.c
> ===================================================================
> --- gcov-tool.c (revision 212448)
> +++ gcov-tool.c (working copy)
> @@ -90,8 +90,8 @@ gcov_output_files (const char *out, struct gcov_in
>    /* Try to make directory if it doesn't already exist.  */
>    if (access (out, F_OK) == -1)
>      {
> -#ifdef TARGET_POSIX_IO
> -      if (mkdir (out, 0755) == -1 && errno != EEXIST)
> +#if !defined(_WIN32)
> +      if (mkdir (out, S_IRWXU | S_IRWXG | S_IRWXO) == -1 && errno != EEXIST)

Sounds almost like something we could have libiberty glue for...


>  #else
>        if (mkdir (out) == -1 && errno != EEXIST)
>  #endif
>
Rong Xu July 11, 2014, 4:42 p.m. UTC | #2
On Fri, Jul 11, 2014 at 8:06 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> Sorry. This code meant to work with the different mkdir api in
>> windows. I used wrong ifdef.
>>
>> Here is the patch. OK for checkin?
> OK. I also see the following with LTO bootstrap:
> ../../gcc/../libgcc/libgcov-util.c:41:24: error: type of �gcov_max_filename� does not match original declaration [-Werror]
>  extern gcov_unsigned_t gcov_max_filename;
>                         ^
> ../../gcc/../libgcc/libgcov-driver.c:88:8: note: previously declared here
>  size_t gcov_max_filename = 0;
> Probably both can be size_t?

OK. I will change this too and submit.

Thanks for the quick review.

-Rong

>
> Honza
>
>>
>> Thanks,
>>
>> -Rong
>>
>> 2014-07-11  Rong Xu  <xur@google.com>
>>
>>         * gcov-tool.c (gcov_output_files): Fix build error.
>>
>> Index: gcov-tool.c
>> ===================================================================
>> --- gcov-tool.c (revision 212448)
>> +++ gcov-tool.c (working copy)
>> @@ -90,8 +90,8 @@ gcov_output_files (const char *out, struct gcov_in
>>    /* Try to make directory if it doesn't already exist.  */
>>    if (access (out, F_OK) == -1)
>>      {
>> -#ifdef TARGET_POSIX_IO
>> -      if (mkdir (out, 0755) == -1 && errno != EEXIST)
>> +#if !defined(_WIN32)
>> +      if (mkdir (out, S_IRWXU | S_IRWXG | S_IRWXO) == -1 && errno != EEXIST)
>
> Sounds almost like something we could have libiberty glue for...
>
>
>>  #else
>>        if (mkdir (out) == -1 && errno != EEXIST)
>>  #endif
>>
diff mbox

Patch

Index: gcov-tool.c
===================================================================
--- gcov-tool.c (revision 212448)
+++ gcov-tool.c (working copy)
@@ -90,8 +90,8 @@  gcov_output_files (const char *out, struct gcov_in
   /* Try to make directory if it doesn't already exist.  */
   if (access (out, F_OK) == -1)
     {
-#ifdef TARGET_POSIX_IO
-      if (mkdir (out, 0755) == -1 && errno != EEXIST)
+#if !defined(_WIN32)
+      if (mkdir (out, S_IRWXU | S_IRWXG | S_IRWXO) == -1 && errno != EEXIST)
 #else
       if (mkdir (out) == -1 && errno != EEXIST)
 #endif