Reputation: 11
I am cross-compiling the SPEC CPU2006 benchmarks using the LLVM 19.1.0 compiler on an Intel machine. The C/C++ examples can be successfully built into executable files using runspec and run successfully on the** RISC-V** platform. However, for Fortran examples like 410.bwaves, building with flang-new fails, and the error is:
ld.lld: error: bwaves.lto.o: cannot link object files with different floating-point ABI from ~/gnu-riscv64-20241106/sysroot/usr/lib/crt1.o.
PS. config info **FOPTIMIZE **= -march=rv64gcv_zba_zbb_zbc_zbs -O3 -static -flto -ffast-math **EXTRA_LDFLAGS **= -fuse-ld==ld.lld -L${gnu-riscv64}/lib/
Through debugging, I found that the ABI of bwaves.lto.o is rv64i2p1, while the ABI of the library file crt1.o is rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zmmul1p0. Clearly, bwaves.lto.o is generated incorrectly. Could you please advise me on how to resolve this issue? Thank you very much!
I tried to write a script to build the 410.bwaves example by first compiling each Fortran file into .bc files, and then linking those .bc files into an object file using flang-new. The ABI of this object file is correct, and flang-new can generate the executable file. However, to ensure accuracy, I need to execute the SPEC tests via the command line. Therefore, I would like to ask everyone where I might have gone wrong. Thank you very much!
Upvotes: 1
Views: 86