Compilation error version 22.03.2

Hello,

I am compiling a new firmware for Mediatek MT7621 platform and run into the error "undefined reference to `pthread_once'". Have any one experienced the same issue? I did "make dist clean" then recompile but it does not help.

HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
LEX scripts/dtc/dtc-lexer.lex.c
YACC scripts/dtc/dtc-parser.tab.[ch]
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
HOSTCC scripts/kallsyms
HOSTCC scripts/sorttable
HOSTCC scripts/asn1_compiler
HOSTCC scripts/extract-cert
/usr/bin/ld: /buildserver/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-eng_all.o): in function ENGINE_load_builtin_engines': eng_all.c:(.text+0x34): undefined reference to pthread_once'
/usr/bin/ld: /buildserver/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-err.o): in function ERR_load_ERR_strings': err.c:(.text+0xad2): undefined reference to pthread_once'
/usr/bin/ld: /buildserver/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-err_all.o): in function ERR_load_crypto_strings': err_all.c:(.text+0xb3): undefined reference to pthread_once'
/usr/bin/ld: /buildserver/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): in function OpenSSL_add_all_ciphers': c_all.c:(.text+0x9e3): undefined reference to pthread_once'
/usr/bin/ld: /buildserver/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): in function OpenSSL_add_all_digests': c_all.c:(.text+0xa03): undefined reference to pthread_once'
/usr/bin/ld: /buildserver/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-crypto_init.o):crypto_init.c:(.text+0x55): more undefined references to `pthread_once' follow
collect2: error: ld returned 1 exit status
make[6]: *** [scripts/Makefile.host:95: scripts/extract-cert] Error 1
make[5]: *** [Makefile:1209: scripts] Error 2
make[5]: Leaving directory '/buildserver/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-5.10.146'
make[4]: *** [Makefile:23: /buildserver/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-5.10.146/.modules] Error 2
make[4]: Leaving directory '/buildserver/openwrt/target/linux/ramips'
make[3]: *** [Makefile:11: compile] Error 2
make[3]: Leaving directory '/buildserver/openwrt/target/linux'
time: target/linux/compile#54.57#14.54#191.97
ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:30: target/linux/compile] Error 1
make[2]: Leaving directory '/buildserver/openwrt'
make[1]: *** [target/Makefile:23: /buildserver/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.target_compile] Error 2
make[1]: Leaving directory '/buildserver/openwrt'
make: *** [/buildserver/openwrt/include/toplevel.mk:230: world] Error 2

Did you try researching the error you're getting? That turns up this, for example:

Hi Borromini,

I did try all the solutions and suggestions that I found including the one you mentioned but it does not work. It seems my issue is with a different library linkage.

Currently I am reviewing closely my config file. If I find a solution, I'll post update in here.

1 Like