openssl交叉编译报错,求指导!

todlee 2018-03-30 04:30:51
交叉编译paho.mqtt.c需要用到ssl库,就先编译openssl,下载的openssl-1.1.0h。首先在ubuntu上用gcc编译ok。然后更换gcc如下
./config no-asm shared --prefix=$PWD/install --cross-compile-prefix=mipsel-openwrt-linux-,编译最后报错

./libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
./libcrypto.so: undefined reference to `getcontext'
./libcrypto.so: undefined reference to `setcontext'
./libcrypto.so: undefined reference to `makecontext'

同样的代码,为什么换个gcc就报错了?不知道该怎么解决了。

PS:我先是使用的 openssl-1.0.2o.tar.gz交叉编译没有报错,paho.mqtt.c也没有报错(已修改makefile,引用的ssl都是交叉编译后的ssl库文件),但是sample里面的文件放到MT7688上执行报错./MQTTClient_subscribe: line 1: syntax error: unexpected word (expecting ")")。

哪位大神能指导下,没头绪了~
...全文
1647 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
fuluoce 2020-12-16
  • 打赏
  • 举报
回复
paho.mqtt.c 交叉编译通过了吗?

openssl按照下面去掉-m64 还是提示警告libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
https://blog.csdn.net/WanAnZaiQingChen/article/details/81507557
Echo-Young 2019-04-04
  • 打赏
  • 举报
回复
https://blog.csdn.net/WanAnZaiQingChen/article/details/81507557
todlee 2018-04-03
  • 打赏
  • 举报
回复
通过编译日志和源代码找到报错原因应该是mipsel-linux没有提供GNU C的ucontext库,openssl-1.0.2o.tar.gz中没有调用该函数族。解决办法更改原代码中的调用。 \openssl-1.1.0h\crypto\async\arch\async_posix.c int ASYNC_is_capable(void) { ucontext_t ctx; /* * Some platforms provide getcontext() but it does not work (notably * MacOSX PPC64). Check for a working getcontext(); */ return getcontext(&ctx) == 0; }

684

社区成员

发帖
与我相关
我的任务
社区描述
智能路由器通常具有独立的操作系统,包括OpenWRT、eCos、VxWorks等,可以由用户自行安装各种应用,实现网络和设备的智能化管理。
linuxpython 技术论坛(原bbs)
社区管理员
  • 智能路由器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