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]

[patch] VxWorks configuration adjustments for powerpc 8548 (e500v2)


Hello,

The VxWorks compilation of C sources using vxworks header files need the CPU
macro to be defined. Configuration files in the compiler are setup to to pick
a default value depending on the cpu variant for which we are compiling.

On powerpc, this is achieved with:

  #define CPP_SPEC \
  "%{!DCPU=*:               \
     %{mcpu=403 : -DCPU=PPC403  ; \
       mcpu=405 : -DCPU=PPC405  ; \
       ...

in rs6000/vxworks.h.

The current definition misses an entry for the e500v2 family
of powerpc's, supported by VxWorks and by GCC with -mcpu=8548.

The attached patch is a proposal to add the missing entry, accounting
for a minor complication: the CPU value to set for e500v2 configurations
differs between the regular and the AE versions of VxWorks.

This is addressed by the use of an internal VXCPU_FOR_8548 configuration
macro, with a default definition in rs6000/vxworks.h and an override in a
vxworksae specific configuration file (rs6000/vxworksae.h).

vxworksae.h used to exist for this port. It was removed by rev 171779
for PR target/47109 as the file happened to be there only for TARGET_VERSION.
This patch re-instates the file, which we'll need for other purposes
in patches to be submitted later.

Tested by checking that
- the compiler builds after the patch, for both powerpc-wrs-vxworks
  and powerpc-wrs-vxworksae,
- the compiler produces the expected CPU defs for -mcpu=8548 in both
  cases,
- the behavior for other -mcpu selections is not altered.

OK for mainline ?

Thanks much in advance for your feedback,

With Kind Regards,

Olivier

2014-05-27  Olivier Hainque  <hainque@adacore.com>

        * config/rs6000/vxworks.h (VXCPU_FOR_8548): New. Default to PPC85XX.
        (CPP_SPEC): Add entry for -mcpu=8548.
        * config/rs6000/vxworksae.h: Reinstate. Override VXCPU_FOR_8548.
        * config.gcc (powerpc-wrs-vxworksae, tm_file): Add back vxworksae.h.

Attachment: vx8548.diff
Description: Binary data


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