diff mbox

[PING^5] PR 54805: __gthread_tsd* in vxlib-tls.c

Message ID 511C033D.9010001@verizon.net
State New
Headers show

Commit Message

rbmj Feb. 13, 2013, 9:18 p.m. UTC
On 18-Jan-13 20:35, Maxim Kuvyrkov wrote:
> On 19/01/2013, at 9:18 AM, rbmj wrote:
>
>>>>   -150,7 +158,7 @@ static __gthread_once_t tls_init_guard =
>>>>      need to read tls_keys.dtor[key] atomically.  */
>>>>
>>>>   static void
>>>> -tls_delete_hook (void *tcb ATTRIBUTE_UNUSED)
>>>> +tls_delete_hook (void *tcb)
>>>
>>> Don't remove ATTRIBUTE_UNUSED.  TCB was and will remain unused #ifdef __RTP__.
>>>
>>
>> And #ifndef __RTP__ ?
>
> No, simply leave that line as is.  ATTRIBUTE_UNUSED tells the compiler that a variable can be unused, but not necessarily is unused.  It's fine to have this attribute set on variables that are used under certain preprocessor configurations.
>

Seems like I kept this email in drafts and never sent it out...

Sorry about that.

Here's the updated, (trivial) patch.

--
Robert Mason

Comments

Maxim Kuvyrkov Feb. 17, 2013, 4:21 a.m. UTC | #1
On 14/02/2013, at 10:18 AM, rbmj wrote:

> On 18-Jan-13 20:35, Maxim Kuvyrkov wrote:
>> On 19/01/2013, at 9:18 AM, rbmj wrote:
>> 
>>>>>  -150,7 +158,7 @@ static __gthread_once_t tls_init_guard =
>>>>>     need to read tls_keys.dtor[key] atomically.  */
>>>>> 
>>>>>  static void
>>>>> -tls_delete_hook (void *tcb ATTRIBUTE_UNUSED)
>>>>> +tls_delete_hook (void *tcb)
>>>> 
>>>> Don't remove ATTRIBUTE_UNUSED.  TCB was and will remain unused #ifdef __RTP__.
>>>> 
>>> 
>>> And #ifndef __RTP__ ?
>> 
>> No, simply leave that line as is.  ATTRIBUTE_UNUSED tells the compiler that a variable can be unused, but not necessarily is unused.  It's fine to have this attribute set on variables that are used under certain preprocessor configurations.
>> 
> 
> Seems like I kept this email in drafts and never sent it out...
> 
> Sorry about that.
> 
> Here's the updated, (trivial) patch.

Thanks.  I'll apply this once 4.8 branches and trunk is back into development mode.

--
Maxim Kuvyrkov
rbmj March 19, 2013, 2:38 a.m. UTC | #2
On 16-Feb-13 23:21, Maxim Kuvyrkov wrote:
> On 14/02/2013, at 10:18 AM, rbmj wrote:
>> Here's the updated, (trivial) patch.
>
> Thanks.  I'll apply this once 4.8 branches and trunk is back into development mode.
>

