serial-android icon indicating copy to clipboard operation
serial-android copied to clipboard

Compiling for Arm 64bit fails

Open bamirzada opened this issue 8 years ago • 5 comments

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.

bamirzada avatar Nov 10 '16 21:11 bamirzada

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.

chzhong avatar Nov 17 '16 09:11 chzhong

So, is there a solution as this will come up quite a bit as more devices move to 64bit and require 64 bit libs.

bamirzada avatar Dec 03 '16 01:12 bamirzada

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 avatar Mar 31 '17 23:03 sachins

@sachins works for me, thank you~

Windlesss avatar Mar 10 '19 03:03 Windlesss

Would anyone post the nbew .so for the other cpus?

nbelley avatar Dec 17 '20 13:12 nbelley