X-osadminの自留地
  • 博客主页 HomePage
  • 技术小絮 Tech
  • 作品发布 Works
  • 软件专题 Softs
    • proxmox
    • openwrt
    • chromebook
    • Zerotier
    • 虚拟化
  • 友情链接 Following

xosadmin

BGPlayer / Codes learner / Love Linux
Posts
75
Comments
0

友情链接 – Friendly Links

  • Add your site here…
xosadmin
4 years ago

OpenWrt编译时产生Undefined reference to ‘pthread_once’的解决方法

近日在尝试通过自定义的Kernel编译OpenWrt时,出现了如下错误:

make[5]: Entering directory ‘<working-dir>/build_dir/target-aarch64_generic_musl/linux-layerscape_armv8_64b/linux-5.4.42′
HOSTCC scripts/extract-cert
<working-dir>/staging_dir/host/lib/libcrypto.a(libcrypto_la-eng_all.o): In function ENGINE_load_builtin_engines’: eng_all.c:(.text+0x30): undefined reference to pthread_once’
<working-dir>/staging_dir/host/lib/libcrypto.a(libcrypto_la-err.o): In function ERR_load_ERR_strings’: err.c:(.text+0xb4e): undefined reference to pthread_once’
<working-dir>/staging_dir/host/lib/libcrypto.a(libcrypto_la-err_all.o): In function ERR_load_crypto_strings’: err_all.c:(.text+0x9f): undefined reference to pthread_once’
<working-dir>/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): In function OpenSSL_add_all_ciphers’: c_all.c:(.text+0x9df): undefined reference to pthread_once’
<working-dir>/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): In function OpenSSL_add_all_digests’: c_all.c:(.text+0x9ff): undefined reference to pthread_once’
<working-dir>/staging_dir/host/lib/libcrypto.a(libcrypto_la-crypto_init.o):crypto_init.c:(.text+0x51): more undefined references to `pthread_once’ follow
collect2: error: ld returned 1 exit status
scripts/Makefile.host:107: recipe for target ‘scripts/extract-cert’ failed
make[6]: *** [scripts/extract-cert] Error 1
Makefile:1105: recipe for target ‘scripts’ failed
make[5]: *** [scripts] Error 2

一开始是认为是config文件出现问题。尝试重新配置,依旧出现这个问题。通过摸索与搜索,得出以下结果:

编辑<openwrt主目录>/build_dir/target-x86_64_musl/linux-x86_64/linux-<版本号>/scripts/Makefile

搜索关键词:HOSTLDLIBS_extract-cert

将原始行注释,并在下方添加如下代码:

[info]HOSTLDLIBS_extract-cert = -lcrypto -lpthread[/info]

重新执行编译即可。

Enjoy~

  • openwrt
等 人表示很赞
2,820
0

📮Comments

No Comment.
xosadmin
xosadmin
4 years ago
推荐 OpenWrt设置DMZ主机的方法
OpenWrt是一个开源且十分强大的路由操作系统。部分OpenWrt服务器拥有多于一个的IP地址。这些IP地址可以用于设置DMZ主机,使外网用户能直接访问到内网主机的端口上。在本次,使用OpenWrt的Firewall转发来完成这一操作。话 ...
  • openwrt
12,057 0
xosadmin
xosadmin
4 years ago
推荐 OpenWrt做二级路由时无法访问上级路由内网的解决方案
近日在调试openwrt做为二级路由时遇到了一个问题:当openwrt软路由做为二级路由时无法访问上级路由的内网。经过一番测试,得出原因是来自于路由表配置。解决方法如下: PS: 本文中openwrt内网假设为2.2.2.0/24,open ...
  • openwrt
  • 技术小絮
7,343 0
xosadmin
xosadmin
4 years ago
推荐 OpenWrt update feeds时提示错误的解决方法
如题,在一台ubuntu server的机器上尝试编译OpenWrt时,系统提示fatal: unable to access ‘https://git.openwrt.org/feed/routing.git/’: ...
  • openwrt
2,527 0
  • Windows FTP服务器通过PASV模式无法获取目录的解决方法
  • Proxmox日志出现大量lxcfs truncated错误的解决方案
  • Proxmox通过CLI向LXC挂载已有虚拟磁盘的方法
  • LXC上安装Gitlab时sysctl报错的解决方法
  • Proxmox VE通过全盘方式直通硬盘
  • Proxmox为KVM VNC启用剪贴板支持

文章聚合

  • Proxmox日志出现大量lxcfs truncated错误的解决方案
  • Proxmox通过CLI向LXC挂载已有虚拟磁盘的方法
  • Proxmox VE通过全盘方式直通硬盘
  • Proxmox为KVM VNC启用剪贴板支持
  • Proxmox报出RRDC/RRD update error的解决方法
  • 在Debian 12上安装Proxmox VE的方法

Multilangual Translator

Copyright © 2016-2025 X-osadminの自留地. All rights reserved. Designed by nicetheme.
  • 博客主页 HomePage
  • 技术小絮 Tech
  • 作品发布 Works
  • 软件专题 Softs
    • proxmox
    • openwrt
    • chromebook
    • Zerotier
    • 虚拟化
  • 友情链接 Following
Welcome
Forgot password?
Welcome
Forgot password?
Social Login
Login with WeChat QR Code
Unregistered WeChat IDs will be automatically used to create an account.
Scan and Reply with Keywords「登录」Get Verification Code
Social Login
Free registration
Social Login
Reset password
Back to Login