coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

coreutils-8.12.178-df9cd on IRIX 6.5


From: Bruno Haible
Subject: coreutils-8.12.178-df9cd on IRIX 6.5
Date: Thu, 1 Sep 2011 12:16:18 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

> On IRIX 6.5:
> Compilation failure.

  CC       gethrxtime.o
cc-1020 cc: ERROR File = /usr/include/internal/signal_core.h, Line = 162
  The identifier "timespec_t" is undefined.

  extern int sigtimedwait(const sigset_t *, siginfo_t *, const timespec_t *);
                                                               ^

1 error detected in the compilation of "gethrxtime.c".
*** Error code 2 (bu21)

The complete command line is:

cc -O -c99  -I.    -I/home/haible/prefix-irix-cc/include    -c -o gethrxtime.o 
gethrxtime.c

timespec_t is defined in <sys/timespec.h>, and <sys/timespec.h> is included
by /usr/include/internal/signal_core.h.

Reduced test case:
========== foo.c =========
#include <sys/time.h>
==========================
$ cc -O -c99 -I. -c foo.c
fails
$ cc -O -c99 -c foo.c
succeeds

Looking at the output of "cc -O -c99 -I. -E foo.c | grep '#line'", here is what
happens. (I added the indentation.)

#line 1 "foo.c"
 #line 1 "./sys/time.h"
 #line 37 "./sys/time.h"
  #line 1 "/usr/include/sys/time.h"
   #line 1 "/usr/include/standards.h"
   #line 235 "/usr/include/standards.h"
  #line 33 "/usr/include/sys/time.h"
   #line 1 "/usr/include/sgidefs.h"
   #line 239 "/usr/include/sgidefs.h"
  #line 34 "/usr/include/sys/time.h"
   #line 1 "/usr/include/internal/sgimacros.h"
   #line 107 "/usr/include/internal/sgimacros.h"
  #line 35 "/usr/include/sys/time.h"
  #line 156 "/usr/include/sys/time.h"
   #line 1 "/usr/include/sys/timespec.h"
    #line 1 "/usr/include/sys/types.h"
     #line 1 "/usr/include/sys/pthread.h"
    #line 42 "/usr/include/sys/types.h"
    #line 274 "/usr/include/sys/types.h"
     #line 1 "/usr/include/sys/bsd_types.h"
      #line 1 "./sys/select.h"
      #line 39 "./sys/select.h"
       #line 1 "/usr/include/sys/types.h"
      #line 46 "./sys/select.h"
       #line 1 "./signal.h"
       #line 39 "./signal.h"
        #line 1 "/usr/include/signal.h"
         #line 1 "/usr/include/internal/signal_core.h"
          #line 1 "/usr/include/sys/signal.h"
          #line 72 "/usr/include/sys/signal.h"
           #line 1 "/usr/include/sys/sigevent.h"
           #line 48 "/usr/include/sys/sigevent.h"
          #line 116 "/usr/include/sys/signal.h"
           #line 1 "/usr/include/sys/siginfo.h"
           #line 209 "/usr/include/sys/siginfo.h"
          #line 123 "/usr/include/sys/signal.h"
          #line 177 "/usr/include/sys/signal.h"
           #line 1 "/usr/include/sys/ucontext.h"
           #line 341 "/usr/include/sys/ucontext.h"
          #line 223 "/usr/include/sys/signal.h"
          #line 397 "/usr/include/sys/signal.h"
         #line 120 "/usr/include/internal/signal_core.h"
          #line 1 "/usr/include/sys/timespec.h"
         #line 155 "/usr/include/internal/signal_core.h"
         #line 199 "/usr/include/internal/signal_core.h"
          #line 1 "/usr/include/sys/procset.h"
          #line 125 "/usr/include/sys/procset.h"
         #line 212 "/usr/include/internal/signal_core.h"
        #line 5 "/usr/include/signal.h"
       #line 53 "./signal.h"
       #line 731 "./signal.h"
      #line 51 "./sys/select.h"
       #line 1 "./sys/time.h"
        #line 1 "/usr/include/sys/time.h"
       #line 34 "./sys/time.h"
      #line 62 "./sys/select.h"
       #line 1 "/usr/include/sys/select.h"
        #line 1 "./string.h"
         #line 1 "/usr/include/string.h"
          #line 1 "/usr/include/internal/string_core.h"
          #line 234 "/usr/include/internal/string_core.h"
         #line 5 "/usr/include/string.h"
        #line 31 "./string.h"
         #line 1 "/usr/include/stddef.h"
          #line 1 "/usr/include/internal/stddef_core.h"
          #line 65 "/usr/include/internal/stddef_core.h"
         #line 5 "/usr/include/stddef.h"
        #line 37 "./string.h"
        #line 1322 "./string.h"
       #line 81 "/usr/include/sys/select.h"
       #line 106 "/usr/include/sys/select.h"
      #line 74 "./sys/select.h"
      #line 574 "./sys/select.h"
     #line 45 "/usr/include/sys/bsd_types.h"
    #line 407 "/usr/include/sys/types.h"
    #line 537 "/usr/include/sys/types.h"
   #line 42 "/usr/include/sys/timespec.h"
  #line 161 "/usr/include/sys/time.h"
   #line 1 "./sys/select.h"
   #line 39 "./sys/select.h"
  #line 179 "/usr/include/sys/time.h"
  #line 196 "/usr/include/sys/time.h"
   #line 1 "./time.h"
   #line 39 "./time.h"
    #line 1 "/usr/include/time.h"
     #line 1 "/usr/include/internal/time_core.h"
     #line 73 "/usr/include/internal/time_core.h"
      #line 1 "/usr/include/sys/ptimers.h"
      #line 61 "/usr/include/sys/ptimers.h"
     #line 82 "/usr/include/internal/time_core.h"
     #line 93 "/usr/include/internal/time_core.h"
    #line 5 "/usr/include/time.h"
   #line 43 "./time.h"
   #line 562 "./time.h"
  #line 236 "/usr/include/sys/time.h"
 #line 42 "./sys/time.h"
 #line 414 "./sys/time.h"
