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]

Re: Support Xilinx PowerPC target boards

On Wed, Nov 19, 2008 at 09:48:07AM -0800, Michael Eager wrote:
> Michael Meissner wrote:
> >On Tue, Nov 18, 2008 at 08:56:20AM -0800, Michael Eager wrote:
> >>The attached patch adds default board configuration for
> >>--target=powerpc-xilinx-eabi.
> >>
> >>-- 
> >>Michael Eager
> >>1960 Park Blvd., Palo Alto, CA 94306  650-325-8077
> >
> >
> >>2008-11-18  Michael Eager <>
> >>
> >>	* config/rs6000/xilinx.h: New, options for
> >>	--target=powerpc-xilinx-eabi
> >>	* config.gcc: Include xilinx.h
> >
> >Rather than defining the defines in CPP_OS_DEFAULT_SPEC, it would be 
> >better to
> >This
> >way, if the user uses the -std=<xxx> call, it will only define __FOO__, 
> >and if
> >the user doesn't use -std=<xxx>, it will define FOO and __FOO__.  Hopefully
> >Xilinx can change their header files to use either FOO or __FOO__ being
> >defined.
> It doesn't appear that this would permit defines which are conditional
> on command line options.

Sure it does.  For example, from the sysv4.h file in the rs6000 directory we

  do						\
    {						\
      if (target_flags_explicit			\
	builtin_define ("_RELOCATABLE");	\
    }						\
  while (0)

Which only defines _RELOCATABLE if -mrelocatable was used.  You should be able
to use just about any tests you want.

In the old days, we needed to the -Dxxxx in CPP_SPEC because the preprocessor
was a separate program from the compiler proper.  Since 3.3, the preprocessor
has been folded into the compiler binary, and you can now use target tests to
define whatever macros you need.

There are several functions in c-cppbuiltin.c you can use:

builtin_define_std -- If the macro is in the user's name space (i.e. does not
begin with "__" or "_" and an upper case letter), define __<name>, __<name>__.
If the iso flag is not set, also define <name>.

builtin_define_with_value -- Define a macro with a string value.

builtin_define_with_int_value -- Define a macro with an integer value.

builtin_define -- Define a single macro.

builtin_assert -- Define an assert.

Note, the calls to builtin_define, etc. have to be in the macros ultimately
TARGET_OBJFMT_CPP_BUILTINS, or in a function in rs6000-c.c.

Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA

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