This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

define __PPC__ on vxworks, as gthr-vxworks.h expects


Working on dwarf eh for ppc-vxworks (kernel mode), we were observing
nasty runtime failures. These turned out to be caused by calls to vxTas
with a misaligned argument.

This is supposed to be handled with the __PPC__ related bits in
__gthread_once_t (gthr-vxworks.h):

   typedef struct
   #if !defined(__RTP__)
   #if defined(__PPC__)
     __attribute ((aligned (__alignof (unsigned))))
     volatile unsigned char busy;
     volatile unsigned char done;
   #if !defined(__RTP__) && defined(__PPC__)
     /* PPC's test-and-set implementation requires a 4 byte aligned
	object, of which it only sets the first byte.  We use padding
	here, in order to maintain some amount of backwards
	compatibility.  Without this padding, gthread_once objects worked
	by accident because they happen to be static objects and the ppc
	port automatically increased their alignment to 4 bytes.  */
     unsigned char pad1;
     unsigned char pad2;
   } __gthread_once_t;

but these actually don't operate because __PPC__ isn't defined.

The attached patch is a suggestion to fix this by adding the missing

Tested by rebuilding and observing proper runtime behavior of a couple
of Ada examples using dwarf exceptions.

OK ?

Thanks in advance,

With Kind Regards,


2010-08-20  Olivier Hainque  <>

	* config/rs6000/vxworks.h (TARGET_OS_CPP_BUILTINS): Define __PPC__.

Attachment: vxdefPPC.dif
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]