esp32程序链接pthread报错, multiple definition of `pthread_*'

bigcat26
Posts: 3
Joined: Tue Nov 08, 2022 2:50 am

esp32程序链接pthread报错, multiple definition of `pthread_*'

Postby bigcat26 » Thu Apr 18, 2024 2:29 am

截取了一部分日志

```
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread_rwlock.c.obj): in function `pthread_rwlock_unlock':
/mnt/work/esp-idf/components/pthread/pthread_rwlock.c:301:(.text.pthread_rwlock_unlock+0x8a): warning: pthread_cond_broadcast is not implemented and will always fail
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread_rwlock.c.obj): in function `pthread_rwlock_destroy':
/mnt/work/esp-idf/components/pthread/pthread_rwlock.c:130:(.text.pthread_rwlock_destroy+0x30): warning: pthread_cond_destroy is not implemented and will always fail
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.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':
/mnt/work/esp-idf/components/pthread/pthread_cond_var.c:45:(.text.s_check_and_init_if_static+0x40): warning: pthread_cond_init is not implemented and will always fail
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj): in function `pthread_cond_wait':
/mnt/work/esp-idf/components/pthread/pthread_cond_var.c:94:(.text.pthread_cond_wait+0x6): warning: pthread_cond_timedwait is not implemented and will always fail
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread_rwlock.c.obj): in function `pthread_rwlock_rdlock':
/mnt/work/esp-idf/components/pthread/pthread_rwlock.c:181:(.text.pthread_rwlock_rdlock+0x5a): warning: pthread_cond_wait is not implemented and will always fail
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/pthread/libpthread.a(pthread.c.obj): in function `esp_pthread_set_cfg':
/mnt/work/esp-idf/components/pthread/pthread.c:135:(.text.esp_pthread_set_cfg+0x1a): warning: pthread_getspecific is not implemented and will always fail


/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `__pthread_failed':
/builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:16: multiple definition of `pthread_cond_init'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/mnt/work/esp-idf/components/pthread/pthread_cond_var.c:218: first defined here
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `__pthread_failed':
/builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:16: multiple definition of `pthread_condattr_setpshared'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/mnt/work/esp-idf/components/pthread/pthread_cond_var.c:200: first defined here
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `__pthread_failed':
/builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:16: multiple definition of `pthread_condattr_getpshared'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/mnt/work/esp-idf/components/pthread/pthread_cond_var.c:194: first defined here
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `__pthread_failed':
/builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:16: multiple definition of `pthread_condattr_setclock'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/mnt/work/esp-idf/components/pthread/pthread_cond_var.c:212: first defined here
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `__pthread_failed':
/builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:16: multiple definition of `pthread_condattr_getclock'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/mnt/work/esp-idf/components/pthread/pthread_cond_var.c:206: first defined here
/root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /root/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/lib/rv32imc_zicsr_zifencei/ilp32/no-rtti/libnosys.a(pthread.o): in function `__pthread_failed':
/builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/libgloss/libnosys/pthread.c:16: multiple definition of `pthread_condattr_destroy'; esp-idf/pthread/libpthread.a(pthread_cond_var.c.obj):/mnt/work/esp-idf/components/pthread/pthread_cond_var.c:188: first defined here

```

Who is online

Users browsing this forum: No registered users and 155 guests