> I'm trying to build some C code (separate .c files) and link the
.o > files together for Nios using the GNUPro tools that came with it. I > keep getting errors that ld can't find crt0.o. CRT0 isn't needed to link and execute Nios programs. During compilation of some Nios programs I can't see crt0 anywhere within the scripts. BTW: Use nios-build script for compilation and linking (or look inside what libraries are linked). I think all libraries needed for compilation are created during processor build process. Here is some example line with linker: # 2003.10.08 17:13:06 (*) nios-elf-gcc -I .. -I ../.. -I ../inc -I ../../inc -I ../../../inc -I ../../../../inc -I ../../../../../inc -W -g -O2 -mno-zero-extend -m32 g1.c -o g1.c.o -c In file included from g1.c:8: pid.h:10: warning: useless keyword or type name in empty declaration g1.c: In function `czekaj': g1.c:41: warning: `j' might be used uninitialized in this function # 2003.10.08 17:13:07 (*) nios-elf-gcc -I .. -I ../.. -I ../inc -I ../../inc -I ../../../inc -I ../../../../inc -I ../../../../../inc -W -g -O2 -mno-zero-extend -m32 pid.c -o pid.c.o -c In file included from pid.c:1: pid.h:10: warning: useless keyword or type name in empty declaration # 2003.10.08 17:13:07 (*) nios-elf-ld -e _start -u _start -g -T /cygdrive/c/altera/excalibur/sopc_builder/bin/excalibur.ld ../../lib/obj32/ nios_jumptostart.s.o g1.c.o pid.c.o --start-group -l nios32 -l c -l m -l gcc --end-group -L/cygdrive/c/altera/excalibur/sopc_builder/bin/nio s-gnupro/nios-elf/lib/m32 -L/cygdrive/c/altera/excalibur/sopc_builder/bin/ni os-gnupro/lib/gcc-lib/nios-elf/2.9-nios-010801-20020710/m32 -L.. /lib -L../../lib -L../../../lib -L../../../../lib -L../../../../../lib -L../ inc -L../../inc -L../../../inc -L../../../../inc -L../../../../. ./inc -L. -o pid.out # 2003.10.08 17:13:08 (*) nios-elf-objcopy -O srec pid.out pid.srec # 2003.10.08 17:13:08 (*) nios-elf-nm pid.out | sort > pid.nm # 2003.10.08 17:13:08 (*) nios-elf-objdump -d --source pid.out > pid.objdump Hope this helps. Jerry |