I want to be able to build my project with both the ARM ADS and GNU tools. This is relatively easy for the C files, however, it is proving very difficult (actually impossible) to do this for assembly files. Anyone know of a clever trick (pre-processor?) that allows me to maintain a single assembly source file and assemble it with either GNU GAS or ADS ?
TIA, HG
Didn't find your answer? Ask the community — no account required.
4
42Bastian Schick
For our kernel I use a combination of C-Preprocessor and perl. I.e. I have one source that I pre-process to get ADS,IAR and GNU assembly.
This works fine (I do this for various CPUs).
42Bastian
Do not email to bastian42@yahoo.com, it's a spam-only account :-)
Use @epost.de instead !
H
HG
Any chance of an example of what you mean ?
TIA, HG
C
CodeSprite
snipped-for-privacy@hotmail.com (HG) wrote in news: snipped-for-privacy@posting.google.com:
This is a total hack and probably most offensive to perl experts, but worked for me where I had to take a GAS file and assemble it using ADS:
Obviously you'll have to extend it to cover GAS keywords that weren't in the code I was assembling. Just pipe the GAS file through the perl to get ADS compatible code...
#define LONG DCD #endif #if COMPILER == GNU .macro SC_FUNC32 name .code 32 .type \name,function \name: .endm
#define LONG .long #endif
Inside the source I only use macros for things that are specific to an assembler.
Two produce the actual files I'll pre-process the original source gcc -E -DCOMPILER=1 source.S >source_ads.s or gcc -E -DCOMPILER=2 source.S >source_gnu.S
Net effect: Comments are stripped if written as C comments.
After the above state you might use a simple C program or perl script to remove empty lines.
42Bastian
Do not email to bastian42@yahoo.com, it's a spam-only account :-)
Use @epost.de instead !
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.