[BUILDROBOT] gcov patch (was: r212448 - in /trunk: gcc/ChangeLog gcc/Makefile...)

2014-07-11 Thread Jan-Benedict Glaw
On Fri, 2014-07-11 05:48:08 -, x...@gcc.gnu.org x...@gcc.gnu.org wrote:
 Author: xur
 Date: Fri Jul 11 05:48:07 2014
 New Revision: 212448
 
 URL: https://gcc.gnu.org/viewcvs?rev=212448root=gccview=rev
 Log:
 2014-07-10  Rong Xu  x...@google.com
 
   Add gcov-tool: an offline gcda profile processing tool
   Support.
[...]

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


MfG, JBG

-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
  Signature of:Lauf nicht vor Deinem Glück davon:
  the second  : Es könnte hinter Dir stehen!


signature.asc
Description: Digital signature


Re: [BUILDROBOT] gcov patch

2014-07-11 Thread Jan-Benedict Glaw
On Fri, 2014-07-11 15:03:06 +0200, Jan-Benedict Glaw jbg...@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  jbg...@lug-owl.de  +49-172-7608481
 Signature of:Arroganz verkürzt fruchtlose Gespräche.
 the second  :   -- Jan-Benedict Glaw


signature.asc
Description: Digital signature


Re: [BUILDROBOT] gcov patch

2014-07-11 Thread Rong Xu
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  x...@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)
 #else
   if (mkdir (out) == -1  errno != EEXIST)
 #endif

On Fri, Jul 11, 2014 at 6:08 AM, Jan-Benedict Glaw jbg...@lug-owl.de wrote:
 On Fri, 2014-07-11 15:03:06 +0200, Jan-Benedict Glaw jbg...@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  jbg...@lug-owl.de  +49-172-7608481
  Signature of:Arroganz verkürzt fruchtlose Gespräche.
  the second  :   -- Jan-Benedict Glaw


Re: [BUILDROBOT] gcov patch

2014-07-11 Thread Jan Hubicka
 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  x...@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
 


Re: [BUILDROBOT] gcov patch

2014-07-11 Thread Rong Xu
On Fri, Jul 11, 2014 at 8:06 AM, Jan Hubicka hubi...@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  x...@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