
Hi Wolfgang,
you wrote:
mipsel-uclibc-gcc: unrecognized option `-EL'
It seems obvious that your tools and or compiler options are broken and/or misconfigured.
Where is this "-mips2 -EL" stuff coming from? You don't find this in U-Boot.
Sorry for skipping the first steps. I changed the prefix "mips_4KC-" into "mipsel-uclibc-" (./Makefile) leading to:
mipsel-uclibc-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0xB0000000 -I/opt/work/fw/b ootloader/u-boot-1.0.0.purple/include -fno-builtin -ffreestanding -nostdinc -isy stem /opt/toolchains/toolchain_mipsel/lib/gcc-lib/mipsel-linux/3.3.1/include -pi pe -DCONFIG_MIPS -D__MIPS__ -mcpu=4kc -EB -mabicalls -Wall -Wstrict-prototypes -c -o stubs.o stubs.c cc1: error: invalid option `cpu=4kc'
Afterwards I changed "-mcpu=4kc" into "-mips2" in cpu/mips/config.mk. "-EL" to replace "-EB" as I want a little-endian boot loader, but "-EL" is default anyway and ignored.
Obviously this is a tool problem first. I guess you will need to fix this anyway, or you will run into the same problems later when you want to compile your OS kernel and/or applications.
Doubt this, as I've already compiled a running 2.4.22 kernel. I've replaced "-mcpu=4kc" by "-march=4kc" (a better match I guess), applied Masami's patch of the linker control files and got:
mipsel-uclibc-gcc -Wa,-gstabs -D__ASSEMBLY__ -g -Os -D__KERNEL__ -DTEXT_BASE=0xB0000000 -I/opt/work/fw/bootloader/u-boot-1.0.0.work/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/toolchains/toolchain_mipsel/lib/gcc-lib/mipsel-linux/3.3.1/include -pipe -DCONFIG_MIPS -D__MIPS__ -march=4kc -mabicalls -c -o start.o /opt/work/fw/bootloader/u-boot-1.0.0.work/cpu/mips/start.S /opt/work/fw/bootloader/u-boot-1.0.0.work/cpu/mips/start.S: Assembler messages: /opt/work/fw/bootloader/u-boot-1.0.0.work/cpu/mips/start.S:242: Error: Cannot branch to undefined symbol. /opt/work/fw/bootloader/u-boot-1.0.0.work/cpu/mips/start.S:247: Error: Cannot branch to undefined symbol. /opt/work/fw/bootloader/u-boot-1.0.0.work/cpu/mips/start.S:259: Error: Cannot branch to undefined symbol.
I guess gcc 3.3.1 doesn't like the option "-mcpu=" nor branch-and-link to undefined symbols anymore. AFAIK the toolchain Masami recommended is verson 2.96.x
I've replaced the three branches (bal) by jumps (jal) and moved the GOT initialization before them which let me successfully compile the boot loader. I'll now add the board-specific stuff (serial driver, flash, network).
Wonder if anyone out there has ever tried gcc 3.3.x for compiling a MIPS U-Boot (big or little-endian)?
/Jörg