Rpi2
의 경우 기본 C 코드를 JNI
으로 컴파일하려고합니다. 나는 rpi
에서 GCC
으로 직접 해보려고했습니다. 나는 많은 다른 스위치를 시도했다, 그러나 아무것도 작동하지 않습니다와 나는 아직도 점점 오전 :Raspberry Pi 2 용 JNI와 C 컴파일 (잘못된 ELF 클래스)
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)
내가 사용하고 :
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
64 비트 공유 객체를 생성 한 것처럼 보입니다. 32 비트 JVM을 실행하는 경우 32 비트 공유 객체가 필요합니다. 'gcc -m32 ...'는 32 비트 공유 객체를 생성합니다. –