Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22032

Compiling C with JNI for Raspberry Pi 2 (wrong ELF class)

$
0
0

I am trying to compile basic C code with JNI for Rpi2. I was trying to do it directly in rpi with GCC. I have tried many different switches, but nothing is working and I am still getting:

Java HotSpot(TM) Client VM warning: You have loaded library /tmp/libTestLibraryWrapper7702387558318276188.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
/tmp/libTestLibraryWrapper7702387558318276188.so: 
/tmp/libTestLibraryWrapper7702387558318276188.so: 
wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)

I am using:

gcc -shared -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -c -g -I/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/include/ -I/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/include/linux -fPIC -MMD -MP -MF "build/Debug/GNU-Linux/testJava.o.d" -o build/Debug/GNU-Linux/testJava.o testJava.c

I am a little stuck right now, so any kind of hint will be appreciated.


Viewing all articles
Browse latest Browse all 22032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>