Seems that the assembler is not understanding the $xx notation for the registers.
Instead of trying to change the toolchain I would fire up gdb on your device and single step through the initialisation code of the helloworld.pas file. From my point of view it is more likely that you will find the problem in the startup-code and not the toolchain. There were good hints in this o the other thread that fpc startup code is checking the proc filesystem. There might be a few more incompatibility issues with the wrt-linux implementation, those will most likely only reveal themselves in gdb Michael Von meinem iPad gesendet Am 15.06.2013 um 19:19 schrieb Dennis Poon <den...@avidsoft.com.hk>: > > I eventually found this page which talked about downloading a special > toolchain from openwrt web site > > http://www.dd-wrt.com/phpBB2/viewtopic.php?t=61112 > > I followed its instruction and successfully compiled a helloworld c program > and > successfully RUN the helloworld binary on Netgear 3700 running DD-Wrt ! > > I was overjoyed. > > Then I tried to modify the steps to compile fpc > > my toolchains is at /home/dennis/toolchains/staging_dir_mips/bin/ > and in this folder, there are files: mips-linux-ar and mips-linux-as > so I > make clean all CPU_TARGET=mips OS_TARGET=linux > BINUTILSPREFIX=/home/dennis/toolchains/staging_dir_mips/bin/mips-linux- > > but I got errors: > > /home/dennis/toolchains/staging_dir_mips/bin/mips-linux-as -32 -mips32 -EB -o > /home/dennis/fpc/2.7.1/rtl/units/mips-linux/prt0.o mips/prt0.as > mips/prt0.as: Assembler messages: > mips/prt0.as:23: Error: illegal operands `lui $a2,%hi(__dl_fini)' > mips/prt0.as:25: Error: illegal operands `sw $v0,%lo(__dl_fini)($a2)' > mips/prt0.as:54: Error: illegal operands `move $s8,$sp' > mips/prt0.as:56: Error: illegal operands `sw $s8,%lo(__stkptr)($at)' > mips/prt0.as:65: Error: illegal operands `lw $a0,0($s8)' > mips/prt0.as:66: Error: illegal operands `lui > $a1,%hi(operatingsystem_parameter_argc)' > mips/prt0.as:67: Error: illegal operands `sw > $a0,%lo(operatingsystem_parameter_argc)($a1)' > mips/prt0.as:70: Error: illegal operands `addiu $a1,$s8,4' > mips/prt0.as:71: Error: illegal operands `lui > $a2,%hi(operatingsystem_parameter_argv)' > mips/prt0.as:72: Error: illegal operands `sw > $a1,%lo(operatingsystem_parameter_argv)($a2)' > mips/prt0.as:75: Error: illegal operands `addiu $a2,$a0,1' > mips/prt0.as:76: Error: illegal operands `sll $a2,$a2,0x2' > mips/prt0.as:77: Error: illegal operands `addu $a2,$a2,$a1' > mips/prt0.as:78: Error: illegal operands `lui > $a3,%hi(operatingsystem_parameter_envp)' > mips/prt0.as:79: Error: illegal operands `sw > $a2,%lo(operatingsystem_parameter_envp)($a3)' > mips/prt0.as:80: Error: illegal operands `lui $t9,%hi(PASCALMAIN)' > mips/prt0.as:81: Error: illegal operands `addiu $t9,$t9,%lo(PASCALMAIN)' > mips/prt0.as:82: Error: illegal operands `jalr $t9' > mips/prt0.as:95: Error: illegal operands `sw $a0,16($sp)' > mips/prt0.as:97: Error: illegal operands `lw $t9,%lo(__dl_fini)($at)' > mips/prt0.as:98: Error: illegal operands `beqz $t9,.L1' > mips/prt0.as:100: Error: illegal operands `jalr $t9' > mips/prt0.as:103: Error: illegal operands `lw $a0,16($sp)' > mips/prt0.as:104: Error: illegal operands `li $v0,4001' > make[5]: *** [prt0.o] Error 1 > make[5]: Leaving directory `/home/dennis/fpc/2.7.1/rtl/linux' > make[4]: *** [linux_all] Error 2 > make[4]: Leaving directory `/home/dennis/fpc/2.7.1/rtl' > make[3]: *** [rtl] Error 2 > make[3]: Leaving directory `/home/dennis/fpc/2.7.1/compiler' > make[2]: *** [cycle] Error 2 > make[2]: Leaving directory `/home/dennis/fpc/2.7.1/compiler' > make[1]: *** [compiler_cycle] Error 2 > make[1]: Leaving directory `/home/dennis/fpc/2.7.1' > make: *** [build-stamp.mips-linux] Error 2 > > > I feel I am almost there. Any help on the above? > > Dennis > _______________________________________________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal