[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.dsdp.rtsc] Re: Object & Target Specific Build Options?

comments embedded below

Anthony Seely wrote:
I am trying to compile BIOS V6 as from CCSV4 with a bare-metal arm-gcc toolchain (4.4.1) and binutils (2.19).

This question isprobably best answered by the BIOS team, but I'll give it a shot below (and forward this question to them).


[snip]

For about six assembly files, there is a *specific* include that is needed.
For example the file Cache_asm.s needs to include package/internal/Cache.xdc.h
Whereas the file HwiCommon_asm.s needs to incldue package/internal/HwiCommon.xdc.h.


In other words, for each of these five assembly files, I need to run gcc with a specific '-imacros <filename>'.
I'm imagining there may be a way to set a target specific 'copts' attribute
- and in fact there are examples of how to do this in the RTSC help in the
Library.addObjects() function.
BUT there are a couple catches.
First catch - is I need to do this only for targets where I've changed the
extension from .s470 (TI 470 assembler) to .sBMArmR4 (gcc bare-metal ARM R4 target). Right now I've followed other examples in the BIOS tree and only used the
file basename in the 'objects' list. The local gcc bare-metal ARM R4 target
matches files with extension .sBMArmR4 and only *those* files are the ones
I need to add the -imacro header.h file name to.


Second catch, the build environment for BIOS includes a common build script
that adds all the objects in object list to the library.
So it will already have been added to the library with Library.addObject()
and *after the fact* I'd need to add a specific header file to the gcc command line for each of the individual assembly files.


I'm looking for some suggestions on how this might be accomplished; or maybe
an idea on a different way to tackle the issue.

It might be easier to include this option for all objects and structure the header to only conditionally define macros for the specific target you've created.


If your target follows the pattern of other targets there are a number of target-specific macros that are defined for any file including std.h; http://rtsc.eclipse.org/cdoc-tip/xdc/package.html#xdoc-sect-5

In particular, if your target is ti.targets.arm.BMArmR4 you can create a header like the following:
#ifdef ti_targets_arm_BMArmR4
:
#endif


You can also include #ifdef that reference symbols defined by your compiler. In this way the header can safely be included by _all_ files and you do not need to apply the -macros option selectively.

But, again, the BIOS team might have a better answer for their build setup.