[Mesa-dev] add util_queue_fence_wait_timeout checkin breaks centos6 build

Kyriazis, George george.kyriazis at intel.com
Fri Nov 10 22:22:54 UTC 2017


Hmm..

Looking at /usr/include/time.h on ubuntu, I see the following:

#if (!defined __timespec_defined                                        \
     && ((defined _TIME_H                                               \
          && (defined __USE_POSIX199309                                 \
              || defined __USE_ISOC11))                                 \
         || defined __need_timespec))
# define __timespec_defined     1

…

# ifdef __USE_ISOC11
/* Set TS to calendar time based in time base BASE.  */
extern int timespec_get (struct timespec *__ts, int __base)
     __THROW __nonnull ((1));
# endif


However, on centos6, I see:

#if !defined __timespec_defined &&                              \
    ((defined _TIME_H &&                                        \
      (defined __USE_POSIX199309 || defined __USE_MISC)) ||     \
      defined __need_timespec)
# define __timespec_defined     1

No definition for timespec_get().

So, the difference between the two looks like it’s the dependence of __USE_ISOC11.

The quick fix would be to depend on __USE_ISOC11 (or even better __timespec_defined && __USE_ISOC11), but I’m not sure how portable it is.

Of course, the most fool-proof solution would be a configure script check, but it could be redundant.

George

> On Nov 10, 2017, at 2:41 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> 
> On 10.11.2017 19:20, Kyriazis, George wrote:
>> Hello Nicolai,
>> Your commit e3a8013 (util/u_queue: add util_queue_fence_wait_timeout), breaks the centos6 build.
>> Specifically, I am getting:
>>   CC     libmesautil_la-u_queue.lo
>> ../../../src/util/u_queue.c: In function '_util_queue_fence_wait_timeout':
>> ../../../src/util/u_queue.c:173:7: error: implicit declaration of function 'timespec_get' [-Werror=implicit-function-declaration]
>>        timespec_get(&ts, TIME_UTC);
>>        ^
>> cc1: some warnings being treated as errors
> 
> Thanks for the heads up. That's annoying. Any good ideas for how to test for timespec_get availability? Some configure script check, I guess?
> 
> Cheers,
> Nicolai
> 
> 
>> Thanks!
>> George
> 
> 
> -- 
> Lerne, wie die Welt wirklich ist,
> Aber vergiss niemals, wie sie sein sollte.



More information about the mesa-dev mailing list