YAMON compiling
Hello!
After installing SDE toolkit onto Linux box I tried to compile the YAMON bootloader source code (version of YAMON is 2.00). Few errors arised:
../arch/include/mips.h: Assembler messages:../arch/include/mips.h:397: Warning: rest of line ignored; first ignored character is `/'../arch/include/mips.h:398: Warning: rest of line ignored; first ignored character is `/'../arch/include/mips.h:399: Warning: rest of line ignored; first ignored character is `/'../arch/include/pb1000.h:1: Warning: rest of line ignored; first ignored character is `/'../arch/include/pb1000.h:3: Warning: rest of line ignored; first ignored character is `/'../arch/include/pb1000.h:406: Warning: rest of line ignored; first ignored character is `/'./../init/reset/reset.S:98: Warning: rest of line ignored; first ignored character is `/'./../init/reset/reset.S:99: Warning: rest of line ignored; first ignored character is `/'../arch/init/reset_db1550.S:641: Warning: rest of line ignored; first ignored character is `/'../arch/init/reset_db1550.S:739: Error: absolute expression required li' ../arch/init/reset_db1550.S:783: Error: absolute expression required li' ../arch/init/reset_db1550.S:821: Error: absolute expression required `li'
make: *** [reset.o] Error1
The lines in mips.h that arise these warnings are the following:
// #define AU1000 0x00030100
//#define AU1000 0x01030200
//#define AU1000_2_1 0x00030200
It seems it doesn't understand the comment syntax.
I have installed the version 5.03.06-LITE of SDE. Following is the code
extract around which error occures:
#define t1 $9
#define mem_sdconfiga 0x0840
#define MEM_SDCONFIGA_DDR 0x9030060A
#define MEM_SDREFCFG_D_DDR MEM_SDCONFIGA_DDR
li t1, MEM_SDREFCFG_D_DDR
sw t1, mem_sdconfiga(t0)
sync
Compiler thinks 'li t1, MEM_SDREFCFG_D_DDR' is 'bad expression', may be it guesses MEM_SDREFCFG_D_DDR is not defined correctly?
Thank you for every help in advance!
With best regards, Roman Mashak. E-mail: [email protected]
Quoted 4 lines · Roman Mashak
Hello!
After installing SDE toolkit onto Linux box I tried to compile the YAMON bootloader source code (version of YAMON is 2.00). Few errors arised:
...
Quoted 6 lines
The lines in
mips.hthat arise these warnings are the following:// #define AU1000
0x00030100
//#define AU10000x01030200
//#defineAU1000_2_10x00030200
The original MIPS assembler used '#' as a comment character. Using
an ANSI style C preprocessor where preprocessor directives do not need to be at the beginning of the line can can cause problems with files using this type of comment. For this reason sde-gcc tells the preprocessor to run in "traditional" mode which disables various ANSI features. In particular, the preprocessor in traditional mode does not accept '//' style comments.
Quoted 11 lines
#define t1 $9
#definemem_sdconfiga0x0840
#defineMEM_SDCONFIGA_DDR0x9030060A
#defineMEM_SDREFCFG_D_DDRMEM_SDCONFIGA_DDRli t1,
MEM_SDREFCFG_D_DDR
sw t1,mem_sdconfiga(t0)
syncCompiler thinks 'li t1,
MEM_SDREFCFG_D_DDR' is 'bad expression', may be it guessesMEM_SDREFCFG_D_DDRis not defined correctly?
If the '#define' was not at the beginning of the line the
preprocessor in traditional mode will ignore them and the assembler would end up treating these lines as comments which would cause this error.
I've attached a patch that works on a MIPS release of the YAMON-2.00
sources to override the preprocessor mode for assembler files. See if it helps...
Chris
Signature · 2 lines
Chris Dearman The Fruit Farm, Ely Road voice +44 1223 706206 MIPS Technologies (UK) Chittering, Cambs, CB5 9PH fax +44 1223 706250
makefile renamed from makefile.orig +1 -1
@@ -288,7 +288,7 @@ # SDE toolchain does not allow a construct like ".bss", it requires # .section bss instead. ifeq ($(TOOLCHAIN),sde) -CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_ -D_SDE_ +CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_ -D_SDE_ -fno-traditional-cpp else CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_ endif