[solved] Build error: undefined reference to `pthread_once'

I get the following error when compiling OpenWRT 18.06.2 on Debian Stretch for an x86_64 target. Does anyone have an idea on how to solve this error? I have followed the build instructions on https://openwrt.org/docs/guide-developer/build-system/install-buildsystem. make dirclean also did not help to solve the error.

/opt/openwrt/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'
/opt/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-err.o): In function `ERR_load_ERR_strings':
err.c:(.text+0xb5b): undefined reference to `pthread_once'
/opt/openwrt/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'
/opt/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): In function `OpenSSL_add_all_ciphers':
c_all.c:(.text+0x90f): undefined reference to `pthread_once'
/opt/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): In function `OpenSSL_add_all_digests':
c_all.c:(.text+0x92f): undefined reference to `pthread_once'
/opt/openwrt/staging_dir/host/lib/libcrypto.a(libcrypto_la-crypto_init.o):crypto_init.c:(.text+0x59): more undefined references to `pthread_once' follow
collect2: error: ld returned 1 exit status
scripts/Makefile.host:102: recipe for target 'scripts/extract-cert' failed
make[6]: *** [scripts/extract-cert] Error 1
Makefile:577: recipe for target 'scripts' failed
make[5]: *** [scripts] Error 2
make[5]: Leaving directory '/opt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.14.95'
Makefile:24: recipe for target '/opt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.14.95/.modules' failed
make[4]: *** [/opt/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.14.95/.modules] Error 2
make[4]: Leaving directory '/opt/openwrt/target/linux/x86'
Makefile:13: recipe for target 'compile' failed
make[3]: *** [compile] Error 2
make[3]: Leaving directory '/opt/openwrt/target/linux'
time: target/linux/compile#5.16#4.09#8.37
target/Makefile:23: recipe for target 'target/linux/compile' failed
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory '/opt/openwrt'
target/Makefile:18: recipe for target '/opt/openwrt/staging_dir/target-x86_64_musl/stamp/.target_compile' failed
make[1]: *** [/opt/openwrt/staging_dir/target-x86_64_musl/stamp/.target_compile] Error 2
make[1]: Leaving directory '/opt/openwrt'
/opt/openwrt/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 2

Hi! Perhaps you make under the root?

  1. make distclean (will remove .config)

  2. make -j1 V=s &> log.txt run and add file log to topic

OK, will do and report back. Although I am sorry to see my .config go...! :smile:

Make distclean did not help. The error message was exactly the same. However, I upgraded to the new 18.06.3 and that solved the problem! Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.