Created attachment 234046 [details] contains stderr and stdout for the icinga2 build Hi, I try to compile icinga2 as a required package for opnsense on freebsd 13.0 stable. During compilation I run into the following error: /usr/obj/usr/ports/devel/gdb/work-py38/gdb-12.1/gdb/aarch64-fbsd-nat.c:79:31: error: no member named 'debug_regs_probed' in 'aarch64_fbsd_nat_target' bool aarch64_fbsd_nat_target::debug_regs_probed; ~~~~~~~~~~~~~~~~~~~~~~~~~^ I have mentioned this problem in the following locations as well: https://community.icinga.com/t/build-error-on-freebsd-for-incinga2-aarch64/9862 https://github.com/opnsense/tools/issues/290 There is a file attached with more stderr and stdout. I ran both “make ports-icinga2” and “make MAKE_JOBS_UNSAFE=yes ports-icinga2” and get the same error. kind regards, Johannes
Hi. Thanks for reporting. It seems that there is an issue on arm64. I'm quite busy at the moment, so it could take some time to get a fix.
Hi Luca, sphex on IRC had a look at the output and came to the following conclusions: "hmm. the last commit to devel/gdb might have build errors on aarch64 for __FreeBSD_version < 1400005." "I just checked that line in that file with an error in your output. one of the gdb ports patch for aarch64 seems to have an error (trying to define an undeclared static member due to conditional code exluding the declaration depending on freebsd version). IIUC" maybe this is helpful. kind regards, Johannes
Created attachment 234165 [details] build_fix.patch I think this is all that is needed. If you can confirm this fixes it, I will merge to upstream GDB master and then backport the patch to the port.
Hi John Baldwin, thank you very much for the patch. I have actually never patched something, is there a howto that details how it would be applied? I assume I would need to change the file "aarch64-fbsd-nat.c" in ports by hand and then try to run make again? Where can I find it?
*** Bug 264204 has been marked as a duplicate of this bug. ***
You can download the patch and save it in /usr/ports/devel/gdb/files/patch-test and see if the port builds. The patch will get applied for you by the ports system when building the port.
John Baldwin, thank you for your advice. I had modified "/usr/obj/usr/tools/config/22.1/OpenSSL:aarch64/usr/obj/usr/ports/devel/gdb/work-py38/gdb-12.1/gdb/aarch64-fbsd-nat.c" according to your patch, directly. Then I changed directory to /usr/ports/net-mgmt/icinga2 and ran "make install icinga2" and it ran for quite some time. In the end the following message came up: "make: don't know how to make icinga2. Stop", I attach a new file with the log: "make_icinga2_after_patch.txt". Does this mean it worked or did I make a mistake?
Created attachment 234177 [details] log output about make install icinga2 after applying the patch of John baldwin
I figured out a way to test the build fix locally and have merged a fix upstream into GDB. I've uploaded a fix for the port at https://reviews.freebsd.org/D35332
Hi John Baldwin, does this mean that once I reinstall the OS I can try it again and it should work? If that is the case I would do so and then close this ticket.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=c5722abb6a5cfdb83d8e2fcce271cba48dbd7281 commit c5722abb6a5cfdb83d8e2fcce271cba48dbd7281 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-05-30 23:24:21 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-05-30 23:24:21 +0000 devel/gdb: Fix build of GDB 12.1 on older aarch64 systems. Backport a patch from GDB to fix the build on aarch64 systems that do not support hardware breakpoints/watchpoints. PR: 264095 Reviewed by: pizzamig (maintainer), mikael Differential Revision: https://reviews.freebsd.org/D35332 devel/gdb/Makefile | 3 ++- devel/gdb/files/commit-b2fdd31b03e (new) | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-)
I tested it and it seems to work now. @John Baldwin: thank your very much!