openthread / ot-br-posix

OpenThread Border Router, a Thread border router for POSIX-based platforms.
https://openthread.io/
BSD 3-Clause "New" or "Revised" License
420 stars 235 forks source link

Question on how to build openthread library to use its API on OTBR #660

Closed ihidchaos closed 1 year ago

ihidchaos commented 3 years ago

I have an ARM OpenWrt-based OTBR that uses RCP, and I want to operate the Thread network by writing a program that calls the corresponding API, such as setting panid, channel, and so on. After building ot-br-posix, I get the following libraries:

ihid@ubuntu:~/1907$ find ./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/openthread-otbrposix-0.0.1/ -name 'libopenthread*'
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/openthread-otbrposix-0.0.1/third_party/openthread/repo/src/posix/platform/libopenthread-posix.a
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/openthread-otbrposix-0.0.1/third_party/openthread/repo/src/cli/libopenthread-cli-ftd.a
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/openthread-otbrposix-0.0.1/third_party/openthread/repo/src/core/libopenthread-ftd.a
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/openthread-otbrposix-0.0.1/third_party/openthread/repo/src/lib/spinel/libopenthread-spinel-rcp.a
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/openthread-otbrposix-0.0.1/third_party/openthread/repo/src/lib/hdlc/libopenthread-hdlc.a
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/openthread-otbrposix-0.0.1/third_party/openthread/repo/src/lib/url/libopenthread-url.a
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/openthread-otbrposix-0.0.1/third_party/openthread/repo/src/lib/platform/libopenthread-platform.a

On the one hand, I put these libs in the cross-compile toolchain, and add the following configs to my CMakeLists.txt:

LINK_LIBRARIES(openthread-cli-ftd openthread-ftd openthread-hdlc openthread-platform openthread-posix openthread-spinel-rcp openthread-url)

And when I start build, I get the following errors:

