Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking failure for some pthread stuff #289

Closed
stevefan1999-personal opened this issue Aug 15, 2023 · 13 comments
Closed

Linking failure for some pthread stuff #289

stevefan1999-personal opened this issue Aug 15, 2023 · 13 comments

Comments

@stevefan1999-personal
Copy link

stevefan1999-personal commented Aug 15, 2023

Minimal reproduction case:

  1. Clone https://github.com/jasta/esp32-tokio-demo
  2. Add sync feature to tokio
  3. multiple definition of pthread stuff

I'm not sure why <PROJECT_DIR>/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a is linking with esp-idf/pthread/libpthread.a...Plus some pthread functions are implemented in ESP-IDF but they also showed up as not implemented and will always fail.

         STDERR OUTPUT:
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.14.rcgu.o): in function `std::sys::unix::thread::Thread::new':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:91: warning: pthread_attr_destroy is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread.c.obj): in function `pthread_attr_destroy':
          /home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:769: warning: pthread_attr_init is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.14.rcgu.o): in function `std::sys::unix::thread::Thread::new':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:62: warning: pthread_attr_setstacksize is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libesp_idf_svc-03063abf942faa1f.rlib(esp_idf_svc-03063abf942faa1f.esp_idf_svc.22e48e3b855e1320-cgu.12.rcgu.o): in function `esp_idf_svc::private::mutex::RawCondvar::notify_all':
          /home/steve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-svc-0.46.2/src/private/mutex.rs:107: warning: pthread_cond_broadcast is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libesp_idf_svc-03063abf942faa1f.rlib(esp_idf_svc-03063abf942faa1f.esp_idf_svc.22e48e3b855e1320-cgu.12.rcgu.o): in function `<esp_idf_svc::private::mutex::RawCondvar as core::ops::drop::Drop>::drop':
          /home/steve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-svc-0.46.2/src/private/mutex.rs:123: warning: pthread_cond_destroy is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj): in function `s_check_and_init_if_static':
          /home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:45: warning: pthread_cond_init is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libesp_idf_svc-03063abf942faa1f.rlib(esp_idf_svc-03063abf942faa1f.esp_idf_svc.22e48e3b855e1320-cgu.12.rcgu.o): in function `esp_idf_svc::private::mutex::RawCondvar::notify_one':
          /home/steve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-svc-0.46.2/src/private/mutex.rs:102: warning: pthread_cond_signal is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj): in function `pthread_cond_wait':
          /home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:94: warning: pthread_cond_timedwait is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtokio-8b2190f659d78dee.rlib(tokio-8b2190f659d78dee.tokio.766869848cda977c-cgu.06.rcgu.o): in function `std::sys::unix::locks::pthread_condvar::Condvar::wait':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_condvar.rs:117: warning: pthread_cond_wait is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.14.rcgu.o): in function `std::sys::unix::thread::Thread::new':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:87: warning: pthread_create is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.14.rcgu.o): in function `<std::sys::unix::thread::Thread as core::ops::drop::Drop>::drop':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:282: warning: pthread_detach is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtracing_core-d037a7f402bef1a5.rlib(tracing_core-d037a7f402bef1a5.tracing_core.7ed93c24001b13c2-cgu.4.rcgu.o): in function `std::sys::unix::thread_local_key::get':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread_local_key.rs:22: warning: pthread_getspecific is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.14.rcgu.o): in function `std::sys::unix::thread::Thread::join':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:263: warning: pthread_join is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.15.rcgu.o): in function `std::sys::unix::thread_local_key::create':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread_local_key.rs:10: warning: pthread_key_create is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.15.rcgu.o): in function `std::sys::unix::thread_local_key::destroy':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread_local_key.rs:27: warning: pthread_key_delete is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libesp_idf_svc-03063abf942faa1f.rlib(esp_idf_svc-03063abf942faa1f.esp_idf_svc.22e48e3b855e1320-cgu.12.rcgu.o): in function `<esp_idf_svc::private::mutex::RawMutex as core::ops::drop::Drop>::drop':
          /home/steve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-svc-0.46.2/src/private/mutex.rs:42: warning: pthread_mutex_destroy is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread.c.obj): in function `pthread_mutex_init_if_static':
          /home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:628: warning: pthread_mutex_init is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtokio_util-fa372dfde7de5ebf.rlib(tokio_util-fa372dfde7de5ebf.tokio_util.2c1be9baa30c8f0e-cgu.0.rcgu.o): in function `std::sys::unix::locks::pthread_mutex::Mutex::lock':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_mutex.rs:106: warning: pthread_mutex_lock is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtokio_util-fa372dfde7de5ebf.rlib(tokio_util-fa372dfde7de5ebf.tokio_util.2c1be9baa30c8f0e-cgu.0.rcgu.o): in function `std::sys::unix::locks::pthread_mutex::Mutex::try_lock':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_mutex.rs:118: warning: pthread_mutex_trylock is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/esp32c3_hw-a2d40ebb7011c1f9.4lr5qp4vob4cn4nq.rcgu.o: in function `std::sys::unix::locks::pthread_mutex::Mutex::unlock':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_mutex.rs:112: warning: pthread_mutex_unlock is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.02.rcgu.o): in function `<std::sys::unix::locks::pthread_mutex::PthreadMutexAttr as core::ops::drop::Drop>::drop':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_mutex.rs:127: warning: pthread_mutexattr_destroy is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.02.rcgu.o): in function `<std::sys::unix::locks::pthread_mutex::AllocatedMutex as std::sys_common::lazy_box::LazyInit>::init':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_mutex.rs:50: warning: pthread_mutexattr_init is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_mutex.rs:52: warning: pthread_mutexattr_settype is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libstd-10768515486ad699.rlib(std-10768515486ad699.std.cc51b25a40f24f06-cgu.15.rcgu.o): in function `<std::sys::unix::locks::pthread_rwlock::AllocatedRwLock as core::ops::drop::Drop>::drop':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_rwlock.rs:54: warning: pthread_rwlock_destroy is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtracing_core-d037a7f402bef1a5.rlib(tracing_core-d037a7f402bef1a5.tracing_core.7ed93c24001b13c2-cgu.5.rcgu.o): in function `std::sys::unix::locks::pthread_rwlock::RwLock::read':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_rwlock.rs:76: warning: pthread_rwlock_rdlock is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtokio-8b2190f659d78dee.rlib(tokio-8b2190f659d78dee.tokio.766869848cda977c-cgu.01.rcgu.o): in function `std::sys::unix::locks::pthread_rwlock::RwLock::try_read':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_rwlock.rs:114: warning: pthread_rwlock_tryrdlock is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtracing_core-d037a7f402bef1a5.rlib(tracing_core-d037a7f402bef1a5.tracing_core.7ed93c24001b13c2-cgu.1.rcgu.o): in function `std::sys::unix::locks::pthread_rwlock::AllocatedRwLock::raw_unlock':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_rwlock.rs:47: warning: pthread_rwlock_unlock is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtracing_core-d037a7f402bef1a5.rlib(tracing_core-d037a7f402bef1a5.tracing_core.7ed93c24001b13c2-cgu.5.rcgu.o): in function `std::sys::unix::locks::pthread_rwlock::RwLock::write':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_rwlock.rs:134: warning: pthread_rwlock_wrlock is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libc.a(lib_a-fclose.o): in function `_fclose_r':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/fclose.c:73: warning: pthread_setcancelstate is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/libtracing_core-d037a7f402bef1a5.rlib(tracing_core-d037a7f402bef1a5.tracing_core.7ed93c24001b13c2-cgu.4.rcgu.o): in function `std::sys::unix::thread_local_key::set':
          /home/steve/snap/rustup/common/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread_local_key.rs:16: warning: pthread_setspecific is not implemented and will always fail
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_attr_destroy':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:33: multiple definition of `pthread_attr_destroy'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:769: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_attr_getdetachstate':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:41: multiple definition of `pthread_attr_getdetachstate'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:792: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_attr_getstacksize':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:94: multiple definition of `pthread_attr_getstacksize'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:774: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_attr_init':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:102: multiple definition of `pthread_attr_init'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:756: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_attr_setdetachstate':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:113: multiple definition of `pthread_attr_setdetachstate'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:800: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_attr_setstacksize':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:166: multiple definition of `pthread_attr_setstacksize'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:782: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_cancel':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:177: multiple definition of `pthread_cancel'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:463: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_cond_broadcast':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:198: multiple definition of `pthread_cond_broadcast'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:74: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_cond_destroy':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:206: multiple definition of `pthread_cond_destroy'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:208: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_cond_init':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:214: multiple definition of `pthread_cond_init'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:188: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_cond_signal':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:222: multiple definition of `pthread_cond_signal'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:54: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_cond_timedwait':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:233: multiple definition of `pthread_cond_timedwait'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:98: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_cond_wait':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:238: multiple definition of `pthread_cond_wait'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:94: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_condattr_init':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:262: multiple definition of `pthread_condattr_init'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_cond_var.c:182: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_create':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:281: multiple definition of `pthread_create'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:206: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_detach':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:286: multiple definition of `pthread_detach'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:382: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_equal':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:297: multiple definition of `pthread_equal'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:489: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_exit':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:305: multiple definition of `pthread_exit'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:414: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_getspecific':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:329: multiple definition of `pthread_getspecific'; esp-idf/pthread/libpthread.a(pthread_local_storage.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_local_storage.c:182: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_join':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:337: multiple definition of `pthread_join'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:316: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_key_create':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:345: multiple definition of `pthread_key_create'; esp-idf/pthread/libpthread.a(pthread_local_storage.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_local_storage.c:56: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_key_delete':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:350: multiple definition of `pthread_key_delete'; esp-idf/pthread/libpthread.a(pthread_local_storage.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_local_storage.c:89: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutex_destroy':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:358: multiple definition of `pthread_mutex_destroy'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:566: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutex_init':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:374: multiple definition of `pthread_mutex_init'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:524: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutex_lock':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:382: multiple definition of `pthread_mutex_lock'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:637: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutex_trylock':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:398: multiple definition of `pthread_mutex_trylock'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:671: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutex_unlock':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:406: multiple definition of `pthread_mutex_unlock'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:685: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutexattr_destroy':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:414: multiple definition of `pthread_mutexattr_destroy'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:724: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutexattr_gettype':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:446: multiple definition of `pthread_mutexattr_gettype'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:733: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutexattr_init':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:454: multiple definition of `pthread_mutexattr_init'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:713: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_mutexattr_settype':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:486: multiple definition of `pthread_mutexattr_settype'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:741: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_once':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:494: multiple definition of `pthread_once'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:494: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_rwlock_destroy':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:502: multiple definition of `pthread_rwlock_destroy'; esp-idf/pthread/libpthread.a(pthread_rwlock.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_rwlock.c:108: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_rwlock_init':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:510: multiple definition of `pthread_rwlock_init'; esp-idf/pthread/libpthread.a(pthread_rwlock.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_rwlock.c:53: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_rwlock_rdlock':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:518: multiple definition of `pthread_rwlock_rdlock'; esp-idf/pthread/libpthread.a(pthread_rwlock.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_rwlock.c:162: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_rwlock_unlock':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:542: multiple definition of `pthread_rwlock_unlock'; esp-idf/pthread/libpthread.a(pthread_rwlock.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_rwlock.c:223: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_rwlock_wrlock':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:550: multiple definition of `pthread_rwlock_wrlock'; esp-idf/pthread/libpthread.a(pthread_rwlock.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_rwlock.c:195: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_self':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:593: multiple definition of `pthread_self'; esp-idf/pthread/libpthread.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread.c:475: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_setcancelstate':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:601: multiple definition of `pthread_setcancelstate'; esp-idf/newlib/libnewlib.a(pthread.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/newlib/pthread.c:20: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `pthread_setspecific':
          /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:630: multiple definition of `pthread_setspecific'; esp-idf/pthread/libpthread.a(pthread_local_storage.c.obj):/home/steve/rust/esp32c3-hw/.embuild/espressif/esp-idf/v5.1/components/pthread/pthread_local_storage.c:196: first defined here
          /home/steve/rust/esp32c3-hw/.embuild/espressif/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/12.2.0/../../../../riscv32-esp-elf/bin/ld: warning: /home/steve/rust/esp32c3-hw/target/riscv32imc-esp-espidf/debug/deps/esp32c3_hw-a2d40ebb7011c1f9 has a LOAD segment with RWX permissions
          collect2: error: ld returned 1 exit status

I'm not sure if mold and sccache mattered here...

@stevefan1999-personal
Copy link
Author

Hmm. I changed esp-idf-hal to the latest, set ESP_IDF_VERSION to master and it worked. Closing this as a false positive, but still a weird issue nonetheless.

@LinusU
Copy link

LinusU commented Dec 27, 2023

I'm running into the same issue as well, but I'm trying to use smol (or specifically, async-io & async-executor) and not Tokio.

Steps to reproduce:

  1. Generate a new project cargo generate esp-rs/esp-idf-template cargo
  2. Add async-io cargo add async-executor async-io
  3. Modify main.rs to add simple usage of async
    use std::time::Duration;
    
    use async_io::Timer;
    use async_executor::LocalExecutor;
    
    fn main() {
        // It is necessary to call this function once. Otherwise some patches to the runtime
        // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71
        esp_idf_svc::sys::link_patches();
    
        // Bind the log crate to the ESP Logging facilities
        esp_idf_svc::log::EspLogger::initialize_default();
    
        log::info!("Hello, World!");
    
        let executor = LocalExecutor::new();
    
        async_io::block_on(executor.run(async {
            loop {
                Timer::after(Duration::from_secs(5)).await;
                log::info!("Hello, loop!");
            }
        }))
    }
  4. Try to build cargo build --release
  5. Observer "multiple definition of" pthread stuff
(using `master` gives different error)

Changing to ESP_IDF_VERSION to master instead gives the following error:

error[E0425]: cannot find value `g_wifi_feature_caps` in this scope
   --> /Users/linus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-svc-0.47.3/src/wifi.rs:498:36
    |
498 |             feature_caps: unsafe { g_wifi_feature_caps },
    |                                    ^^^^^^^^^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `esp-idf-svc` (lib) due to previous error

@Vollbrecht
Copy link
Collaborator

please don't use esp-idf master branch as it is absolutely only for active development, its api is unstable and we don't make any efforts here in esp-idf-sys to have it reliable build against it.

@LinusU
Copy link

LinusU commented Dec 27, 2023

(ping @ivmarkov, would you be able to reopen this one please? 🙏)

@LinusU
Copy link

LinusU commented Dec 27, 2023

@Vollbrecht to clarify, the error and steps to reproduce happens on 5.1.1, I only included the part about master because it was suggested as a workaround

edit: I've updated my comment to hide the master stuff

@Vollbrecht
Copy link
Collaborator

the latest current stable release is v5.1.2 can you test against it?

@ivmarkov
Copy link
Collaborator

(ping @ivmarkov, would you be able to reopen this one please? 🙏)

I'm not reopening until it is confirmed that the issue is in esp-idf-sys. Your steps to reproduce are imprecise, in that:

  • you don't mention what versions of async-io and async-executor you are trying to use.
  • i'm unsure of your ESP IDF version
  • Unclear what MCU/chip

Rather than doing back-and-forth here, please publish a mini project that reproduces the error somewhere.

@ivmarkov
Copy link
Collaborator

ivmarkov commented Dec 27, 2023

BTW the CI of this does pass (MCU=esp32c3), and it does use what you are trying to use. ESP IDF 4.4 5.1.1

@LinusU
Copy link

LinusU commented Dec 27, 2023

Good points, I've uploaded a repo now: https://github.com/LinusU/esp32-pthread-issue

  • you don't mention what versions of async-io and async-executor you are trying to use.

cargo add adds the latest version, which currently is async-executor = "1.8.0" and async-io = "2.2.2"

  • i'm unsure of your ESP IDF version

I used the one from the esp-rs/esp-idf-template template, which is currently ESP_IDF_VERSION = "v5.1.1".

  • Unclear what MCU/chip

I'm building for the esp32c3.


I'm also building on macOS 14.2.1, using rustc 1.76.0-nightly (90e321d82 2023-12-02). Is there any more information/investigation I could provide?


edit: getting the same issue with ESP_IDF_VERSION = "v5.1.2"

@ivmarkov
Copy link
Collaborator

No, that's good enough. I'll try to build tmr.

@ivmarkov
Copy link
Collaborator

Remove "-C", "default-linker-libraries" from here.

It used to be necessary in the past (helped the linker find some intrinsics), with earlier ESP IDF SDKs, but with newer ESP IDF toolchains seems to be creating problems rather than solving ones.

Not really sure why that happens, but my guess would be that the newer cross toolchains of newer ESP IDFs contain a fake/alternative implementation of libpthread (perhaps coming from newlib itself?) which should not be there, and which collides with ESP-IDF's custom libpthread impl when the linker is told to link against the default libraries of the cross toolchain sysroot.

@ivmarkov
Copy link
Collaborator

@LinusU I've opened (and pinned) an issue here.

@LinusU
Copy link

LinusU commented Dec 28, 2023

Thank you 🙏 🙏 removing -C default-linker-libraries worked around the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants