Environment details:
make: 3.18
binutils: 2.18
arm-elf-gcc: 4.2.2
newlib: 1.16.0
gdb: 6.8.50-20080308-cvs
I am trying to compile a assembly file which is 'board_startup.S'
received as a part of the 'at91lib' package.
the file is provided in the attachment.
Questions:
1) How to make the assembler pre process the .s file before assembling?
2) What are the most essential options with which the assembler should
be invoked to generate the object file out of the assembly file (arm
architecture specific options are being taken care of)
Thanks
Vinit

> 1) How to make the assembler pre process the .s file before assembling?
You can run teh C pre-processor independently of the compiler. It is
called cpp (for an arm-elf cross-toolchain arm-elf-cpp [.exe extension
under Windows]). You can pass it any GCC options, only those that
control the pre-processor will have any affect. So you would pass the
-I<include-path> options for example, and any -D<macro>[=<value>]
options for example. Often it is just as easy to pass all CFLAGS or
AFLAGS.
> 2) What are the most essential options with which the assembler should> be invoked to generate the object file out of the assembly file (arm> architecture specific options are being taken care of)
Its your project, that's up to you. Assembler code has no options that
affect code generation since you generate the code manually. The
architecture options simply determine the instruction set and endianness
to validate against.
Clifford

In case it is useful, my make file invokes the following commands for
assembler file builds:
cpp $(INCLUDES) $< $(patsubst %.s, %_temp.s, $<)
$(AS) $(AFLAGS) $(patsubst %.s, %_temp.s, $<) -o $@
rm $(patsubst %.s, %_temp.s, $<)
The first executes the pre-processor on xxxx.s to produce xxxx_temp.s.
The second takes xxxx_temp.s to produce xxxx.o
The third deletes xxxx_temp.s
INCLUDES is the macro defining the project include paths. AFLAGS is
defined thus:
AFLAGS = -gdwarf2 -marmv4t --defsym THUMB_ONLY=0
This specifies the symbolic debugger format THUMB_ONLY is a macro used
in ny C runtime startup to produce THUMB specific code, when set to non
zero.
Clifford