[英]Cross-compiling OpenSSH for Android fails in getrrsetbyname.c
我正在嘗試交叉編譯適用於Android的OpenSSH 7.6p1。 它在getrrsetbyname.c
失敗。 這是該文件的clang輸出:
(cd openbsd-compat && /Applications/Xcode.app/Contents/Developer/usr/bin/make)
/Users/johannes/src/android_ssh/android_ndk_arm_api21/bin/clang -I/Users/johannes/src/android_ssh/prefix/include -pipe -Qunused-arguments -Wunknown-warning-option -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -fno-builtin-memset -fstack-protector-strong -I. -I.. -I. -I./.. -I~/src/android_ssh/prefix/include/openssl -DHAVE_CONFIG_H -c getrrsetbyname.c
getrrsetbyname.c:219:12: error: incomplete definition of type 'struct state'
if ((_resp->options & RES_INIT) == 0 && res_init() == -1) {
~~~~~^
getrrsetbyname.c:71:8: note: forward declaration of 'struct state'
struct __res_state _res;
^
../config.h:1785:21: note: expanded from macro '__res_state'
#define __res_state state
^
getrrsetbyname.c:219:24: error: use of undeclared identifier 'RES_INIT'
if ((_resp->options & RES_INIT) == 0 && res_init() == -1) {
^
getrrsetbyname.c:71:20: error: tentative definition has type 'struct state' that is never completed
struct __res_state _res;
^
getrrsetbyname.c:71:8: note: forward declaration of 'struct state'
struct __res_state _res;
^
../config.h:1785:21: note: expanded from macro '__res_state'
#define __res_state state
^
3 errors generated.
make[1]: *** [getrrsetbyname.o] Error 1
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2
因此,它缺少一個常量( RES_INIT
)和一個結構( struct __res_state
),至少在macOS以及可能在Linux上,它們都是在系統resolv.h中定義的。 但是,Android NDK中的resolv.h並未定義這些內容。
我是否缺少某些內容,或者getrssetbyname.c
只是與Android NDK的當前形式不兼容?
如果有人對用於Android的OpenSSH交叉編譯感興趣,我建議看一下Termux項目,尤其是termux-packages 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.