Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-15 Thread Nicolai Hähnle

On 15.11.2017 12:30, Jon Turney wrote:

On 15/11/2017 11:21, Nicolai Hähnle wrote:

On 13.11.2017 23:55, Rob Herring wrote:

On Fri, Nov 10, 2017 at 12:39 PM, Jon Turney
 wrote:

On 10/11/2017 15:42, Nicolai Hähnle wrote:


On 10.11.2017 14:00, Jon Turney wrote:


On 09/11/2017 21:41, Nicolai Hähnle wrote:


Sorry for the mess.



I'm going to suggest that the fallback declaration of 
timespec_get() also

needs to be provided for POSIX systems which don't have it.

Not noticed previously as it (or xtime_get()) doesn't seem to have 
had

any users, prior to this series.

Patch attached.



Do you have a system where this is actually needed? Currently
HAVE_TIMESPEC_GET is only defined in threads_win32.h, so some more 
detection
logic somewhere would be required if this actually turns out to be 
an issue.



Hmm.. yes, I'd assumed that HAVE_TIMESPEC_GET was the result of an 
autoconf

check, but it isn't.

Cygwin doesn't (currently) have timespec_get().

I'm thinking the correct solution here is actually to unconditionally
declare timespec_get(), just like all the other C11 thread functions 
(and as

the unused xtime_get() was, prior to
f1a364878431c8c5f4fd38b40b9766449e49f552)?

Revised patch attached.


That should fix Android builds.

Acked-by: Rob Herring 


The issue with this is that it makes the compiler unhappy when 
timespec_get *is* available. I'm looking at adding a configure check. 


Ah, and this doesn't effect the other C11 emulation functions in this 
header because we don't include threads.h, but we do include time.h?


Right.
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-15 Thread Jon Turney

On 15/11/2017 11:21, Nicolai Hähnle wrote:

On 13.11.2017 23:55, Rob Herring wrote:

On Fri, Nov 10, 2017 at 12:39 PM, Jon Turney
 wrote:

On 10/11/2017 15:42, Nicolai Hähnle wrote:


On 10.11.2017 14:00, Jon Turney wrote:


On 09/11/2017 21:41, Nicolai Hähnle wrote:


Sorry for the mess.



I'm going to suggest that the fallback declaration of 
timespec_get() also

needs to be provided for POSIX systems which don't have it.

Not noticed previously as it (or xtime_get()) doesn't seem to have had
any users, prior to this series.

Patch attached.



Do you have a system where this is actually needed? Currently
HAVE_TIMESPEC_GET is only defined in threads_win32.h, so some more 
detection
logic somewhere would be required if this actually turns out to be 
an issue.



Hmm.. yes, I'd assumed that HAVE_TIMESPEC_GET was the result of an 
autoconf

check, but it isn't.

Cygwin doesn't (currently) have timespec_get().

I'm thinking the correct solution here is actually to unconditionally
declare timespec_get(), just like all the other C11 thread functions 
(and as

the unused xtime_get() was, prior to
f1a364878431c8c5f4fd38b40b9766449e49f552)?

Revised patch attached.


That should fix Android builds.

Acked-by: Rob Herring 


The issue with this is that it makes the compiler unhappy when 
timespec_get *is* available. I'm looking at adding a configure check. 


Ah, and this doesn't effect the other C11 emulation functions in this 
header because we don't include threads.h, but we do include time.h?

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-15 Thread Nicolai Hähnle

On 13.11.2017 23:55, Rob Herring wrote:

On Fri, Nov 10, 2017 at 12:39 PM, Jon Turney
 wrote:

On 10/11/2017 15:42, Nicolai Hähnle wrote:


On 10.11.2017 14:00, Jon Turney wrote:


On 09/11/2017 21:41, Nicolai Hähnle wrote:


Sorry for the mess.



I'm going to suggest that the fallback declaration of timespec_get() also
needs to be provided for POSIX systems which don't have it.

Not noticed previously as it (or xtime_get()) doesn't seem to have had
any users, prior to this series.

Patch attached.



Do you have a system where this is actually needed? Currently
HAVE_TIMESPEC_GET is only defined in threads_win32.h, so some more detection
logic somewhere would be required if this actually turns out to be an issue.



Hmm.. yes, I'd assumed that HAVE_TIMESPEC_GET was the result of an autoconf
check, but it isn't.

Cygwin doesn't (currently) have timespec_get().

I'm thinking the correct solution here is actually to unconditionally
declare timespec_get(), just like all the other C11 thread functions (and as
the unused xtime_get() was, prior to
f1a364878431c8c5f4fd38b40b9766449e49f552)?

