serial-android
serial-android copied to clipboard
Compiling for Arm 64bit fails
I tried to compile LibSerial library for arm 64 bit (APP_ABI := armeabi-v7a arm64-v8a), but got the following error below using ndk-build. Wondering if you guys know what is needed to support arm 64 bit ?
Error: [arm64-v8a] Compile++ : serial <= serial_jni.cc
[arm64-v8a] Compile++ : serial <= jni_utility.cc
[arm64-v8a] Compile++ : serial <= jni_main.cc
[arm64-v8a] Compile++ : nativehelper <= JNIHelp.cpp
[arm64-v8a] Compile++ : nativehelper <= JniConstants.cpp
[arm64-v8a] Compile++ : nativehelper <= toStringArray.cpp
[arm64-v8a] StaticLibrary : libnativehelper.a
[arm64-v8a] Compile : serialport <= glob.c
In file included from /serial-android/serial-android/libserial/src/main/jni/libs/serialport/glob.c:83:
In file included from /serial-android/serial-android/libserial/src/main/jni/libs/serialport/include/glob.h:40:
In file included from /usr/include/sys/_types.h:33:
/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
^
In file included from /serial-android/serial-android/libserial/src/main/jni/libs/serialport/glob.c:83:
In file included from /serial-android/serial-android/libserial/src/main/jni/libs/serialport/include/glob.h:40:
/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
^
2 errors generated.
Since glob is missing in NDK, we have to include the code and header in our build. But it seemed that the code I included won't build with 64 bit versions.
So, is there a solution as this will come up quite a bit as more devices move to 64bit and require 64 bit libs.
When I replace <sys/_types.h> with <sys/types.h> in glob.h file, it compiles fine for 64-bit and all other architectures.
@sachins works for me, thank you~
Would anyone post the nbew .so for the other cpus?