恩山无线论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 160|回复: 3

使用LEAN源码编译固件出现undefined reference to `pthread_once'错误的解决办法

[复制链接]
发表于 2020-12-19 14:53 | 显示全部楼层 |阅读模式
本帖最后由 neozb 于 2020-12-25 14:04 编辑

编译过程中出现提示如下后失败:

  1. make -C /home/tom/lede/build_dir/target-arm_xscale_musl_eabi/linux-kirkwood/linux-5.4.83 KCFLAGS="-ffile-prefix-map=/home/tom/lede/build_dir/target-arm_xscale_musl_eabi=target-arm_xscale_musl_eabi" HOSTCFLAGS="-O2 -I/home/tom/lede/staging_dir/host/include  -Wall -Wmissing-prototypes -Wstrict-prototypes" CROSS_COMPILE="arm-openwrt-linux-muslgnueabi-" ARCH="arm" KBUILD_HAVE_NLS=no KBUILD_BUILD_USER="" KBUILD_BUILD_HOST="" KBUILD_BUILD_TIMESTAMP="Thu Dec 17 15:29:07 2020" KBUILD_BUILD_VERSION="0" HOST_LOADLIBES="-L/home/tom/lede/staging_dir/host/lib" KBUILD_HOSTLDLIBS="-L/home/tom/lede/staging_dir/host/lib" CONFIG_SHELL="bash" V=''  cmd_syscalls= KERNELRELEASE=5.4.83 CC="arm-openwrt-linux-muslgnueabi-gcc" modules


  2. make[5]: Entering directory '/home/tom/lede/build_dir/target-arm_xscale_musl_eabi/linux-kirkwood/linux-5.4.83'
  3.   HOSTCC  scripts/extract-cert
  4. /usr/bin/ld: /home/tom/lede/staging_dir/host/lib/libcrypto.a(libcrypto_la-eng_all.o): in function `ENGINE_load_builtin_engines':
  5. eng_all.c:(.text+0x30): undefined reference to `pthread_once'
  6. /usr/bin/ld: /home/tom/lede/staging_dir/host/lib/libcrypto.a(libcrypto_la-err.o): in function `ERR_load_ERR_strings':
  7. err.c:(.text+0xa7e): undefined reference to `pthread_once'
  8. /usr/bin/ld: /home/tom/lede/staging_dir/host/lib/libcrypto.a(libcrypto_la-err_all.o): in function `ERR_load_crypto_strings':
  9. err_all.c:(.text+0x9f): undefined reference to `pthread_once'
  10. /usr/bin/ld: /home/tom/lede/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): in function `OpenSSL_add_all_ciphers':
  11. c_all.c:(.text+0x9df): undefined reference to `pthread_once'
  12. /usr/bin/ld: /home/tom/lede/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): in function `OpenSSL_add_all_digests':
  13. c_all.c:(.text+0x9ff): undefined reference to `pthread_once'
  14. /usr/bin/ld: /home/tom/lede/staging_dir/host/lib/libcrypto.a(libcrypto_la-crypto_init.o):crypto_init.c:(.text+0x51): more undefined references to `pthread_once' follow
  15. collect2: error: ld returned 1 exit status
  16. make[6]: *** [scripts/Makefile.host:107: scripts/extract-cert] Error 1
  17. make[5]: *** [Makefile:1123: scripts] Error 2
  18. make[5]: Leaving directory '/home/tom/lede/build_dir/target-arm_xscale_musl_eabi/linux-kirkwood/linux-5.4.83'
  19. make[4]: *** [Makefile:24: /home/tom/lede/build_dir/target-arm_xscale_musl_eabi/linux-kirkwood/linux-5.4.83/.modules] Error 2
  20. make[4]: Leaving directory '/home/tom/lede/target/linux/kirkwood'
  21. make[3]: *** [Makefile:13: compile] Error 2
  22. make[3]: Leaving directory '/home/tom/lede/target/linux'
  23. time: target/linux/compile#1.32#0.56#1.87
  24. make[2]: *** [target/Makefile:25: target/linux/compile] Error 2
  25. make[2]: Leaving directory '/home/tom/lede'
  26. make[1]: *** [target/Makefile:18: /home/tom/lede/staging_dir/target-arm_xscale_musl_eabi/stamp/.target_compile] Error 2
  27. make[1]: Leaving directory '/home/tom/lede'
  28. make: *** [/home/tom/lede/include/toplevel.mk:224:world] 错误 2
复制代码
百度了2天没找到答案,哪位大神能给分析一下如何解决,先谢谢了。
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2020-12-19 14:56 | 显示全部楼层
百度 undefined reference to `pthread_once'错误都是说编译时加参数-lpthread,但是不知道从哪个makeconfig文件里加?
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2020-12-25 14:06 | 显示全部楼层
解决了,在lede/build_dir/target-arm_xscale_musl_eabi/linux-kirkwood/linux-5.4.83/scripts/Makefile中

把HOSTLDLIBS_extract-cert = -lcrypto后面加上 -pthread
即HOSTLDLIBS_extract-cert = -lcrypto -pthread
OK
我的恩山、我的无线 The best wifi forum is right here.
发表于 2020-12-26 21:44 | 显示全部楼层
,我只想说,我在wsl,下遇到问题,各种问题,原因是文件权限问题,
在deepin遇到问题,是因为把编译文件放到了挂载的U盘里面导致的文件权限问题
在deepin遇上的问题,是因为文件的DL文件不完整
,解决以上问题,轻轻松松出固件
我的恩山、我的无线 The best wifi forum is right here.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )|网站地图

GMT+8, 2021-1-25 05:42

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表