11311 questions

13473 answers

21149 comments

31499 members

0 votes
296 views 0 comments
by

I am attempting to write software for the RUT955, but having trouble running it on the device.

Possible fault is incompatible cross-compiler.

It is a basic hello world written in C.

"mips-linux-gnu-gcc -static -march=74kc -mno-abicalls  -o hello gcc/hello.c" to cross compile it.

The header looks the same as the busybox that i pulled from the router.

I used "mips-linux-gnu-readelf -h busybox" and "mips-linux-gnu-readelf -h hello"

But it wont run

My flags seem ok. So I am unable to solve this myself. Please let me know if you have a solution.

1 Answer

0 votes
by

Nevermind. Solved it.

download, compile and install musl for mips

then to get it to work with rust,  put this in the cargo config

[target.mips-unknown-linux-musl]
linker = "~/Downloads/musl-cross-make-master/output/bin/mips-linux-musl-gcc"
rustflags = ["-C", "target-feature=+crt-static","-C", "link-args=-lgcc"]

Binary is pretty large compared to C code. 3Mb vs 16kb. But thats the cost of static standard library link.

Best answer