Created attachment 255519 [details] Patch to fix building on AARCH64 There is a clash between a name in a header file within the port and a name within the system header files that has prevented this from building since Sept 2021 (https://cgit.freebsd.org/ports/commit/devel/openocd/Makefile?id=55d27db3cff9f49e743ce4bf9f3fbb37b06dc184) A comment was updated to state that the offending code has been removed in the development branch and so a patch is not necessary as it will be resolved when the next release is cut (https://cgit.freebsd.org/ports/commit/devel/openocd/Makefile?id=70c2b83232415954356803e286ea2263f5e98c8d) Given that this problem has existed for more than 3 years now, I think maybe a patch could be justified. Luckily, I have provided one. This particular fix is relevant to me because I have started using FreeBSD under emulation on the new M series Mac computers, and so to save translation I am now using the ARM64 version of FreeBSD instead of the AMD64 version.
Thanks for the patch! I'll have a look at the patch next week as I am currently on the road. Generally, I'm happy to accept a patch for this. The idea was to not bother until somebody needs it which seems to be the case now :)
This patch seems defective. The PAGE_SIZE_4K and PAGE_SIZE_8K macros of <machine/param.h> are unrelated to the enumeration constants defined in this project and using them in place of said constants will break the code as the enumeration constants seem to be used to form indices into an array. This will also likely not build on other architectures, which do not all have these macros. jbo@ reminded me that I had already prepared a patch for this long ago; it just undefines the system macros before ingesting the enumeration definition: http://fuz.su/~fuz/freebsd/patch-src_target_nds32__tlb.h Please consider this patch instead of the submitter's.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7ff81df978340dd7d36c28c38492eb5ec7af6cb9 commit 7ff81df978340dd7d36c28c38492eb5ec7af6cb9 Author: Robert Clausecker <fuz@FreeBSD.org> AuthorDate: 2024-12-23 12:34:16 +0000 Commit: Joel Bodenmann <jbo@FreeBSD.org> CommitDate: 2024-12-23 13:01:12 +0000 devel/openocd: Unbreak aarch64 build Working around an issue where upstream provided page size macros are colliding with page size macros from <machine/param.h>. PR: 283034 Reported by: Duane (parakleta@darkreality.org) devel/openocd/Makefile | 7 +------ devel/openocd/files/patch-src_target_nds32__tlb.h (new) | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-)
A commit in branch 2024Q4 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e328e7c218833412be5537690ffd61924b128593 commit e328e7c218833412be5537690ffd61924b128593 Author: Robert Clausecker <fuz@FreeBSD.org> AuthorDate: 2024-12-23 12:34:16 +0000 Commit: Joel Bodenmann <jbo@FreeBSD.org> CommitDate: 2024-12-23 13:02:37 +0000 devel/openocd: Unbreak aarch64 build Working around an issue where upstream provided page size macros are colliding with page size macros from <machine/param.h>. PR: 283034 Reported by: Duane (parakleta@darkreality.org) (cherry picked from commit 7ff81df978340dd7d36c28c38492eb5ec7af6cb9) devel/openocd/Makefile | 7 +------ devel/openocd/files/patch-src_target_nds32__tlb.h (new) | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-)
The patch by fuz@ has been merged. testport completed by fuz@. Thank you both!