gpt4 book ai didi

android - 在 getrrsetbyname.c 中交叉编译适用于 Android 的 OpenSSH 失败

转载 作者:行者123 更新时间:2023-11-30 16:39:53 26 4
gpt4 key购买 nike

我正在尝试为 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 上,在系统解析中定义。H。然而,Android NDK 中的 resolv.h 并没有定义这些。

我是否遗漏了什么,或者 getrssetbyname.c 的当前形式与 Android NDK 不兼容?

最佳答案

如果有人对 Android 版交叉编译 OpenSSH 感兴趣,我建议查看 Termux项目,特别是termux-packages

关于android - 在 getrrsetbyname.c 中交叉编译适用于 Android 的 OpenSSH 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46881207/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com