This is the mail archive of the gcc-patches@gcc.gnu.org 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


Hello,

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))))
   #endif
     volatile unsigned char busy;
   #endif
     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;
   #endif
   } __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
#definition.

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

OK ?

Thanks in advance,

With Kind Regards,

Olivier


2010-08-20  Olivier Hainque  <hainque@adacore.com>

	* 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]