poudriere build for gcc12 fails: is only for aarch64 amd64 arm armv6 armv7 i386 powerpc powerpc64 powerpc64le, while you are running riscv64 This failure then skips 310 more packages in my list. Now... gcc12 clearly _does_ support riscv... so that's one fix. Alternatively (I wouldn't care) things that require gcc to build could require a gcc that does build in poudriere on FreebSD.
So I made the obvious patch to allow arch riscv64 in the FreeBSD port Makefile. After some hours of poudriere churning, I get a raft of errors from libgfortran: In file included from /wrkdirs/usr/ports/lang/gcc12/work/gcc-12.2.0/libgfortran/runtime/fpu.c:29: [06:39:04] ./fpu-target.h:44:3: error: unknown type name 'choke' [06:39:04] 44 | choke me [06:39:04] | ^~~~~ ... it goes on, but you can look it up in the attached poudriere log. This poudriere log was made on a riscv unmatched with the following kernel and userland: FreeBSD ump.daveg.ca 14.0-CURRENT FreeBSD 14.0-CURRENT riscv64 1400093 #0 main-n264297-b03012d0b600-dirty: Wed Jul 26 04:04:24 EDT 2023 root@ump.daveg.ca:/usr/obj/usr/src/riscv.riscv64/sys/GENERIC riscv
Well... that build log is too big. This is my poudriere link to the log: https://riscv.daveg.ca/data/freebsd14-HEAD/2023-07-27_17h44m41s/logs/errors/gcc12-12.2.0_6.log Since the whole log is too big, I will cut out the relevant section and upload that as a long (since the bug tracking is more permanent a record than my poudriere logs)...
Created attachment 243670 [details] Poudriere log fragment with the error.
If you follow it back, normally on FreeBSD we (confusingly) use fpu-glibc.h for cpu-target.h, but that requires feenableexcept to exist. However, riscv64 has feenableexcept as a static inline function in its fenv.h, and GCC's configure scripts aren't prepared for that, so they think it doesn't exist, fall back on fpu-sysv.h and then the build dies because riscv64 (like every non-x86 architecture) doesn't implement either of fp(re)setsticky.
Created attachment 243671 [details] Proposed fix Can you confirm whether the attached fixes the issue? This should match the semantics of glibc's implementation (we shouldn't be reporting success when asked to actually enable exceptions), and aligns symbol exporting with x86 and powerpc (though arm also exports fegetexcept, and aarch64 doesn't export any of them like current riscv (libgfortran has its own aarch64-specific implementation so nobody noticed), so the situation is a bit inconsistent and unprincipled).
NB: for others: I had to remove the ^M's from the patch to apply it.
(In reply to dgilbert from comment #6) Depending on how you download the patch, Bugzilla helpfully does that. Copying from https://bugs.freebsd.org/bugzilla/attachment.cgi?id=243671&action=edit avoids the issue.
(In reply to Jessica Clarke from comment #4) We had exactly the same issue on powerpc*, it was fixed in https://cgit.freebsd.org/src/commit/?id=448c505c33cc334193590f3844406d6a74f26e2a. There's still time to do the same for riscv64 before releng/14.0.
Please note that riscv64 is not a tier 1 platform at the moment: it is a tier 3 platform on FreeBSD 12 and tier 2 on FreeBSD 13 and 14, so support is limited. https://www.freebsd.org/platforms/ Unfortunately I lack the resources for testing riscv64 too properly, so please feel free to propose patches, test them and commit them. Also please note that the issue described here most probably involves GCC 12 as default GCC version, but I am planning to switch it to GCC 13 soon, so you should probably fix lang/gcc13 as well. Fixing lang/gcc14-devel could also be helpful for the future as lang/gcc14 will be created from lang/gcc14-devel when GCC 14 will be released (it will not happen soon). Thanks.
I recommend making GCC 13 the GCC_DEFAULT for riscv64 right away, ahead of changing the default for other architectures, and focus on that. Nothing to lose, possibly something to winn...
Created attachment 246629 [details] v0 I don't know what I'm doing but the attached patch allows the build to finish.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1947a9383ec3a048e334022365aa199a6ae55289 commit 1947a9383ec3a048e334022365aa199a6ae55289 Author: Brooks Davis <brooks@FreeBSD.org> AuthorDate: 2024-03-21 23:45:53 +0000 Commit: Brooks Davis <brooks@FreeBSD.org> CommitDate: 2024-03-21 23:48:37 +0000 msun/riscv: expose fe{disable,enable}except This is required for GCC to build. PR: 272759 Reported by: dgilbert@eicat.ca Submitted by: jrtc27 Differential Revision: https://reviews.freebsd.org/D44333 lib/msun/riscv/Symbol.map | 10 ++++------ lib/msun/riscv/fenv.h | 7 +++---- 2 files changed, 7 insertions(+), 10 deletions(-)