Bug 68169

Summary: s-osinte-rtems.ads is out of synch with type definitions of current newlib
Product: gcc Reporter: Jan Sommer <soja-lists>
Component: adaAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: ebotcazou
Priority: P3    
Version: 4.9.4   
Target Milestone: 4.9.4   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Jan Sommer 2015-10-31 15:24:08 UTC
For rtems the type definition of phtread_attr_t in s-osinte-rtems.ads and the corresponding one of current newlib are not equivalent.

Thus not enough memory is reserved by ada for this type and the call to the initializer will cause a stack corruption at least for arm-rtems4.11-targets.

I have tested the problem with the gcc4_9-branch and will provide a patch.
The rtems-developers are aware of the problem.
Comment 1 Jeffrey A. Law 2015-12-02 07:10:13 UTC
Author: law
Date: Wed Dec  2 07:09:41 2015
New Revision: 231145

URL: https://gcc.gnu.org/viewcvs?rev=231145&root=gcc&view=rev
Log:
[PATCH] Fix declaration of pthread-structs in s-osinte-rtems.ads (ada/68169)

	PR ada/68169
	* s-oscons-tmplt.c: Generate pthread constants for RTEMS
	* s-osinte-rtems.ads: Declare pthread structs as opaque types in Ada

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/s-oscons-tmplt.c
    trunk/gcc/ada/s-osinte-rtems.ads
Comment 2 Jeffrey A. Law 2015-12-04 18:40:45 UTC
Author: law
Date: Fri Dec  4 18:40:14 2015
New Revision: 231297

URL: https://gcc.gnu.org/viewcvs?rev=231297&root=gcc&view=rev
Log:
	PR ada/68169
	* s-oscons-tmplt.c: Generate pthread constants for RTEMS
	* s-osinte-rtems.ads: Declare pthread structs as opaque types in Ada


Modified:
    branches/gcc-5-branch/gcc/ada/ChangeLog
    branches/gcc-5-branch/gcc/ada/s-oscons-tmplt.c
    branches/gcc-5-branch/gcc/ada/s-osinte-rtems.ads
Comment 3 Jeffrey A. Law 2015-12-04 18:42:41 UTC
Author: law
Date: Fri Dec  4 18:42:10 2015
New Revision: 231299

URL: https://gcc.gnu.org/viewcvs?rev=231299&root=gcc&view=rev
Log:
	PR ada/68169
	* s-oscons-tmplt.c: Generate pthread constants for RTEMS
	* s-osinte-rtems.ads: Declare pthread structs as opaque types in Ada


Modified:
    branches/gcc-4_9-branch/gcc/ada/ChangeLog
    branches/gcc-4_9-branch/gcc/ada/s-oscons-tmplt.c
    branches/gcc-4_9-branch/gcc/ada/s-osinte-rtems.ads
Comment 4 Eric Botcazou 2015-12-06 20:43:23 UTC
Thanks Jeff.