On aarch64, FreeBSD 14.2-PRERELEASE, lang/gcc15-devel fails when built with poudriere: enable-execute-stack.c:33:13: error: 'check_enabling' declared 'static' but never defined [-Werror=unused-function] 33 | static void check_enabling (void) __attribute__ ((unused)); | ^~~~~~~~~~~~~~ The error comes from /wrkdirs/usr/ports/lang/gcc15-devel/work/.build/./gcc/xgcc. The file with the error is named enable-execute-stack-mprotect.c in the source and has not changed in the past decade. There is also a file named enable-execute-stack-empty.c. Possibly gcc is stricter than it used to be. Possibly FreeBSD started using the mprotect flavor instead of the empty flavor.
Bug reproduced on CURRENT too: https://pkg-status.freebsd.org/ampere2/data/main-arm64-default/pdfee61567d9e_s36887e04947/logs/gcc15-devel-15.0.0.s20241110.log I will look into it as soon as possible. However, as usual, there are many GCC issues open and it might need a bit of time. Patches are welcome.
Created attachment 255240 [details] avoid compiler error in libgcc
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=2c87bf1deb36339194333ca8720483c0c8aa0ec4 commit 2c87bf1deb36339194333ca8720483c0c8aa0ec4 Author: John F. Carr <jfc@mit.edu> AuthorDate: 2024-11-23 12:41:34 +0000 Commit: Lorenzo Salvadore <salvadore@FreeBSD.org> CommitDate: 2024-11-28 10:32:29 +0000 lang/gcc15-devel: Fix stage2 fail on aarch64 PR: 282797 .../patch-libgcc_enable-execute-stack-mprotect.c (new) | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
Please confirm that the issue is fixed. I had only little time so I have been a bit sloppier than usual on testing (it is a -devel port, so it should not be a big deal)...
With the fix for the execute-stack bug I get a different error later: /wrkdirs/usr/ports/lang/gcc15-devel/work/gcc-15-20241124/libgcc/unwind-dw2-fde-dip.c:69:10: error: 'ElfW' redefined [-Werror] 69 | # define ElfW __ElfN | ^~~~ In file included from /usr/include/machine/elf.h:45, from /usr/include/elf.h:37, from /wrkdirs/usr/ports/lang/gcc15-devel/work/gcc-15-20241124/libgcc/unwind-dw2-fde-dip.c:36: /usr/include/sys/elf_generic.h:59:9: note: this is the location of the previous definition 59 | #define ElfW(x) __ElfN(x) | ^~~~