[ 20s] + ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/12 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --disable-plugin --with-bugurl=https://bugs.opensuse.org/ '--with-pkgversion=SUSE Linux' --with-slibdir=/usr/riscv64-suse-linux/sys-root/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-12 --program-prefix=riscv64-elf- --target=riscv64-elf --disable-nls --with-sysroot=/usr/riscv64-suse-linux/sys-root --with-build-sysroot=/usr/riscv64-suse-linux/sys-root --with-build-time-tools=/usr/riscv64-suse-linux/bin --with-newlib --disable-gcov --disable-multilib --disable-libsanitizer --build=x86_64-suse-linux --host=x86_64-suse-linux fails due to: [ 204s] checking for suffix of object files... configure: error: in `/home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191254/obj-x86_64-suse-linux/riscv64-elf/libgcc': [ 204s] configure: error: cannot compute suffix of object files: cannot compile [ 204s] See `config.log' for more details Assembler messages: Error: cannot find default versions of the ISA extension `zicsr' configure:3808: $? = 1 configure: failed program was: for: as --version GNU assembler (GNU Binutils; openSUSE Tumbleweed) 2.37.20211112-5 Likely started with g:ca2bbb88f999f4d3cc40e89bc1aba712505dd598.
My bet is just the documentation needs ro be updated for a newer binutils version. Riscv is still too new really.
That's definitely cause by the ISA spec bumping, I tested with binutils trunk but didn't test with 2.37. Let me fix that to make sure GCC work with older binutils release.
Patch posted to mailing list: https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589225.html
The master branch has been updated by Kito Cheng <kito@gcc.gnu.org>: https://gcc.gnu.org/g:06e32a5ebf20c11dd31bc2677bede569fef84316 commit r12-7070-g06e32a5ebf20c11dd31bc2677bede569fef84316 Author: Kito Cheng <kito.cheng@sifive.com> Date: Tue Jan 25 20:44:04 2022 +0800 RISC-V: Always pass -misa-spec to assembler [PR104219] Add -misa-spec to OPTION_DEFAULT_SPECS to make sure -misa-spec will always pass that into assembler, that prevent GCC and binutils using different way to interpret the ISA string. gcc/ChangeLog: PR target/104219 * config.gcc (riscv*-*-*): Normalize the with_isa_spec value. (all_defaults): Add isa_spec. * config/riscv/riscv.h (OPTION_DEFAULT_SPECS): Add isa_spec.
I plan back port this fix to GCC 11 branch too, and will close this bug after back port.
The releases/gcc-11 branch has been updated by Kito Cheng <kito@gcc.gnu.org>: https://gcc.gnu.org/g:9871d39f752bc9c114ed694662a519d04896f491 commit r11-9644-g9871d39f752bc9c114ed694662a519d04896f491 Author: Kito Cheng <kito.cheng@sifive.com> Date: Tue Jan 25 20:44:04 2022 +0800 RISC-V: Always pass -misa-spec to assembler [PR104219] Add -misa-spec to OPTION_DEFAULT_SPECS to make sure -misa-spec will always pass that into assembler, that prevent GCC and binutils using different way to interpret the ISA string. gcc/ChangeLog: PR target/104219 * config.gcc (riscv*-*-*): Normalize the with_isa_spec value. (all_defaults): Add isa_spec. * config/riscv/riscv.h (OPTION_DEFAULT_SPECS): Add isa_spec. (cherry picked from commit 06e32a5ebf20c11dd31bc2677bede569fef84316)
Committed to trunk and backported to GCC 11 branch