Since GCC 4.9 has branched now are you still willing to commit (maybe 
after the outage is over; I don't know the state of the svn server)?

One of my friends has also commented that the warning that this fixes 
causes the launchpad PPA system to reject the package (based on the 
build log), so is it possible for this to apply in 4.8.1 also?  I don't 
know how that process works, I assume I'd have to wait until after 4.8.0 
officially releases.  I understand that it's way too late for 4.8.0 
(_trivial_ as the fix is) :(

Suggested ChangeLog:

[libgcc]
<DATE> Robert Mason <rbmj@verizon.net>
	* config/vxlib-tls.c: Add prototypes for __gthread_tsd*()

Robert Mason
Maxim Kuvyrkov March 19, 2013, 7:04 a.m. UTC | #3
On 19/03/2013, at 3:38 PM, rbmj wrote:

> On 16-Feb-13 23:21, Maxim Kuvyrkov wrote:
>> On 14/02/2013, at 10:18 AM, rbmj wrote:
>>> Here's the updated, (trivial) patch.
>> 
>> Thanks.  I'll apply this once 4.8 branches and trunk is back into development mode.
>> 
> 
> Since GCC 4.9 has branched now are you still willing to commit (maybe after the outage is over; I don't know the state of the svn server)?
> 
> One of my friends has also commented that the warning that this fixes causes the launchpad PPA system to reject the package (based on the build log), so is it possible for this to apply in 4.8.1 also?  I don't know how that process works, I assume I'd have to wait until after 4.8.0 officially releases.  I understand that it's way too late for 4.8.0 (_trivial_ as the fix is) :(
> 
> Suggested ChangeLog:
> 
> [libgcc]
> <DATE> Robert Mason <rbmj@verizon.net>
> 	* config/vxlib-tls.c: Add prototypes for __gthread_tsd*()

Yes, this is on my list.  I tried to commit your patch earlier today, but GCC server is currently being upgraded and is down.

Will commit to trunk once the server is up.

Regarding 4.8, we should've really tried to work it out earlier.  If you want to pursue backport to 4.8, please attach the log of PPA system rejecting the package (fwiw, I don't quite understand which launchpad you are referring to).

Thanks,

--
Maxim Kuvyrkov
KugelWorks
rbmj March 20, 2013, 12:42 p.m. UTC | #4
It looks like this message didn't go through; if you get this multiple 
times I apologize.  I've been having issues so I don't trust that it 
sent correctly :/

On 19-Mar-13 03:04, Maxim Kuvyrkov wrote:
>
> Will commit to trunk once the server is up.
>
> Regarding 4.8, we should've really tried to work it out earlier.  If you want to pursue backport to 4.8, please attach the log of PPA system rejecting the package

The error is:

======
Finished at 20130318-0642
Build needed 00:14:20, 804796k disk space
Function `__gthread_get_tsd_data' implicitly converted to pointer at 
/build/buildd/gcc-powerpc-wrs-vxworks-4.8.0+0svn196132/libgcc/config/vxlib-tls.c:164



Our automated build log filter detected the problem(s) above that will
likely cause your package to segfault on architectures where the size of
a pointer is greater than the size of an integer, such as ia64 and amd64.

This is often due to a missing function prototype definition.

Since use of implicitly converted pointers is always fatal to the 
application
on ia64, they are errors.  Please correct them for your next upload.
======

This problem does not apply on the target (powerpc-wrs-vxworks), where 
sizeof(int*) == sizeof(int(*)()) == sizeof(int) == 4.  However, the 
build system's filters are too stupid to realize this.  Because the 
warning is spurious really the fact that the automated build system 
rejects the package is a bug on the build system's part.  However, doing 
it the Right Way is so _easy_...

>(fwiw, I don't quite understand which launchpad you are referring to).

I am referring to https://launchpad.net/ubuntu/+ppas

Thanks for your help.

Robert Mason
Maxim Kuvyrkov March 20, 2013, 11:22 p.m. UTC | #5
On 20/03/2013, at 1:35 AM, rbmj wrote:

> On 19-Mar-13 03:04, Maxim Kuvyrkov wrote:
>> 
>> Will commit to trunk once the server is up.

The patch is now committed.

>> 
>> Regarding 4.8, we should've really tried to work it out earlier.  If you want to pursue backport to 4.8, please attach the log of PPA system rejecting the package
> 
> The error is:
> 
> ======
> Finished at 20130318-0642
> Build needed 00:14:20, 804796k disk space
> Function `__gthread_get_tsd_data' implicitly converted to pointer at /build/buildd/gcc-powerpc-wrs-vxworks-4.8.0+0svn196132/libgcc/config/vxlib-tls.c:164
> 
> 
> 
> Our automated build log filter detected the problem(s) above that will
> likely cause your package to segfault on architectures where the size of
> a pointer is greater than the size of an integer, such as ia64 and amd64.
> 
> This is often due to a missing function prototype definition.
> 
> Since use of implicitly converted pointers is always fatal to the application
> on ia64, they are errors.  Please correct them for your next upload.
> ======
> 
> This problem does not apply on the target (powerpc-wrs-vxworks), where sizeof(int*) == sizeof(int(*)()) == sizeof(int) == 4.  However, the build system's filters are too stupid to realize this.  Because the warning is spurious really the fact that the automated build system rejects the package is a bug on the build system's part.  However, doing it the Right Way is so _easy_...

Richard,

As release manager, do you have any objections to backporting this patch to 4.8 branch?  It affects only VxWorks targets and it is quite harmless (the patch fixes a compilation warning during building GCC for VxWorks targets).

Thanks,

--
Maxim Kuvyrkov
KugelWorks
Richard Biener March 25, 2013, 9:15 a.m. UTC | #6
On Thu, Mar 21, 2013 at 12:22 AM, Maxim Kuvyrkov <maxim@kugelworks.com> wrote:
> On 20/03/2013, at 1:35 AM, rbmj wrote:
>
>> On 19-Mar-13 03:04, Maxim Kuvyrkov wrote:
>>>
>>> Will commit to trunk once the server is up.
>
> The patch is now committed.
>
>>>
>>> Regarding 4.8, we should've really tried to work it out earlier.  If you want to pursue backport to 4.8, please attach the log of PPA system rejecting the package
>>
>> The error is:
>>
>> ======
>> Finished at 20130318-0642
>> Build needed 00:14:20, 804796k disk space
>> Function `__gthread_get_tsd_data' implicitly converted to pointer at /build/buildd/gcc-powerpc-wrs-vxworks-4.8.0+0svn196132/libgcc/config/vxlib-tls.c:164
>>
>>
>>
>> Our automated build log filter detected the problem(s) above that will
>> likely cause your package to segfault on architectures where the size of
>> a pointer is greater than the size of an integer, such as ia64 and amd64.
>>
>> This is often due to a missing function prototype definition.
>>
>> Since use of implicitly converted pointers is always fatal to the application
>> on ia64, they are errors.  Please correct them for your next upload.
>> ======
>>
>> This problem does not apply on the target (powerpc-wrs-vxworks), where sizeof(int*) == sizeof(int(*)()) == sizeof(int) == 4.  However, the build system's filters are too stupid to realize this.  Because the warning is spurious really the fact that the automated build system rejects the package is a bug on the build system's part.  However, doing it the Right Way is so _easy_...
>
> Richard,
>
> As release manager, do you have any objections to backporting this patch to 4.8 branch?  It affects only VxWorks targets and it is quite harmless (the patch fixes a compilation warning during building GCC for VxWorks targets).

It's certainly fine now.

Richard.

> Thanks,
>
> --
> Maxim Kuvyrkov
> KugelWorks
>
Maxim Kuvyrkov March 26, 2013, 10:07 p.m. UTC | #7
On 25/03/2013, at 10:15 PM, Richard Biener wrote:

> On Thu, Mar 21, 2013 at 12:22 AM, Maxim Kuvyrkov <maxim@kugelworks.com> wrote:
...
>> Richard,
>> 
>> As release manager, do you have any objections to backporting this patch to 4.8 branch?  It affects only VxWorks targets and it is quite harmless (the patch fixes a compilation warning during building GCC for VxWorks targets).
> 
> It's certainly fine now.

Checked in to gcc-4_8-branch.

--
Maxim Kuvyrkov
KugelWorks
diff mbox

Patch

diff a/libgcc/config/vxlib-tls.c b/libgcc/config/vxlib-tls.c
--- a/libgcc/config/vxlib-tls.c
+++ b/libgcc/config/vxlib-tls.c
@@ -102,6 +102,14 @@  extern void __gthread_set_tls_data (void
 extern void __gthread_enter_tls_dtor_context (void);
 extern void __gthread_leave_tls_dtor_context (void);
 
+#ifndef __RTP__
+
+extern void *__gthread_get_tsd_data (WIND_TCB *tcb);
+extern void __gthread_set_tsd_data (WIND_TCB *tcb, void *data);
+extern void __gthread_enter_tsd_dtor_context (WIND_TCB *tcb);
+extern void __gthread_leave_tsd_dtor_context (WIND_TCB *tcb);
+
+#endif /* __RTP__ */
 
 /* This is a global structure which records all of the active keys.
 
@@ -185,7 +193,7 @@  tls_delete_hook (void *tcb ATTRIBUTE_UNU
 #ifdef __RTP__
       __gthread_leave_tls_dtor_context ();
 #else
-      __gthread_leave_tsd_dtor_context ();
+      __gthread_leave_tsd_dtor_context (tcb);
 #endif
 
 #ifdef __RTP__

-- 1.7.10.4