#line 2 "foo.c"

The problem is with gnulib's sys/select.h replacement. When I remove all
other gnulib generated .h files, the error persists.

#line 1 "foo.c"
 #line 1 "/usr/include/sys/time.h"
  #line 1 "/usr/include/standards.h"
 #line 33 "/usr/include/sys/time.h"
  #line 1 "/usr/include/sgidefs.h"
  #line 239 "/usr/include/sgidefs.h"
 #line 34 "/usr/include/sys/time.h"
  #line 1 "/usr/include/internal/sgimacros.h"
  #line 107 "/usr/include/internal/sgimacros.h"
 #line 35 "/usr/include/sys/time.h"
 #line 156 "/usr/include/sys/time.h"
  #line 1 "/usr/include/sys/timespec.h"
   #line 1 "/usr/include/sys/types.h"
    #line 1 "/usr/include/sys/pthread.h"
   #line 42 "/usr/include/sys/types.h"
   #line 274 "/usr/include/sys/types.h"
    #line 1 "/usr/include/sys/bsd_types.h"
     #line 1 "./sys/select.h"
     #line 39 "./sys/select.h"
      #line 1 "/usr/include/sys/types.h"
     #line 46 "./sys/select.h"
      #line 1 "/usr/include/signal.h"
       #line 1 "/usr/include/internal/signal_core.h"
        #line 1 "/usr/include/sys/signal.h"
        #line 72 "/usr/include/sys/signal.h"
         #line 1 "/usr/include/sys/sigevent.h"
         #line 48 "/usr/include/sys/sigevent.h"
        #line 116 "/usr/include/sys/signal.h"
         #line 1 "/usr/include/sys/siginfo.h"
         #line 209 "/usr/include/sys/siginfo.h"
        #line 123 "/usr/include/sys/signal.h"
        #line 177 "/usr/include/sys/signal.h"
         #line 1 "/usr/include/sys/ucontext.h"
         #line 341 "/usr/include/sys/ucontext.h"
        #line 223 "/usr/include/sys/signal.h"
        #line 397 "/usr/include/sys/signal.h"
       #line 120 "/usr/include/internal/signal_core.h"
        #line 1 "/usr/include/sys/timespec.h"
       #line 155 "/usr/include/internal/signal_core.h"
       extern int sigtimedwait(const sigset_t *, siginfo_t *, const timespec_t 
*);
       #line 199 "/usr/include/internal/signal_core.h"
        #line 1 "/usr/include/sys/procset.h"
        #line 125 "/usr/include/sys/procset.h"
       #line 212 "/usr/include/internal/signal_core.h"
      #line 5 "/usr/include/signal.h"
     #line 51 "./sys/select.h"
      #line 1 "/usr/include/sys/time.h"
     #line 62 "./sys/select.h"
      #line 1 "/usr/include/sys/select.h"
       #line 1 "/usr/include/string.h"
        #line 1 "/usr/include/internal/string_core.h"
        #line 234 "/usr/include/internal/string_core.h"
       #line 5 "/usr/include/string.h"
      #line 81 "/usr/include/sys/select.h"
      #line 106 "/usr/include/sys/select.h"
     #line 74 "./sys/select.h"
     #line 574 "./sys/select.h"
    #line 45 "/usr/include/sys/bsd_types.h"
   #line 407 "/usr/include/sys/types.h"
   #line 537 "/usr/include/sys/types.h"
  #line 42 "/usr/include/sys/timespec.h"
  Here comes the definition of timespec_t.
 #line 161 "/usr/include/sys/time.h"
  #line 1 "./sys/select.h"
  #line 39 "./sys/select.h"
 #line 179 "/usr/include/sys/time.h"
 #line 196 "/usr/include/sys/time.h"
  #line 1 "/usr/include/time.h"
   #line 1 "/usr/include/internal/time_core.h"
   #line 73 "/usr/include/internal/time_core.h"
    #line 1 "/usr/include/sys/ptimers.h"
    #line 61 "/usr/include/sys/ptimers.h"
   #line 82 "/usr/include/internal/time_core.h"
   #line 93 "/usr/include/internal/time_core.h"
  #line 5 "/usr/include/time.h"
 #line 236 "/usr/include/sys/time.h"
#line 2 "foo.c"

So, the problem is that while <sys/timespec.h> is being included, we have an
include chain

  /usr/include/sys/timespec.h
  -> /usr/include/sys/types.h
     -> /usr/include/sys/bsd_types.h
        -> ./sys/select.h
           -> /usr/include/signal.h
              -> /usr/include/internal/signal_core.h

I'm adding this fix to gnulib.


2011-09-01  Bruno Haible  <address@hidden>

        sys_select: Avoid a syntax error regarding timespec_t on IRIX 6.5.
        * lib/sys_select.in.h [__sgi]: When included from <sys/bsd_types.h>,
        just include the system's header.

--- lib/sys_select.in.h.orig    Thu Sep  1 12:12:21 2011
+++ lib/sys_select.in.h Thu Sep  1 12:11:48 2011
@@ -32,6 +32,16 @@
 # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
 
+/* On IRIX 6.5, <sys/timespec.h> includes <sys/types.h>, which includes
+   <sys/bsd_types.h>, which includes <sys/select.h>.  At this point we cannot
+   include <signal.h>, because that includes <internal/signal_core.h>, which
+   gives a syntax error because <sys/timespec.h> has not been completely
+   processed.  Simply delegate to the system's header in this case.  */
+#elif @HAVE_SYS_SELECT_H@ && defined __sgi && (defined _SYS_BSD_TYPES_H && 
!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H)
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
 #else
 
 #ifndef _@GUARD_PREFIX@_SYS_SELECT_H

-- 
In memoriam Nikolai Bryukhanov <http://en.wikipedia.org/wiki/Nikolai_Bryukhanov>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]