[MacPorts] #58550: lighttpd @1.4.54 does not build on PPC Tiger, Mac OS X 10.4.11, because of timespec type problems

MacPorts noreply at macports.org
Sun Jun 2 13:41:17 UTC 2019


#58550: lighttpd @1.4.54 does not build on PPC Tiger, Mac OS X 10.4.11, because of
timespec type problems
-----------------------+----------------------
 Reporter:  ballapete  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:  2.5.4
 Keywords:  tiger      |       Port:  lighttpd
-----------------------+----------------------
 {{{
 /opt/local/bin/gcc-apple-4.2 -std=gnu99 -DHAVE_CONFIG_H
 -DHAVE_VERSIONSTAMP_H -DLIBRARY_DIR="\"/opt/local/lib\""
 -DSBIN_DIR="\"/opt/local/sbin\"" -I. -I..   -I/opt/local/include
 -D_REENTRANT -I/opt/local/include -D_FILE_OFFSET_BITS=64
 -D_LARGEFILE_SOURCE -D_LARGE_FILES   -pipe -Os -arch ppc -Wall -W -Wshadow
 -pedantic -MT log.o -MD -MP -MF $depbase.Tpo -c -o log.o log.c &&\
 mv -f $depbase.Tpo $depbase.Po
 In file included from log.c:8:
 base.h:206: error: field 'request_start_hp' has incomplete type
 make[3]: *** [log.o] Error 1
 make[3]: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_www_lighttpd/lighttpd/work/lighttpd-1.4.54/src'
 }}}

 That line in `base.h` reads inside a large struct:

 {{{
   196   struct connection {
   197           connection_state_t state;
   198
   199           /* timestamps */
   200           time_t read_idle_ts;
   201           time_t close_timeout_ts;
   202           time_t write_request_ts;
   203
   204           time_t connection_start;
   205           time_t request_start;
   206           struct timespec request_start_hp;  ««««=====
   207
   208           size_t request_count;        /* number of requests handled
 in this connection */
   209           size_t loops_per_request;    /* to catch endless loops in
 a single request
   210                                         *
   211                                         * used by mod_rewrite,
 mod_fastcgi, ... and others
   212                                         * this is self-protection
   213                                         */
   214
   215           fdnode *fdn;                 /* fdevent (fdnode *) object
 */
   216           int fd;                      /* the FD for this connection
 */
   217           int ndx;                     /* reverse mapping to
 server->connection[ndx] */
   218
   219           /* fd states */
   220           int is_readable;
   221           int is_writable;
   222           int is_ssl_sock;
   223
   224           int keep_alive;              /* only request.c can enable
 it, all other just disable */
   225           int keep_alive_idle;         /* remember
 max_keep_alive_idle from config */
   226
   227           int file_started;
   228           int file_finished;
   229
   230           chunkqueue *write_queue;      /* a large queue for low-
 level write ( HTTP response ) [ file, mem ] */
   231           chunkqueue *read_queue;       /* a small queue for low-
 level read ( HTTP request ) [ mem ] */
   232           chunkqueue *request_content_queue; /* takes request-
 content into tempfile if necessary [ tempfile, mem ]*/
   233
   234           int traffic_limit_reached;
   235
   236           off_t bytes_written;          /* used by mod_accesslog,
 mod_rrd */
   237           off_t bytes_written_cur_second; /* used by mod_accesslog,
 mod_rrd */
   238           off_t bytes_read;             /* used by mod_accesslog,
 mod_rrd */
   239           off_t bytes_header;
   240
   241           int http_status;
   242
   243           sock_addr dst_addr;
   244           buffer *dst_addr_buf;
   245
   246           /* request */
   247           request  request;
   248           request_uri uri;
   249           physical physical;
   250           response response;
   251
   252           size_t header_len;
   253
   254           array  *environment; /* used to pass lighttpd internal
 stuff to the FastCGI/CGI apps, setenv does that */
   255
   256           unsigned int mode;           /* DIRECT (0) or plugin id */
   257           int async_callback;
   258
   259           log_error_st *errh;
   260
   261           void **plugin_ctx;           /* plugin connection specific
 config */
   262
   263           specific_config conf;        /* global connection specific
 config */
   264           cond_cache_t *cond_cache;
   265
   266           buffer *server_name;
   267           buffer *proto;
   268
   269           /* error-handler */
   270           int error_handler_saved_status;
   271           http_method_t error_handler_saved_method;
   272
   273           struct server_socket *srv_socket;   /* reference to the
 server-socket */
   274           int (* network_write)(struct server *srv, struct
 connection *con, chunkqueue *cq, off_t max_bytes);
   275           int (* network_read)(struct server *srv, struct connection
 *con, chunkqueue *cq, off_t max_bytes);
   276
   277           /* etag handling */
   278           etag_flags_t etag_flags;
   279
   280           int8_t conditional_is_valid[16]; /* MUST be >=
 COMP_LAST_ELEMENT] */
   281   };
 }}}

 The included file `log.h`, from line 9, has:

 {{{
     8   struct timespec; /* declaration */
 }}}

 Later `log.c` includes, from line 13:

 {{{
 # 13 "log.c" 2
 # 1 "/usr/include/time.h" 1 3 4
 # 64 "/usr/include/time.h" 3 4
 #define _TIME_H_

 [...]

 # 67 "/usr/include/time.h" 2 3 4
 # 88 "/usr/include/time.h" 3 4
 #define _TIMESPEC
 struct timespec {
         time_t tv_sec;
         long tv_nsec;
 };
 }}}

 which re-declares timespec after first use. So it might work to include
 `time.h` just before `base.h` – and put a guard around line 8 of log.h?

-- 
Ticket URL: <https://trac.macports.org/ticket/58550>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list