无法为 android 构建 berkeleyDB jdbc 驱动程序
Posted
技术标签:
【中文标题】无法为 android 构建 berkeleyDB jdbc 驱动程序【英文标题】:Can't build berkeleyDB jdbc driver for android 【发布时间】:2017-10-05 17:46:19 【问题描述】:我正在开发一个需要使用大型数据库但需要在 android 设备上运行的 Android 应用。
我找到了这个数据库并尝试按照这些说明进行操作:
http://docs.oracle.com/cd/E17076_02/html/installation/build_android_jdbc.html
1) 已下载 db-6.2.32
2) 运行 configure --enable-jdbc && make 没有问题
现在我正在尝试运行步骤 4.:
$ /ndk-build
这给了我这个错误:
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14.
/home/mariano/Android/android-ndk-r15b/build/core/build-binary.mk:688: Android NDK: Module db_archive depends on undefined modules: dl log icuuc icui18n utils
/home/mariano/Android/android-ndk-r15b/build/core/build-binary.mk:701: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies) . Stop.
之后,编辑 Android.mk 并添加以下行:
APP_ALLOW_MISSING_DEPS=true
这使得该过程开始,但最后,我有几个我不知道如何修复的错误:
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:162:34: error: unrecognized instruction mnemonic
if (MUTEXP_IS_BUSY(mutexp) || !MUTEXP_ACQUIRE(mutexp))
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:1099:2: note: expanded from macro 'MUTEXP_ACQUIRE'
MUTEX_SET(&(mutexp)->tas))
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:477:3: note: expanded from macro 'MUTEX_SET'
"ldrex %0, [%2]\n\t" \
^
<inline asm>:1:2: note: instantiated into assembly here
ldrex x8, [x28]
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:162:34: error: unrecognized instruction mnemonic
if (MUTEXP_IS_BUSY(mutexp) || !MUTEXP_ACQUIRE(mutexp))
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:1099:2: note: expanded from macro 'MUTEXP_ACQUIRE'
MUTEX_SET(&(mutexp)->tas))
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:478:17: note: expanded from macro 'MUTEX_SET'
"cmp %0, %1\n\t" \
^
<inline asm>:3:2: note: instantiated into assembly here
strexne x8, x20, [x28]
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:162:34: error: unrecognized instruction mnemonic
if (MUTEXP_IS_BUSY(mutexp) || !MUTEXP_ACQUIRE(mutexp))
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:1099:2: note: expanded from macro 'MUTEXP_ACQUIRE'
MUTEX_SET(&(mutexp)->tas))
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:477:3: note: expanded from macro 'MUTEX_SET'
"ldrex %0, [%2]\n\t" \
^
<inline asm>:1:2: note: instantiated into assembly here
ldrex x8, [x28]
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:162:34: error: unrecognized instruction mnemonic
if (MUTEXP_IS_BUSY(mutexp) || !MUTEXP_ACQUIRE(mutexp))
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:1099:2: note: expanded from macro 'MUTEXP_ACQUIRE'
MUTEX_SET(&(mutexp)->tas))
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:478:17: note: expanded from macro 'MUTEX_SET'
"cmp %0, %1\n\t" \
^
<inline asm>:3:2: note: instantiated into assembly here
strexne x8, x22, [x28]
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:213:3: error: too few operands for instruction
MEMBAR_ENTER();
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:492:23: note: expanded from macro 'MEMBAR_ENTER'
( __asm__ volatile ("dsb"); )
^
<inline asm>:1:2: note: instantiated into assembly here
dsb
^~~
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:439:3: error: too few operands for instruction
MEMBAR_ENTER();
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:492:23: note: expanded from macro 'MEMBAR_ENTER'
( __asm__ volatile ("dsb"); )
^
<inline asm>:1:2: note: instantiated into assembly here
dsb
^~~
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:623:4: error: too few operands for instruction
MEMBAR_EXIT();
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:494:23: note: expanded from macro 'MEMBAR_EXIT'
( __asm__ volatile ("dsb"); )
^
<inline asm>:1:2: note: instantiated into assembly here
dsb
^~~
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:635:3: error: too few operands for instruction
MEMBAR_EXIT();
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:494:23: note: expanded from macro 'MEMBAR_EXIT'
( __asm__ volatile ("dsb"); )
^
<inline asm>:1:2: note: instantiated into assembly here
dsb
^~~
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/mutex/mut_tas.c:619:4: error: too few operands for instruction
MEMBAR_EXIT();
^
/home/mariano/Downloads/db-6.2.32/build_android/jdbc/jni/../../../src/dbinc/mutex_int.h:494:23: note: expanded from macro 'MEMBAR_EXIT'
( __asm__ volatile ("dsb"); )
^
<inline asm>:1:2: note: instantiated into assembly here
dsb
^~~
7 warnings and 9 errors generated.
我正在运行 linux mint,
架构:x86_64 CPU 操作模式:32 位、64 位
【问题讨论】:
【参考方案1】:您应该在此处参考 Berkeley DB 6.2 在线文档:Building the Android JDBC Driver
看看第 7 步 - “构建 Android NDK:”
【讨论】:
以上是关于无法为 android 构建 berkeleyDB jdbc 驱动程序的主要内容,如果未能解决你的问题,请参考以下文章
使用 Perl64 在 Windows 7(64 位)上构建 BerkeleyDB 时出现编译/链接错误