Revised patch attached.


That should fix Android builds.

Acked-by: Rob Herring 


The issue with this is that it makes the compiler unhappy when 
timespec_get *is* available. I'm looking at adding a configure check.


Cheers,
Nicolai



Rob




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-13 Thread Rob Herring
On Fri, Nov 10, 2017 at 12:39 PM, Jon Turney
 wrote:
> On 10/11/2017 15:42, Nicolai Hähnle wrote:
>>
>> On 10.11.2017 14:00, Jon Turney wrote:
>>>
>>> On 09/11/2017 21:41, Nicolai Hähnle wrote:

 Sorry for the mess.
>>>
>>>
>>> I'm going to suggest that the fallback declaration of timespec_get() also
>>> needs to be provided for POSIX systems which don't have it.
>>>
>>> Not noticed previously as it (or xtime_get()) doesn't seem to have had
>>> any users, prior to this series.
>>>
>>> Patch attached.
>>
>>
>> Do you have a system where this is actually needed? Currently
>> HAVE_TIMESPEC_GET is only defined in threads_win32.h, so some more detection
>> logic somewhere would be required if this actually turns out to be an issue.
>
>
> Hmm.. yes, I'd assumed that HAVE_TIMESPEC_GET was the result of an autoconf
> check, but it isn't.
>
> Cygwin doesn't (currently) have timespec_get().
>
> I'm thinking the correct solution here is actually to unconditionally
> declare timespec_get(), just like all the other C11 thread functions (and as
> the unused xtime_get() was, prior to
> f1a364878431c8c5f4fd38b40b9766449e49f552)?
>
> Revised patch attached.

That should fix Android builds.

Acked-by: Rob Herring 

Rob
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-10 Thread Jon Turney

On 10/11/2017 15:42, Nicolai Hähnle wrote:

On 10.11.2017 14:00, Jon Turney wrote:

On 09/11/2017 21:41, Nicolai Hähnle wrote:

Sorry for the mess.


I'm going to suggest that the fallback declaration of timespec_get() 
also needs to be provided for POSIX systems which don't have it.


Not noticed previously as it (or xtime_get()) doesn't seem to have had 
any users, prior to this series.


Patch attached.


Do you have a system where this is actually needed? Currently 
HAVE_TIMESPEC_GET is only defined in threads_win32.h, so some more 
detection logic somewhere would be required if this actually turns out 
to be an issue.


Hmm.. yes, I'd assumed that HAVE_TIMESPEC_GET was the result of an 
autoconf check, but it isn't.


Cygwin doesn't (currently) have timespec_get().

I'm thinking the correct solution here is actually to unconditionally 
declare timespec_get(), just like all the other C11 thread functions 
(and as the unused xtime_get() was, prior to 
f1a364878431c8c5f4fd38b40b9766449e49f552)?


Revised patch attached.
From f71d15ccab81af7dfb7393ed947827f02d333733 Mon Sep 17 00:00:00 2001
From: Jon Turney 
Date: Fri, 10 Nov 2017 12:22:25 +
Subject: [PATCH] Provide timespec_get() in C11 thread.h emulation on POSIX
 also

Signed-off-by: Jon Turney 
---
 include/c11/threads_posix.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h
index 7bf6a0f6ef6..25076f1b6e5 100644
--- a/include/c11/threads_posix.h
+++ b/include/c11/threads_posix.h
@@ -382,7 +382,6 @@ tss_set(tss_t key, void *val)
 
 /* 7.25.7 Time functions */
 // 7.25.6.1
-#if 0
 static inline int
 timespec_get(struct timespec *ts, int base)
 {
@@ -393,4 +392,3 @@ timespec_get(struct timespec *ts, int base)
 }
 return 0;
 }
-#endif
-- 
2.15.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-10 Thread Nicolai Hähnle

On 10.11.2017 14:00, Jon Turney wrote:

On 09/11/2017 21:41, Nicolai Hähnle wrote:

Sorry for the mess.


I'm going to suggest that the fallback declaration of timespec_get() 
also needs to be provided for POSIX systems which don't have it.


Not noticed previously as it (or xtime_get()) doesn't seem to have had 
any users, prior to this series.


Patch attached.


Do you have a system where this is actually needed? Currently 
HAVE_TIMESPEC_GET is only defined in threads_win32.h, so some more 
detection logic somewhere would be required if this actually turns out 
to be an issue.


Cheers,
Nicolai




___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-10 Thread Jon Turney

On 09/11/2017 21:41, Nicolai Hähnle wrote:

Sorry for the mess.


