Open PPParticle opened 2 years ago
plct的rvv-iscas分支很久没有开发,可以尝试使用upstream编译rvv intrinsic程序,upstream仓库: https://github.com/llvm/llvm-project
plct的rvv-iscas分支很久没有开发,可以尝试使用upstream编译rvv intrinsic程序,upstream仓库: https://github.com/llvm/llvm-project
好的,谢谢回复
安装好llvm upstream仓库以后,重新编译过以前成功的代码,出现版本错误 clang-14: error: invalid arch name 'rv64gcv1p0', unsupported version number 1.0 for experimental extension 'v'(this compiler supports 0.10) 安装流程
$ git clone https://github.com/llvm/llvm-project.git
$ cd llvm-project
$ mkdir build
$ cd build
$ cmake -DLLVM_TARGETS_TO_BUILD="RISCV" -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_USE_LINKER=gold -G Ninja ../llvm
$ ninja
$ sudo cmake --build . --target install
是的,upstream的rvv版本是0.10版本,使用rv64gcv0p10编译。对comment1中测试程序应该可以正常编译
是的,upstream的rvv版本是0.10版本,使用rv64gcv0p10编译。对comment1中测试程序应该可以正常编译
你好,我尝试了upstream,但是还是不行
$ clang --target=riscv64-unknown-elf -march=rv64gcv0p10 -menable-experimental-extensions --sysroot=/home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf --gcc-toolchain=/home/qiao_sh_pudong/RISCV/Bin/riscv64 dataop.c
/home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: error: /tmp/dataop-6bd7ba.o: Mis-matched ISA version for 'v' extension. 0.10 vs 1.0 /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /tmp/dataop-6bd7ba.o /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-exit.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-impure.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-init.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-memset.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-printf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-vfprintf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-wsetup.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-call_atexit.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-atexit.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-fflush.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-findfp.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-fini.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-freer.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-fwalk.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-ldtoa.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-localeconv.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-makebuf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-mallocr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-memchr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-mlock.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-mprec.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-s_frexp.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-sbrkr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-sprintf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-stdio.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-strcpy.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-strlen.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-strncpy.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-svfprintf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-vfiprintf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-writer.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-atexit.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-assert.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-callocr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-closer.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-errno.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-fclose.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-fiprintf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-fputwc.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-fstatr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-fvwrite.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-isattyr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-locale.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-lseekr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-mbtowc_r.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-memcpy.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-memmove-stub.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-readr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-reallocr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-reent.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-strcmp.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-svfiprintf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-wbuf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-wcrtomb.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-wctomb_r.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-abort.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(liba-ctype.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-signal.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libc.a(lib_a-signalr.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_close.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_exit.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_fstat.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_getpid.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_isatty.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_kill.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_lseek.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_read.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_sbrk.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_write.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf/lib/libgloss.a(sys_conv_stat.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(eqtf2.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(getf2.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(letf2.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(multf3.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(subtf3.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(fixtfsi.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(floatsitf.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(extenddftf2.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(trunctfdf2.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(_clzsi2.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/libgcc.a(_clz.o) /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file /home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/crtend.o clang-14: error: ld command failed with exit code 1 (use -v to see invocation)
/home/qiao_sh_pudong/RISCV/Bin/riscv64/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../bin/riscv64-unknown-elf-ld: error: /tmp/dataop-6bd7ba.o: Mis-matched ISA version for 'v' extension. 0.10 vs 1.0
看起来你应该把参数改为 rv64gcv1p0
- clang --target=riscv64-unknown-elf -march=rv64gcv0p10 ...
+ clang --target=riscv64-unknown-elf -march=rv64gcv1p0 ...
参数可以是riscv32-unknown-elf吗
编译命令
$ /home/qiao_sh_pudong/RISCV/Src/llvm-project/build/bin/clang --target=riscv64-unknown-elf -march=rv64gcv1p0 -menable-experimental-extensions --sysroot=/home/qiao_sh_pudong/RISCV/Bin/riscv64/riscv64-unknown-elf --gcc-toolchain=/home/qiao_sh_pudong/RISCV/Bin/riscv64 test.c
报错: clang-12: /home/qiao_sh_pudong/RISCV/Src/llvm-project/llvm/lib/IR/Instructions.cpp:2873: static llvm::CastInst llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value, llvm::Type, const llvm::Twine&, llvm::Instruction): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed. PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump:
0 0x000055a10768197b llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/qiao_sh_pudong/RISCV/Src/llvm-project/llvm/lib/Support/Unix/Signals.inc:563:22
1 0x000055a107681a12 PrintStackTraceSignalHandler(void*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/llvm/lib/Support/Unix/Signals.inc:624:1
2 0x000055a10767f7a3 llvm::sys::RunSignalHandlers() /home/qiao_sh_pudong/RISCV/Src/llvm-project/llvm/lib/Support/Signals.cpp:68:20
3 0x000055a1076812cb SignalHandler(int) /home/qiao_sh_pudong/RISCV/Src/llvm-project/llvm/lib/Support/Unix/Signals.inc:405:1
4 0x00007f4a679563c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
5 0x00007f4a673f518b raise /build/glibc-eX1tMB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
6 0x00007f4a673d4859 abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:81:7
7 0x00007f4a673d4729 get_sysdep_segment_value /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:509:8
8 0x00007f4a673d4729 _nl_load_domain /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:970:34
9 0x00007f4a673e5f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
10 0x000055a106cf8924 llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value, llvm::Type, llvm::Twine const&, llvm::Instruction*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/llvm/lib/IR/Instructions.cpp:2873:3
11 0x000055a10610b9a6 llvm::IRBuilderBase::CreateCast(llvm::Instruction::CastOps, llvm::Value, llvm::Type, llvm::Twine const&) /home/qiao_sh_pudong/RISCV/Src/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2088:18
12 0x000055a1065be7ba llvm::IRBuilderBase::CreateBitCast(llvm::Value, llvm::Type, llvm::Twine const&) /home/qiao_sh_pudong/RISCV/Src/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2048:3
13 0x000055a107fbfde3 (anonymous namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:2109:33
14 0x000055a107fd2bdb clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value>::VisitImplicitCastExpr(clang::ImplicitCastExpr) /home/qiao_sh_pudong/RISCV/Src/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:919:1
15 0x000055a107fd1249 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value>::Visit(clang::Stmt) /home/qiao_sh_pudong/RISCV/Src/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:919:1
16 0x000055a107fb704b (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:412:57
17 0x000055a107fce561 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:4729:1
18 0x000055a107e8fe39 clang::CodeGen::CodeGenFunction::EmitRISCVBuiltinExpr(unsigned int, clang::CallExpr const*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:14906:33
19 0x000055a107dd2056 EmitTargetArchBuiltinExpr(clang::CodeGen::CodeGenFunction, unsigned int, clang::CallExpr const, clang::CodeGen::ReturnValueSlot, llvm::Triple::ArchType) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:4535:50
20 0x000055a107dd21f6 clang::CodeGen::CodeGenFunction::EmitTargetBuiltinExpr(unsigned int, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:4564:35
21 0x000055a107dd1e2d clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::GlobalDecl, unsigned int, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp:4490:39
22 0x000055a107f7febb clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExpr.cpp:4769:42
23 0x000055a107fb7fcb (anonymous namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:581:34
24 0x000055a107fd10f9 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value>::Visit(clang::Stmt) /home/qiao_sh_pudong/RISCV/Src/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:813:1
25 0x000055a107fb704b (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:412:57
26 0x000055a107fce561 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp:4729:1
27 0x000055a107f64903 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExpr.cpp:216:55
28 0x000055a107f64860 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGExpr.cpp:201:63
29 0x000055a107ae055a clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const, llvm::ArrayRef<clang::Attr const>) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGStmt.cpp:118:56
30 0x000055a107ae167c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGStmt.cpp:418:3
31 0x000055a107ae1358 clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGStmt.cpp:404:58
32 0x000055a107ae112f clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGStmt.cpp:377:72
33 0x000055a107ae03a3 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const, llvm::ArrayRef<clang::Attr const>) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGStmt.cpp:53:3
34 0x000055a107ae3b60 clang::CodeGen::CodeGenFunction::EmitForStmt(clang::ForStmt const&, llvm::ArrayRef<clang::Attr const*>) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGStmt.cpp:955:37
35 0x000055a107ae06a9 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const, llvm::ArrayRef<clang::Attr const>) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGStmt.cpp:146:75
36 0x000055a107ae167c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CGStmt.cpp:418:3
37 0x000055a107b852c1 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:1147:36
38 0x000055a107b85f5f clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:1312:21
39 0x000055a107bb08ad clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:4547:3
40 0x000055a107ba93ce clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2907:47
41 0x000055a107ba837c clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2660:5
42 0x000055a107bb4a87 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.localalias) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:5361:37
43 0x000055a108c9b619 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:169:7
44 0x000055a108c94a50 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:216:7
45 0x000055a10a88be18 clang::ParseAST(clang::Sema&, bool, bool) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/Parse/ParseAST.cpp:162:20
46 0x000055a108306bed clang::ASTFrontendAction::ExecuteAction() /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1057:11
47 0x000055a108c9277f clang::CodeGenAction::ExecuteAction() /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1183:1
48 0x000055a108306544 clang::FrontendAction::Execute() /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:954:38
49 0x000055a108297d9d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:984:42
50 0x000055a10849d16b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:38
51 0x000055a1060ab626 cc1_main(llvm::ArrayRef<char const>, char const, void*) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/tools/driver/cc1_main.cpp:240:40
52 0x000055a1060a04c3 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/tools/driver/driver.cpp:330:20
53 0x000055a1060a0c89 main /home/qiao_sh_pudong/RISCV/Src/llvm-project/clang/tools/driver/driver.cpp:407:26
54 0x00007f4a673d60b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
55 0x000055a10609eb5e _start (/home/qiao_sh_pudong/RISCV/Src/llvm-project/build/bin/clang-12+0x25c0b5e)
clang-12: error: unable to execute command: Aborted clang-12: error: clang frontend command failed due to signal (use -v to see invocation) clang version 12.0.0 (https://github.com/plctlab/llvm-project.git 37982e5a87bd8cb5fc75dfc9772616dc55602b24) Target: riscv64-unknown-unknown-elf Thread model: posix InstalledDir: /home/qiao_sh_pudong/RISCV/Src/llvm-project/build/bin clang-12: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-12: note: diagnostic msg: /tmp/test-ee3278.c clang-12: note: diagnostic msg: /tmp/test-ee3278.sh clang-12: note: diagnostic msg:
代码: