Possible cause: can't load ARM-bit .so on a IA 32-bit platform
Question:
I am a java developer. I have some C++ code to make some
system realted calls. This code is compiled on Intel 32-bit platform
using GCC (I have make files) and it works fine on regular Intel based
32-bit linux machine. Now I need to run this on a linux OS running on
Marvell ARM processor. When I load the shared objects in java I get the
following error.
cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
Please tell me how to resolve this issue. I looked at the GCC options and I found one option to specify the architecture (-march=armv5) and I can't compile with that option.
Thanks in advance.
cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
Please tell me how to resolve this issue. I looked at the GCC options and I found one option to specify the architecture (-march=armv5) and I can't compile with that option.
Thanks in advance.
Approach 1:
You need more than just a switch, you need a cross-compiler. You can make your own, but probably the easiest way is :
Cross compiling simple project is then easy, just override the CC variable in your Makefile :
- Find the development tools for your board. It probably comes with a development kit that includes a cross-compilation toolchain
- If you don't have these, you can try to install a precompiled cross-compilation like the ones provided freely by CodeSourcery
Cross compiling simple project is then easy, just override the CC variable in your Makefile :
CROSS = arm-none-linux-gnueabi-
CC = $(CROSS)gcc
LD = $(CROSS)ld
Approach 2:
Try using the -mcpu=armv5 switch for gcc.
Comments
Post a Comment