git: ebb8ddad57e5 - 2025Q2 - net-mgmt/ipgen: fix build on non-amd64, 15-CURRENT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 06 May 2025 18:54:32 UTC
The branch 2025Q2 has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=ebb8ddad57e5696a2c9517d3e0fc717f782d80dc commit ebb8ddad57e5696a2c9517d3e0fc717f782d80dc Author: Robert Clausecker <fuz@FreeBSD.org> AuthorDate: 2025-05-05 17:16:37 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2025-05-06 18:54:22 +0000 net-mgmt/ipgen: fix build on non-amd64, 15-CURRENT - 15-CURRENT ditches the CLLADDR macro; replace it with LLADDR - cpu_in_cksum.S is mediocre assembly code that only works on amd64. Disable its use; the compiler will do just as good of a job. - assume we always have atomic_* functions on FreeBSD, even if they are not macros (as is the case on armv7) Approved by: portmgr (build fix blanket) MFH: 2025Q2 See also: D50065 (cherry picked from commit 3adf93fcb439b56b46263e34df63d90e143b004a) --- net-mgmt/ipgen/Makefile | 1 + net-mgmt/ipgen/files/patch-gen_compat.h | 23 +++++++++++++++++++++++ net-mgmt/ipgen/files/patch-gen_util.c | 14 ++++++++++++++ net-mgmt/ipgen/files/patch-libpkt-GNUmakefile | 15 +++++++++++++-- 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/net-mgmt/ipgen/Makefile b/net-mgmt/ipgen/Makefile index 25d324f9d3b0..e2e33b19c453 100644 --- a/net-mgmt/ipgen/Makefile +++ b/net-mgmt/ipgen/Makefile @@ -1,5 +1,6 @@ PORTNAME= ipgen PORTVERSION= 1.30.20240527 +PORTREVISION= 1 CATEGORIES= net-mgmt MAINTAINER= hrs@FreeBSD.org diff --git a/net-mgmt/ipgen/files/patch-gen_compat.h b/net-mgmt/ipgen/files/patch-gen_compat.h new file mode 100644 index 000000000000..373d113da027 --- /dev/null +++ b/net-mgmt/ipgen/files/patch-gen_compat.h @@ -0,0 +1,23 @@ +--- gen/compat.h.orig 2024-05-27 06:59:46 UTC ++++ gen/compat.h +@@ -48,6 +48,7 @@ + #define ETHERTYPE_FLOWCONTROL 0x8808 + #endif + ++#if !defined(__FreeBSD__) || defined(__i386__) + #ifndef atomic_fetchadd_32 + #define atomic_fetchadd_32(t, v) __atomic_fetch_add(t, v, __ATOMIC_CONSUME) + #endif +@@ -67,10 +68,11 @@ atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval + bool ret = __atomic_compare_exchange_n(p, &cmpval, newval, false, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED); + return ret ? 1 : 0; + } +-#endif ++#endif /* !defined(__FreeBSD__) || defined(__i386__) */ + + #ifndef __unused + #define __unused __attribute__((unused)) ++#endif + #endif + + #endif /* _COMPAT_H_ */ diff --git a/net-mgmt/ipgen/files/patch-gen_util.c b/net-mgmt/ipgen/files/patch-gen_util.c new file mode 100644 index 000000000000..83dfd7f6a23d --- /dev/null +++ b/net-mgmt/ipgen/files/patch-gen_util.c @@ -0,0 +1,14 @@ +--- gen/util.c.orig 2025-05-05 17:12:32 UTC ++++ gen/util.c +@@ -351,7 +351,11 @@ getiflinkaddr(const char *ifname, struct ether_addr *a + if ((sdl->sdl_type == IFT_ETHER) && + (sdl->sdl_alen == ETHER_ADDR_LEN)) { + ++#ifdef CLLADDR + memcpy(addr, (const struct ether_addr *)CLLADDR(sdl), ETHER_ADDR_LEN); ++#else ++ memcpy(addr, (const struct ether_addr *)LLADDR(sdl), ETHER_ADDR_LEN); ++#endif + found = 1; + break; + } diff --git a/net-mgmt/ipgen/files/patch-libpkt-GNUmakefile b/net-mgmt/ipgen/files/patch-libpkt-GNUmakefile index 7c76074a0089..21aea9fe2223 100644 --- a/net-mgmt/ipgen/files/patch-libpkt-GNUmakefile +++ b/net-mgmt/ipgen/files/patch-libpkt-GNUmakefile @@ -1,6 +1,6 @@ ---- libpkt/GNUmakefile.orig 2024-02-29 01:38:00 UTC +--- libpkt/GNUmakefile.orig 2024-05-27 06:59:46 UTC +++ libpkt/GNUmakefile -@@ -8,7 +8,6 @@ SRCS+= utils.c +@@ -8,16 +8,15 @@ SRCS+= utils.c SRCS+= ip6pkt.c SRCS+= utils.c @@ -8,3 +8,14 @@ CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith CFLAGS+= -Wreturn-type -Wswitch -Wshadow CFLAGS+= -Wcast-qual -Wwrite-strings + CFLAGS+= -Wno-address-of-packed-member + + # x86 +-CFLAGS+= -DUSE_CPU_IN_CKSUM ++#CFLAGS+= -DUSE_CPU_IN_CKSUM + SRCS+= in_cksum.c +-SRCS+= cpu_in_cksum.S ++#SRCS+= cpu_in_cksum.S + + + OBJS+= $(patsubst %.S,%.o,$(SRCS:%.c=%.o))