FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
573 views 1 comments
by anonymous

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 anonymous

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
by anonymous
Could you explain step-by-step?
Thanks.