|Object & Target Specific Build Options? [message #484935]
||Wed, 09 September 2009 14:58
Originally posted by: a-seely.ti.com|
I am trying to compile BIOS V6 as from CCSV4 with a bare-metal arm-gcc
toolchain (4.4.1) and binutils (2.19).
BIOS has a few assembly language files that include "C" header files with a
line in the assembly source containing a directive ".CDECLS ... header.h"
This is a feature of the TI assembler that will allow the use of macro
definitions from C header files.
I don't see any equivalent *directive* in GAS. You can use a
include directive but that's not for "C" it's for assembly.
However, you can invoke gcc with the following options:
-P -imacros=headerfile -x assembler-with-cpp
And it has the same effect as the TI .CDECLS directive.
The C header is preprocessed but only macro definitions are set,
there is no other output (not even comments -P) then the assembler is run.
That much is ok. I've tried this from the command line and it works fine.
My problem now is to get the same effect through the XDC build script.
For about six assembly files, there is a *specific* include that is needed.
For example the file Cache_asm.s needs to include
Whereas the file HwiCommon_asm.s needs to incldue
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
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
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
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
an idea on a different way to tackle the issue.
|Re: Object & Target Specific Build Options? [message #485183 is a reply to message #484935]
||Thu, 10 September 2009 14:09
| Sasha Slijepcevic
Registered: July 2009
you probably created your target from some of the existing targets. Most
of the targets have the configuration parameter 'asmOpts'. You could add
following to your target in config.bld ONLY when you build BIOS 6.
targ.asmOpts.suffix = "-P -imacros=package/internal/$(subst
_asm,,$(basename $(notdir $@))).xdc.h -x assembler-with-cpp";
I haven't really tested if the make function calls I used are just right,
so you might need to make some edits but you can tell where I am going
This is a hack that relies on knowing what's inside our generated
makefiles, so if you decide to try it, you probably want to use it only
until the BIOS 6 build system adds some options to let you specify per
file command line options.
Powered by FUDForum
. Page generated in 0.01565 seconds