From 1a30d52dd1d6174e42c42dbbc4bed624c7c122cb Mon Sep 17 00:00:00 2001 From: Lorenzo Salvadore Date: Fri, 16 May 2025 18:12:36 +0200 Subject: lang/gcc15-devel: Unbreak on aarch64 FreeBSD defines ElfW(x) to translate Linux's convention to FreeBSD's convention. GCC defines ElfW to convert its convention to FreeBSD's convention. This patch removes the conversion defined by GCC so that the FreeBSD conversion only is applied. Co-authored-by: Mark Millard PR: 282797 Reported by: John F. Carr Email Thread: https://lists.freebsd.org/archives/freebsd-toolchain/2025-May/002282.html --- lang/gcc15-devel/Makefile | 1 + .../files/patch-libgcc_unwind-dw2-fde-dip.c | 23 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 lang/gcc15-devel/files/patch-libgcc_unwind-dw2-fde-dip.c diff --git a/lang/gcc15-devel/Makefile b/lang/gcc15-devel/Makefile index 20158b2696b5..d893884a86e4 100644 --- a/lang/gcc15-devel/Makefile +++ b/lang/gcc15-devel/Makefile @@ -1,5 +1,6 @@ PORTNAME= gcc PORTVERSION= 15.1.1.s20250510 +PORTREVISION= 1 CATEGORIES= lang MASTER_SITES= GCC/snapshots/${DIST_VERSION} PKGNAMESUFFIX= ${SUFFIX}-devel diff --git a/lang/gcc15-devel/files/patch-libgcc_unwind-dw2-fde-dip.c b/lang/gcc15-devel/files/patch-libgcc_unwind-dw2-fde-dip.c new file mode 100644 index 000000000000..66452b37de0f --- /dev/null +++ b/lang/gcc15-devel/files/patch-libgcc_unwind-dw2-fde-dip.c @@ -0,0 +1,23 @@ +FreeBSD defines ElfW(x) to translate Linux's convention to FreeBSD's convention. +GCC defines ElfW to convert its convention to FreeBSD's convention. This patch +removes the conversion defined by GCC so that the FreeBSD conversion only is +applied. + +--- libgcc/unwind-dw2-fde-dip.c.orig 2025-05-16 15:47:38 UTC ++++ libgcc/unwind-dw2-fde-dip.c +@@ -59,13 +59,13 @@ + + #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) \ +- && defined(__linux__) ++ && (defined(__linux__) || defined(__FreeBSD__)) + # define USE_PT_GNU_EH_FRAME + #endif + + #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) \ +- && (defined(__DragonFly__) || defined(__FreeBSD__)) ++ && defined(__DragonFly__) + # define ElfW __ElfN + # define USE_PT_GNU_EH_FRAME + #endif -- cgit v1.2.3