I'm trying to do a Prefix bootstrap on a Starfive VisionFive 2 (RISC-V), and during the 2nd stage the build of sys-devel/gcc-12.2.1_p20221231 fails due to: In file included from /nvme/gentoo/tmp/var/tmp/portage/sys-devel/gcc-12.2.1_p20221231/work/gcc-12-20221231/libgcc/../gcc/tsystem.h:87, from /nvme/gentoo/tmp/var/tmp/portage/sys-devel/gcc-12.2.1_p20221231/work/gcc-12-20221231/libgcc/libgcc2.c:27: /usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory 27 | #include <bits/libc-header-start.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. The file is available (on the host, at least; I don't know if it should be somewhere in the Prefix build dir?) in: /usr/include/riscv64-linux-gnu/bits/libc-header-start.h Reproducible: Always
Created attachment 848348 [details] GCC build logs
*** Bug 923410 has been marked as a duplicate of this bug. ***
I think the problem comes from this bug in GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106271 Actually, I see that the file: gentoo/tmp/var/tmp/portage/sys-devel/gcc-13.2.1_p20240113-r1/work/gcc-13-20240113/gcc/config/riscv/t-linux looks like: # Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/ MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) So, probably applying this patch: https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/config/riscv/t-linux;h=a6f64f88d25c989159207cbef19778b703c95797;hp=216d2776a183d13ade76642b73b9bf04b0c4694e;hb=47f95bc4be4eb14730ab3eaaaf8f6e71fda47690;hpb=0698c9fddfc5a41dd7f233928b7a486cb044fea3 would solve the problem.
Do we know if applying this patch actually makes the compilation go through?
Happy to add it to patchset etc if it's confirmed to work.
(In reply to Fabian Groffen from comment #4) > Do we know if applying this patch actually makes the compilation go through? Yes, I added the line manually after the bootstrap script downloads and decompress gcc and the compilation definitely goes through this point.
(In reply to Fabian Groffen from comment #4) > Do we know if applying this patch actually makes the compilation go through? Yes, I can confirm that applying this patch makes the compilation go through :)
(In reply to Sam James from comment #5) > Happy to add it to patchset etc if it's confirmed to work. It would be great if you can add it to patchset, I can confirm that it works.
OK, will do. Thanks!
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d5e5f9b252f00c9485c34446efc01bdd2eaaa9b1 commit d5e5f9b252f00c9485c34446efc01bdd2eaaa9b1 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-02-28 00:28:36 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-02-28 00:29:43 +0000 13.2.0: add 91_all_riscv_PR106271-multilib-bootstrap.patch Fixes prefix bootstrap for riscv. Bug: https://gcc.gnu.org/PR106271 Bug: https://bugs.gentoo.org/890636 Signed-off-by: Sam James <sam@gentoo.org> .../91_all_riscv_PR106271-multilib-bootstrap.patch | 37 ++++++++++++++++++++++ 13.2.0/gentoo/README.history | 4 +++ 2 files changed, 41 insertions(+) https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=f373ff919da62443ca59681f219b4899e72a6f2f commit f373ff919da62443ca59681f219b4899e72a6f2f Author: Sam James <sam@gentoo.org> AuthorDate: 2024-02-28 00:27:00 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-02-28 00:29:43 +0000 12.3.0: add 77_all_riscv_PR106271-multilib-bootstrap.patch Fixes prefix bootstrap for riscv. Bug: https://gcc.gnu.org/PR106271 Bug: https://bugs.gentoo.org/890636 Signed-off-by: Sam James <sam@gentoo.org> .../77_all_riscv_PR106271-multilib-bootstrap.patch | 36 ++++++++++++++++++++++ 12.3.0/gentoo/README.history | 5 +++ 2 files changed, 41 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d55c7c1d2d179894998a18dc311714e05f0d913 commit 7d55c7c1d2d179894998a18dc311714e05f0d913 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-02-28 00:33:40 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-02-28 00:33:40 +0000 sys-devel/gcc: fix prefix riscv bootstrap for 13 Fixes prefix bootstrap for riscv. Bug: https://gcc.gnu.org/PR106271 Closes: https://bugs.gentoo.org/890636 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/Manifest | 2 +- sys-devel/gcc/gcc-13.2.1_p20240210.ebuild | 2 +- sys-devel/gcc/gcc-13.2.1_p20240224.ebuild | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1849c746cd35fb74c6014d1bfd2b1e287bad0a0f commit 1849c746cd35fb74c6014d1bfd2b1e287bad0a0f Author: Sam James <sam@gentoo.org> AuthorDate: 2024-02-28 00:32:14 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-02-28 00:32:14 +0000 sys-devel/gcc: fix prefix riscv bootstrap for 12 Fixes prefix bootstrap for riscv. Bug: https://gcc.gnu.org/PR106271 Bug: https://bugs.gentoo.org/890636 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/Manifest | 1 + sys-devel/gcc/gcc-12.3.1_p20240209.ebuild | 2 +- sys-devel/gcc/gcc-12.3.1_p20240223.ebuild | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)