====================[ Build | hoo | Debug ]=====================================
/usr/bin/cmake --build /home/ihid/tmp/hoo/cmake-build-debug --target hoo -- -j 9
[ 18%] Built target log
[ 27%] Linking C executable ../hoo
arm-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
arm-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(netif.cpp.o): in function `processReceive(otMessage*, void*)':
netif.cpp:(.text+0x1ec): undefined reference to `otMessageGetLength'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: netif.cpp:(.text+0x204): undefined reference to `otMessageFree'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: netif.cpp:(.text+0x254): undefined reference to `otMessageRead'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(netif.cpp.o): in function `processTransmit(otInstance*)':
netif.cpp:(.text+0x328): undefined reference to `otMessageAppend'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: netif.cpp:(.text+0x3a4): undefined reference to `otMessageFree'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(netif.cpp.o): in function `processAddressChange(otIp6AddressInfo const*, bool, void*)':
netif.cpp:(.text+0xcec): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(netif.cpp.o): in function `platformNetifInit':
netif.cpp:(.text+0xfe8): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: netif.cpp:(.text+0x103c): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: netif.cpp:(.text+0x1090): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: netif.cpp:(.text+0x10c0): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(netif.cpp.o):netif.cpp:(.text+0x1124): more undefined references to `otExitCodeToString' follow
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(netif.cpp.o): in function `platformNetifInit':
netif.cpp:(.text+0x134c): undefined reference to `otIcmp6SetEchoMode'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(netif.cpp.o): in function `platformNetifProcess':
netif.cpp:(.text+0x14ec): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: netif.cpp:(.text+0x1544): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: netif.cpp:(.text+0x1578): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(netif.cpp.o): in function `(anonymous namespace)::Ip6AddressString::Ip6AddressString(void const*) [clone .part.1]':
netif.cpp:(.text.unlikely+0x8): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(radio.cpp.o): in function `otPlatRadioSetPanId':
radio.cpp:(.text+0x378): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(radio.cpp.o):radio.cpp:(.text+0x440): more undefined references to `otExitCodeToString' follow
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(instance.cpp.o): in function `ot::Instance::Reset()':
instance.cpp:(.text+0xbc): undefined reference to `otPlatReset'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(instance.cpp.o): in function `ot::Instance::FactoryReset()':
instance.cpp:(.text+0x1a4): undefined reference to `otPlatReset'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(random_manager.cpp.o): in function `ot::RandomManager::~RandomManager()':
random_manager.cpp:(.text+0x28): undefined reference to `mbedtls_ctr_drbg_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: random_manager.cpp:(.text+0x30): undefined reference to `mbedtls_entropy_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(random_manager.cpp.o): in function `ot::RandomManager::Entropy::Init()':
random_manager.cpp:(.text+0x8c): undefined reference to `mbedtls_entropy_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(random_manager.cpp.o): in function `ot::RandomManager::Entropy::Deinit()':
random_manager.cpp:(.text+0x90): undefined reference to `mbedtls_entropy_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(random_manager.cpp.o): in function `ot::RandomManager::CryptoCtrDrbg::Init()':
random_manager.cpp:(.text+0x9c): undefined reference to `mbedtls_ctr_drbg_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: random_manager.cpp:(.text+0xb4): undefined reference to `mbedtls_ctr_drbg_seed'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: random_manager.cpp:(.text+0xc4): undefined reference to `mbedtls_entropy_func'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(random_manager.cpp.o): in function `ot::RandomManager::CryptoCtrDrbg::Deinit()':
random_manager.cpp:(.text+0xc8): undefined reference to `mbedtls_ctr_drbg_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(random_manager.cpp.o): in function `ot::RandomManager::CryptoCtrDrbg::FillBuffer(unsigned char*, unsigned short)':
random_manager.cpp:(.text+0xd0): undefined reference to `mbedtls_ctr_drbg_random'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(random_manager.cpp.o): in function `ot::RandomManager::RandomManager()':
random_manager.cpp:(.text+0xf8): undefined reference to `mbedtls_entropy_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::FreeMbedtls()':
dtls.cpp:(.text+0xf8): undefined reference to `mbedtls_ssl_cookie_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x100): undefined reference to `mbedtls_ssl_config_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x10c): undefined reference to `mbedtls_ssl_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::Disconnect()':
dtls.cpp:(.text+0x1fc): undefined reference to `mbedtls_ssl_close_notify'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::SetClientId(unsigned char const*, unsigned char)':
dtls.cpp:(.text+0x2c8): undefined reference to `mbedtls_ssl_set_client_transport_id'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::Send(ot::Message&, unsigned short)':
dtls.cpp:(.text+0x338): undefined reference to `mbedtls_ssl_write'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::Process()':
dtls.cpp:(.text+0x558): undefined reference to `mbedtls_ssl_handshake'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x5c0): undefined reference to `mbedtls_ssl_read'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x628): undefined reference to `mbedtls_ssl_session_reset'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x648): undefined reference to `mbedtls_ssl_set_hs_ecjpake_password'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x664): undefined reference to `mbedtls_ssl_close_notify'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x68c): undefined reference to `mbedtls_ssl_send_alert_message'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::Setup(bool)':
dtls.cpp:(.text+0x6dc): undefined reference to `mbedtls_ssl_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x6e4): undefined reference to `mbedtls_ssl_config_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x6ec): undefined reference to `mbedtls_ssl_cookie_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x700): undefined reference to `mbedtls_ssl_config_defaults'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x718): undefined reference to `mbedtls_ssl_conf_rng'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x728): undefined reference to `mbedtls_ssl_conf_min_version'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x738): undefined reference to `mbedtls_ssl_conf_max_version'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x744): undefined reference to `mbedtls_ssl_conf_ciphersuites'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x760): undefined reference to `mbedtls_ssl_conf_curves'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x770): undefined reference to `mbedtls_ssl_conf_export_keys_cb'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x780): undefined reference to `mbedtls_ssl_conf_handshake_timeout'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x790): undefined reference to `mbedtls_ssl_conf_dbg'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x7a8): undefined reference to `mbedtls_ssl_cookie_setup'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x7c4): undefined reference to `mbedtls_ssl_conf_dtls_cookies'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x7d0): undefined reference to `mbedtls_ssl_setup'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x7f0): undefined reference to `mbedtls_ssl_set_bio'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x804): undefined reference to `mbedtls_ssl_set_timer_cb'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x86c): undefined reference to `mbedtls_ssl_set_hs_ecjpake_password'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x8c4): undefined reference to `mbedtls_ctr_drbg_random'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x8d4): undefined reference to `mbedtls_ssl_cookie_check'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: dtls.cpp:(.text+0x8d8): undefined reference to `mbedtls_ssl_cookie_write'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(aes_ecb.cpp.o): in function `ot::Crypto::AesEcb::AesEcb()':
aes_ecb.cpp:(.text+0x8): undefined reference to `mbedtls_aes_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(aes_ecb.cpp.o): in function `ot::Crypto::AesEcb::SetKey(unsigned char const*, unsigned short)':
aes_ecb.cpp:(.text+0x14): undefined reference to `mbedtls_aes_setkey_enc'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(aes_ecb.cpp.o): in function `ot::Crypto::AesEcb::Encrypt(unsigned char const*, unsigned char*)':
aes_ecb.cpp:(.text+0x24): undefined reference to `mbedtls_aes_crypt_ecb'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(aes_ecb.cpp.o): in function `ot::Crypto::AesEcb::~AesEcb()':
aes_ecb.cpp:(.text+0x30): undefined reference to `mbedtls_aes_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(hmac_sha256.cpp.o): in function `ot::Crypto::HmacSha256::HmacSha256()':
hmac_sha256.cpp:(.text+0x8): undefined reference to `mbedtls_md_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hmac_sha256.cpp:(.text+0x10): undefined reference to `mbedtls_md_info_from_type'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hmac_sha256.cpp:(.text+0x20): undefined reference to `mbedtls_md_setup'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(hmac_sha256.cpp.o): in function `ot::Crypto::HmacSha256::~HmacSha256()':
hmac_sha256.cpp:(.text+0x34): undefined reference to `mbedtls_md_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(hmac_sha256.cpp.o): in function `ot::Crypto::HmacSha256::Start(unsigned char const*, unsigned short)':
hmac_sha256.cpp:(.text+0x40): undefined reference to `mbedtls_md_hmac_starts'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(hmac_sha256.cpp.o): in function `ot::Crypto::HmacSha256::Update(unsigned char const*, unsigned short)':
hmac_sha256.cpp:(.text+0x44): undefined reference to `mbedtls_md_hmac_update'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(hmac_sha256.cpp.o): in function `ot::Crypto::HmacSha256::Finish(unsigned char*)':
hmac_sha256.cpp:(.text+0x48): undefined reference to `mbedtls_md_hmac_finish'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(pbkdf2_cmac.cpp.o): in function `otPbkdf2Cmac':
pbkdf2_cmac.cpp:(.text+0xac): undefined reference to `mbedtls_aes_cmac_prf_128'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: pbkdf2_cmac.cpp:(.text+0xc4): undefined reference to `mbedtls_aes_cmac_prf_128'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: pbkdf2_cmac.cpp:(.text+0x110): undefined reference to `mbedtls_aes_cmac_prf_128'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: pbkdf2_cmac.cpp:(.text+0x128): undefined reference to `mbedtls_aes_cmac_prf_128'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(sha256.cpp.o): in function `ot::Crypto::Sha256::Sha256()':
sha256.cpp:(.text+0x8): undefined reference to `mbedtls_sha256_init'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(sha256.cpp.o): in function `ot::Crypto::Sha256::~Sha256()':
sha256.cpp:(.text+0x1c): undefined reference to `mbedtls_sha256_free'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(sha256.cpp.o): in function `ot::Crypto::Sha256::Start()':
sha256.cpp:(.text+0x2c): undefined reference to `mbedtls_sha256_starts_ret'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(sha256.cpp.o): in function `ot::Crypto::Sha256::Update(unsigned char const*, unsigned short)':
sha256.cpp:(.text+0x30): undefined reference to `mbedtls_sha256_update_ret'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-ftd.a(sha256.cpp.o): in function `ot::Crypto::Sha256::Finish(unsigned char*)':
sha256.cpp:(.text+0x34): undefined reference to `mbedtls_sha256_finish_ret'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(alarm.cpp.o): in function `otPlatTimeGet':
alarm.cpp:(.text+0x1c): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(alarm.cpp.o): in function `platformAlarmInit':
alarm.cpp:(.text+0xb0): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(settings.cpp.o): in function `swapPersist(otInstance*, int)':
settings.cpp:(.text+0xe4): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: settings.cpp:(.text+0x12c): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: settings.cpp:(.text+0x154): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(settings.cpp.o):settings.cpp:(.text+0x1ec): more undefined references to `otExitCodeToString' follow
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(udp.cpp.o): in function `otPlatUdpSend':
udp.cpp:(.text+0x3fc): undefined reference to `otMessageGetLength'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: udp.cpp:(.text+0x414): undefined reference to `otMessageRead'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: udp.cpp:(.text+0x5c0): undefined reference to `otMessageFree'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(udp.cpp.o): in function `platformUdpUpdateFdSet':
udp.cpp:(.text+0x854): undefined reference to `otUdpGetSockets'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(udp.cpp.o): in function `platformUdpInit':
udp.cpp:(.text+0x8b8): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: udp.cpp:(.text+0x908): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: udp.cpp:(.text+0x940): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(udp.cpp.o): in function `platformUdpProcess':
udp.cpp:(.text+0x9c4): undefined reference to `otUdpGetSockets'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: udp.cpp:(.text+0xb8c): undefined reference to `otUdpNewMessage'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: udp.cpp:(.text+0xba0): undefined reference to `otMessageAppend'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: udp.cpp:(.text+0xbb0): undefined reference to `otMessageFree'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: udp.cpp:(.text+0xbd0): undefined reference to `otMessageFree'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o): in function `ot::Posix::HdlcInterface::HdlcInterface(void (*)(void*), void*, ot::Hdlc::MultiFrameBuffer<(unsigned short)8192>&)':
hdlc_interface.cpp:(.text+0x30): undefined reference to `ot::Hdlc::Decoder::Decoder(ot::Hdlc::FrameWritePointer&, void (*)(void*, otError), void*)'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o): in function `ot::Posix::HdlcInterface::Read()':
hdlc_interface.cpp:(.text+0x100): undefined reference to `ot::Hdlc::Decoder::Decode(unsigned char const*, unsigned short)'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x13c): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o): in function `ot::Posix::HdlcInterface::Decode(unsigned char const*, unsigned short)':
hdlc_interface.cpp:(.text+0x194): undefined reference to `ot::Hdlc::Decoder::Decode(unsigned char const*, unsigned short)'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o): in function `ot::Posix::HdlcInterface::WaitForFrame(unsigned long long)':
hdlc_interface.cpp:(.text+0x2ac): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x2e4): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x330): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o): in function `ot::Posix::HdlcInterface::WaitForWritable()':
hdlc_interface.cpp:(.text+0x4bc): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x508): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o):hdlc_interface.cpp:(.text+0x61c): more undefined references to `otExitCodeToString' follow
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o): in function `ot::Posix::HdlcInterface::SendFrame(unsigned char const*, unsigned short)':
hdlc_interface.cpp:(.text+0x6c4): undefined reference to `ot::Hdlc::Encoder::Encoder(ot::Hdlc::FrameWritePointer&)'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x6cc): undefined reference to `ot::Hdlc::Encoder::BeginFrame()'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x6e4): undefined reference to `ot::Hdlc::Encoder::Encode(unsigned char const*, unsigned short)'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x6f4): undefined reference to `ot::Hdlc::Encoder::EndFrame()'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o): in function `ot::Posix::HdlcInterface::OpenFile(ot::Posix::RadioUrl const&)':
hdlc_interface.cpp:(.text+0x858): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x86c): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x920): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: hdlc_interface.cpp:(.text+0x9a8): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o): in function `ot::Posix::HdlcInterface::ForkPty(ot::Posix::RadioUrl const&)':
hdlc_interface.cpp:(.text+0xbd4): undefined reference to `otExitCodeToString'
/home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld: /home/ihid/1907/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.5.0/../../../../arm-openwrt-linux-muslgnueabi/lib/libopenthread-posix.a(hdlc_interface.cpp.o):hdlc_interface.cpp:(.text+0xc50): more undefined references to `otExitCodeToString' follow
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/hoo.dir/build.make:190: ../hoo] Error 1
make[2]: *** [CMakeFiles/Makefile2:78: CMakeFiles/hoo.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/hoo.dir/rule] Error 2
make: *** [Makefile:164: hoo] Error 2

I guess this is because I don't have incomplete lib such as libopenthread-api.a.

On the other hand, I also tried to build these libraries from openthread repo:

cd ~/openthread/
./bootstrap
./configure --host=arm-openwrt-linux

from the output it shows toolchain has been configured correctly.

configure:

  Configuration Summary
  ---------------------
  Package                                   : OPENTHREAD
  Version                                   : 20191113-01584-g22570e5a5
  Interface                                 : 0.0.5
  Build system                              : x86_64-unknown-linux-gnu
  Host system                               : arm-openwrt-linux-gnu
  Host architecture                         : arm
  Host OS                                   : linux-gnu
  Cross compiling                           : yes
  Build shared libraries                    : yes
  Build static libraries                    : yes
  Build debug libraries                     : no
  Build optimized libraries                 : yes
  Build coverage libraries                  : no
  Build coverage reports                    : no
  Address sanitizer support                 : no
  Lcov                                      : -
  Genhtml                                   : -
  Build tests                               : yes
  Build fuzz targets                        : no
  Build tools                               : yes
  OpenThread tests                          : 
  Prefix                                    : /usr/local
  Documentation support                     : no
  Doxygen                                   : -
  GraphViz dot                              : -
  C Preprocessor                            : arm-openwrt-linux-gcc -E
  C Compiler                                : arm-openwrt-linux-gcc
  C++ Preprocessor                          : arm-openwrt-linux-g++ -E
  C++ Compiler                              : arm-openwrt-linux-g++
  Assembler Compiler                        : arm-openwrt-linux-gcc
  Archiver                                  : arm-openwrt-linux-ar
  Archive Indexer                           : arm-openwrt-linux-ranlib
  Symbol Stripper                           : arm-openwrt-linux-strip
  Object Copier                             : arm-openwrt-linux-objcopy
  C Preprocessor flags                      :  -DOPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=1 -DOPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE=0 -DOPENTHREAD_ENABLE_VENDOR_EXTENSION=0 -DOPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER=0 -DOPENTHREAD_EXAMPLES_SIMULATION=0 -DOPENTHREAD_PLATFORM_POSIX=0 -I${abs_top_srcdir}/third_party/mbedtls -I${abs_top_srcdir}/third_party/mbedtls/repo/include -DMBEDTLS_CONFIG_FILE=\"mbedtls-config.h\" 
  C Compile flags                           : -g -O2 -Wall -Wextra -Wshadow -Wundef -Wcast-align -Werror -Wno-error=undef -std=c99 -pedantic-errors
  C++ Compile flags                         : -g -O2 -Wall -Wextra -Wshadow -Wundef -Wcast-align -Werror -Wno-error=undef -std=c++11 -Wno-c++14-compat -fno-exceptions -pedantic-errors -fno-rtti
  Assembler flags                           : -g -O2
  Link flags                                :  
  Link libraries                            :  
  Link maps                                 : no
  OpenThread FTD support                    : no
  OpenThread MTD support                    : no
  OpenThread Radio Only support             : no
  OpenThread CLI support                    : no
  OpenThread NCP support                    : no
  OpenThread NCP Vendor Hook Source         : no
  OpenThread NCP Spinel Encrypter           : no
  OpenThread Vendor Extension Source        : no
  OpenThread builtin mbedtls support        : yes
  OpenThread Examples                       : no
  OpenThread Platform Libraries             : no

However when I try make -f src/posix/Makefile-posix , it failed:

ihid@ubuntu:~/openthread$ make -f src/posix/Makefile-posix 
  MKDIR    output
  MKDIR    build/posix
  CONFIG   posix...
(cd build/posix && /home/ihid/openthread/src/posix/../../configure INSTALL="/usr/bin/install -p" CPPFLAGS="-g -DOPENTHREAD_CONFIG_UART_CLI_RAW=1  -O2  -DOPENTHREAD_POSIX_CONFIG_MAX_POWER_TABLE_ENABLE=1 -DOPENTHREAD_POSIX_CONFIG_RCP_BUS=OT_POSIX_RCP_BUS_UART -DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 -DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 -DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 -DOPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE -DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 -DOPENTHREAD_CONFIG_DIAG_ENABLE=1 -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1 -DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1 -DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 -DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 -DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 -DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_THREAD_VERSION=2 -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1 -DOPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT=0 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-posix-config.h\"' -I/home/ihid/openthread/src/posix/../../src/posix/platform  " CFLAGS=" -g -DOPENTHREAD_CONFIG_UART_CLI_RAW=1  -O2  -DOPENTHREAD_POSIX_CONFIG_MAX_POWER_TABLE_ENABLE=1 -DOPENTHREAD_POSIX_CONFIG_RCP_BUS=OT_POSIX_RCP_BUS_UART -DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 -DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 -DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 -DOPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE -DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 -DOPENTHREAD_CONFIG_DIAG_ENABLE=1 -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1 -DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1 -DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 -DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 -DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 -DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_THREAD_VERSION=2 -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1 -DOPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT=0 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-posix-config.h\"' -I/home/ihid/openthread/src/posix/../../src/posix/platform  " CXXFLAGS=" -g -DOPENTHREAD_CONFIG_UART_CLI_RAW=1  -O2  -DOPENTHREAD_POSIX_CONFIG_MAX_POWER_TABLE_ENABLE=1 -DOPENTHREAD_POSIX_CONFIG_RCP_BUS=OT_POSIX_RCP_BUS_UART -DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 -DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 -DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 -DOPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE -DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 -DOPENTHREAD_CONFIG_DIAG_ENABLE=1 -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1 -DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1 -DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 -DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 -DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 -DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_THREAD_VERSION=2 -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1 -DOPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT=0 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-posix-config.h\"' -I/home/ihid/openthread/src/posix/../../src/posix/platform  " LDFLAGS="-g -DOPENTHREAD_CONFIG_UART_CLI_RAW=1  -O2  -DOPENTHREAD_POSIX_CONFIG_MAX_POWER_TABLE_ENABLE=1 -DOPENTHREAD_POSIX_CONFIG_RCP_BUS=OT_POSIX_RCP_BUS_UART -DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 -DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 -DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 -DOPENTHREAD_CONFIG_CLI_TRANSPORT=OT_CLI_TRANSPORT_CONSOLE -DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 -DOPENTHREAD_CONFIG_DIAG_ENABLE=1 -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1 -DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1 -DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 -DOPENTHREAD_CONFIG_LEGACY_ENABLE=1 -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 -DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 -DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_THREAD_VERSION=2 -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1 -DOPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT=0 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-posix-config.h\"' -I/home/ihid/openthread/src/posix/../../src/posix/platform  " --prefix=/ --exec-prefix=/posix --enable-cli --enable-ftd --enable-ncp --with-platform=posix  --with-readline=readline)
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking filtered build system type... x86_64-unknown-linux-gnu
checking filtered host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -p
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
configure: error: source directory already configured; run "make distclean" there first
make: *** [src/posix/Makefile-posix:319: build/posix/config.status] Error 1

Could you please guide me on how to get these libraries right?

Thanks in advance.

Best,

Yuchao

ihidchaos commented 3 years ago

I also tyied with option "BUILD_SHARED_LIBS=ON" from link when building ot-br-posix, but useless.

leonardmgh commented 3 years ago

Did you ever solve your problem?

ihidchaos commented 3 years ago

Did you ever solve your problem?

I haven't solved it yet. Could you @jwhui please give us some guidance and help?

lancersky commented 3 years ago

I recommend you to use Unix socket for communicate with otbr-agent. Here is an example code,

#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>

int main(int argc, char* argv[])
{
    int ret;
    int sock;
    struct sockaddr_un server;
    char buffer[512];

    if (argc < 2) {
        exit(1);
    }

    sock = socket(AF_UNIX, SOCK_STREAM, 0);
    if (sock < 0) {
        perror("opening stream socket");
        exit(1);
    }
    server.sun_family = AF_UNIX;
    strcpy(server.sun_path, argv[1]);

    if (connect(sock, (struct sockaddr*)&server, sizeof(struct sockaddr_un)) < 0) {
        close(sock);
        perror("connecting stream socket");
        exit(1);
    }

    if (write(sock, "version", sizeof("version")) < 0)
        perror("writing on stream socket");
    if (read(sock, buffer, sizeof(buffer)) == -1) {
        perror("read");
        exit(1);
    }
    buffer[sizeof(buffer) - 1] = 0;
    printf("Result = %s\n", buffer);

    if (write(sock, "rcp version", sizeof("rcp version")) < 0)
        perror("writing on stream socket");
    if (read(sock, buffer, sizeof(buffer)) == -1) {
        perror("read");
        exit(1);
    }
    buffer[sizeof(buffer) - 1] = 0;
    printf("Result = %s\n", buffer);

    close(sock);

    return 0;
}

And the output as follow,

root@OpenWrt:/tmp# ./demo run/openthread-wpan0.sock
Result = OPENTHREAD/thread-reference-20200818-1205-g69bfc4b1c; POSIX; Feb 15 2021 15:22:37
Done
> 
Result = OPENTHREAD/thread-reference-20200818-1205-g69bfc4b1c; NRF52840; Sep  6 2021 14:39:16
Done
> 
jwhui commented 1 year ago

Closing stale issue.