Closed endertable closed 3 years ago
You will need a toolchain specific to your Linux OS, if it's an embedded device/camera the manufacturer may have one available. If you can share your device details perhaps I might be able to help.
For example some Axis cameras (ARTPEC-4 and ARTPEC-5 based) use mips32r2el and for that I've used the following toolchain on Ubuntu (16.04): https://packages.ubuntu.com/xenial/gcc-mipsel-linux-gnu
One thing that can help is if you can ssh
on to the device and run file <some executable>
you will get output similar to the following:
libgstkvssink.so: ELF 32-bit LSB shared object, MIPS, MIPS-II version 1 (SYSV), dynamically linked, BuildID[sha1]=0de4d021ea928ffcb6601442053f6e0723722de8, not stripped
(This is for a different library on a MIPS32 platform that I've built)
If you don't have file
on your embedded device no worries you can also scp
(or otherwise copy) the file from your embedded device to another standard linux/mac machine that does have the file
command. You just need to get your hands on one ELF file that is on the machine to find this out.
One thing that can help is if you can
ssh
on to the device and runfile <some executable>
you will get output similar to the following:libgstkvssink.so: ELF 32-bit LSB shared object, MIPS, MIPS-II version 1 (SYSV), dynamically linked, BuildID[sha1]=0de4d021ea928ffcb6601442053f6e0723722de8, not stripped
(This is for a different library on a MIPS32 platform that I've built)
If you don't have
file
on your embedded device no worries you can alsoscp
(or otherwise copy) the file from your embedded device to another standard linux/mac machine that does have thefile
command. You just need to get your hands on one ELF file that is on the machine to find this out.
Hi @hassanctech thanks for your response. Some kinda good news, I got a git from the manufacture:
http://git.ingenic.com.cn:8082/gerrit/toolchains/install/mips-gnus/mips-gcc472-glibc216 -b linux_r2.2-32bit
I grabbed this and now kind of have a ready-to-go generic toolchain, I think. I did the 'file' command on a few libraries and and an executable and below is the results:
ld-uClibc-0.9.33.2.so: ELF 32-bit LSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, stripped libdl-0.9.33.2.so: ELF 32-bit LSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter ld-uClibc.so.0, stripped live555MediaServer: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked, interpreter /lib/ld-uClibc.so.0, not stripped
One of the things I noticed is that the toolchain is using a loader of ld.so.1 -> ld-2.16.so and the cam has ld-uClibc.so.0 -> ld-uClibc-0.9.33.2.so in it's /lib directory (read-only). Does that mean I am going to have to use a different gcc as the toolchain is using mips-linux-gnu-gcc and i am guessing that it is using glibc.
I tried compiling ffmpeg and ended up with a "Segmentation fault" error on the cam after getting all the libs in
I have compiled programs before for my Linux box and really never any issue but this cross-compiling is going to give me next-level challenge. But I do like challenges. :)
Typically once you have a cross tool chain you should be able to build it properly, I know of a few other customers using a toolchain from ingenic (which seems to be what you're using) so I think it should work fine.
We actually perform an ARM cross compile as part of our Travis CI automation, here is the relevant section:
Now that you have your toolchain you can replace the arm stuff with your toolchain and should be able to build our libraries.
Closing this issue due to no response. Feel free re-open if you still face issues.
Would you still have an example of the cmake build flags you used to compile to mips?
I was looking for toolchain for the following. Have searched the web high and low and have found the 64 bit but my Linux OS is 32 bit
mips-gcc472-glibc216-32bit
Does anyone have this toolchain or a link as I need it to create compile programs for cam that I own and use this library version.