在arch linux下尝试编译duo-buildroot-sdk失败,观察错误日志似乎是与atomic有关,但查找这个库发现是gcc自带的。估计是编译器的问题。有人有解决经验吗?错误日志如下
[riscv64-unknown-linux-musl-gcc] sample_venc.o
/-/duo-buildroot-sdk/host-tools/gcc/riscv64-linux-musl-x86_64/bin/…/lib/gcc/riscv64-unknown-linux-musl/10.2.0/…/…/…/…/riscv64-unknown-linux-musl/bin/ld: /-/duo-buildroot-sdk/middleware/v2/lib/libsys.a(cvi_vb.o): in function CVI_VB_Init': /root/.jenkins/workspace/v4.1.0_release_build/middleware/v2/modules/sys/src/cvi_vb.c:201: undefined reference to
__atomic_compare_exchange_1’
/-/duo-buildroot-sdk/host-tools/gcc/riscv64-linux-musl-x86_64/bin/…/lib/gcc/riscv64-unknown-linux-musl/10.2.0/…/…/…/…/riscv64-unknown-linux-musl/bin/ld: /-/duo-buildroot-sdk/middleware/v2/lib/libsys.a(cvi_vb.o): in function CVI_VB_Exit': /root/.jenkins/workspace/v4.1.0_release_build/middleware/v2/modules/sys/src/cvi_vb.c:225: undefined reference to
__atomic_compare_exchange_1’
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:78: sample_venc] Error 1
make[1]: Leaving directory ‘/-/duo-buildroot-sdk/middleware/v2/sample/venc’
make: *** [Makefile:9: all] Error 1
2 Likes
我在Gentoo也有类似的问题。先安装Ubuntu虚拟机绕过去了。
Hi @EOS,
Same problem here on Debian 12. So far I have been unable to discover where the linker should find __atomic_compare_exchange_1
. The reference to this symbol is in middleware/v2/lib/libsys.a
but I cannot find the source code to explore and/or fix.
$ nm middleware/v2/lib/libsys.a | grep -B1 -A4 atomic
cvi_vb.o:
U __atomic_compare_exchange_1
U base_dev_close
U CVI_SYS_Mmap
U CVI_SYS_MmapCache
U CVI_SYS_Munmap
Let me know if you have made progress. I can only proceed by removing the entire middleware/v2/sample/venc
and vdec
directories.
Thanks!