I'm going to suggest that the fallback declaration of timespec_get() 
also needs to be provided for POSIX systems which don't have it.


Not noticed previously as it (or xtime_get()) doesn't seem to have had 
any users, prior to this series.


Patch attached.
From e04c7cfa3a3a560476d361a828070f7785da8bf0 Mon Sep 17 00:00:00 2001
From: Jon Turney 
Date: Fri, 10 Nov 2017 12:22:25 +
Subject: [PATCH] Also provide timespec_get fallback if a POSIX platform
 doesn't have it

... not just on Windows

Signed-off-by: Jon Turney 
---
 include/c11/threads_posix.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h
index 7bf6a0f6ef6..45cb6075e6e 100644
--- a/include/c11/threads_posix.h
+++ b/include/c11/threads_posix.h
@@ -382,7 +382,7 @@ tss_set(tss_t key, void *val)
 
 /* 7.25.7 Time functions */
 // 7.25.6.1
-#if 0
+#ifndef HAVE_TIMESPEC_GET
 static inline int
 timespec_get(struct timespec *ts, int base)
 {
-- 
2.15.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-09 Thread Roland Scheidegger
FWIW it looks like this series also broke compilation on mac os (I
suppose that was f0d3a4de75fdb865c058aba8614f0fe6ba5f0969 though):

[...truncated 173 lines...]
   pthread_barrier_destroy(barrier);
   ^~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/pthread.h:220:42:
note: passing argument to parameter here
int pthread_attr_destroy(pthread_attr_t *);
 ^
In file included from src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:93:
In file included from src/gallium/auxiliary/os/os_thread.h:42:
src/util/u_thread.h:123:4: error: use of undeclared identifier
'pthread_barrier_wait'; did you mean 'util_barrier_wait'?
   pthread_barrier_wait(barrier);
   ^~~~
   util_barrier_wait
src/util/u_thread.h:121:20: note: 'util_barrier_wait' declared here
static inline void util_barrier_wait(util_barrier *barrier)
   ^
5 errors generated.

Roland

Am 09.11.2017 um 23:37 schrieb Brian Paul:
> On 11/09/2017 02:41 PM, Nicolai Hähnle wrote:
>> Sorry for the mess.
> 
> Not a huge deal.  FWIW, you can test the MinGW cross-compile pretty easily:
> 
> 1. apt-get install g++-mingw-w64-x86-64 (or equivalent)
> 2. cd mesa ; scons platform=windows
> 
> -Brian
> 
>>
>> Reviewed-by: Nicolai Hähnle 
>>
>> On 09.11.2017 17:46, Brian Paul wrote:
>>> Fixes: f1a364878431c8 ("threads: update for late C11 changes")
>>> ---
>>>   include/c11/threads_win32.h | 5 -
>>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/include/c11/threads_win32.h b/include/c11/threads_win32.h
>>> index 77d923a..dac8ef7 100644
>>> --- a/include/c11/threads_win32.h
>>> +++ b/include/c11/threads_win32.h
>>> @@ -78,6 +78,9 @@ Configuration macro:
>>>   /* Visual Studio 2015 and later */
>>>   #if _MSC_VER >= 1900
>>>   #define HAVE_TIMESPEC
>>> +#define HAVE_TIMESPEC_GET
>>> +#elif defined(__MINGW32__)
>>> +#define HAVE_TIMESPEC
>>>   #endif
>>>   #ifndef HAVE_TIMESPEC
>>> @@ -645,7 +648,7 @@ tss_set(tss_t key, void *val)
>>>   /* 7.25.7 Time functions */
>>>   // 7.25.6.1
>>> -#ifndef HAVE_TIMESPEC
>>> +#ifndef HAVE_TIMESPEC_GET
>>>   static inline int
>>>   timespec_get(struct timespec *ts, int base)
>>>   {
>>>
>>
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev=DwIGaQ=uilaK90D4TOVoH58JNXRgQ=_QIjpv-UJ77xEQY8fIYoQtr5qv8wKrPJc7v7_-CYAb0=m3uFZN2gUOf6Z-8JON9FReiHkx7t76arYWaon9_g7VQ=6ODsK1Y5jckR6EXRqz6AJFH2Uwl63iZSwrW6SBclRZo=
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-09 Thread Brian Paul

On 11/09/2017 02:41 PM, Nicolai Hähnle wrote:

Sorry for the mess.


Not a huge deal.  FWIW, you can test the MinGW cross-compile pretty easily:

1. apt-get install g++-mingw-w64-x86-64 (or equivalent)
2. cd mesa ; scons platform=windows

-Brian



Reviewed-by: Nicolai Hähnle 

On 09.11.2017 17:46, Brian Paul wrote:

Fixes: f1a364878431c8 ("threads: update for late C11 changes")
---
  include/c11/threads_win32.h | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/c11/threads_win32.h b/include/c11/threads_win32.h
index 77d923a..dac8ef7 100644
--- a/include/c11/threads_win32.h
+++ b/include/c11/threads_win32.h
@@ -78,6 +78,9 @@ Configuration macro:
  /* Visual Studio 2015 and later */
  #if _MSC_VER >= 1900
  #define HAVE_TIMESPEC
+#define HAVE_TIMESPEC_GET
+#elif defined(__MINGW32__)
+#define HAVE_TIMESPEC
  #endif
  #ifndef HAVE_TIMESPEC
@@ -645,7 +648,7 @@ tss_set(tss_t key, void *val)
  /* 7.25.7 Time functions */
  // 7.25.6.1
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_TIMESPEC_GET
  static inline int
  timespec_get(struct timespec *ts, int base)
  {





___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-09 Thread Nicolai Hähnle

Sorry for the mess.

Reviewed-by: Nicolai Hähnle 

On 09.11.2017 17:46, Brian Paul wrote:

Fixes: f1a364878431c8 ("threads: update for late C11 changes")
---
  include/c11/threads_win32.h | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/c11/threads_win32.h b/include/c11/threads_win32.h
index 77d923a..dac8ef7 100644
--- a/include/c11/threads_win32.h
+++ b/include/c11/threads_win32.h
@@ -78,6 +78,9 @@ Configuration macro:
  /* Visual Studio 2015 and later */
  #if _MSC_VER >= 1900
  #define HAVE_TIMESPEC
+#define HAVE_TIMESPEC_GET
+#elif defined(__MINGW32__)
+#define HAVE_TIMESPEC
  #endif
  
  #ifndef HAVE_TIMESPEC

@@ -645,7 +648,7 @@ tss_set(tss_t key, void *val)
  
  /* 7.25.7 Time functions */

  // 7.25.6.1
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_TIMESPEC_GET
  static inline int
  timespec_get(struct timespec *ts, int base)
  {



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-09 Thread Roland Scheidegger
Looks alright to me.

Reviewed-by: Roland Scheidegger 

Am 09.11.2017 um 17:46 schrieb Brian Paul:
> Fixes: f1a364878431c8 ("threads: update for late C11 changes")
> ---
>  include/c11/threads_win32.h | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/c11/threads_win32.h b/include/c11/threads_win32.h
> index 77d923a..dac8ef7 100644
> --- a/include/c11/threads_win32.h
> +++ b/include/c11/threads_win32.h
> @@ -78,6 +78,9 @@ Configuration macro:
>  /* Visual Studio 2015 and later */
>  #if _MSC_VER >= 1900
>  #define HAVE_TIMESPEC
> +#define HAVE_TIMESPEC_GET
> +#elif defined(__MINGW32__)
> +#define HAVE_TIMESPEC
>  #endif
>  
>  #ifndef HAVE_TIMESPEC
> @@ -645,7 +648,7 @@ tss_set(tss_t key, void *val)
>  
>  /* 7.25.7 Time functions */
>  // 7.25.6.1
> -#ifndef HAVE_TIMESPEC
> +#ifndef HAVE_TIMESPEC_GET
>  static inline int
>  timespec_get(struct timespec *ts, int base)
>  {
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] threads: fix MinGW build breakage

2017-11-09 Thread Brian Paul
Fixes: f1a364878431c8 ("threads: update for late C11 changes")
---
 include/c11/threads_win32.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/c11/threads_win32.h b/include/c11/threads_win32.h
index 77d923a..dac8ef7 100644
--- a/include/c11/threads_win32.h
+++ b/include/c11/threads_win32.h
@@ -78,6 +78,9 @@ Configuration macro:
 /* Visual Studio 2015 and later */
 #if _MSC_VER >= 1900
 #define HAVE_TIMESPEC
+#define HAVE_TIMESPEC_GET
+#elif defined(__MINGW32__)
+#define HAVE_TIMESPEC
 #endif
 
 #ifndef HAVE_TIMESPEC
@@ -645,7 +648,7 @@ tss_set(tss_t key, void *val)
 
 /* 7.25.7 Time functions */
 // 7.25.6.1
-#ifndef HAVE_TIMESPEC
+#ifndef HAVE_TIMESPEC_GET
 static inline int
 timespec_get(struct timespec *ts, int base)
 {
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev