Date: Tue, 16 Jun 2026 04:13:46 +0000 From: Cy Schubert <cy@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Cc: Chris.Torek <chris.torek@gmail.com> Subject: git: 221f735298e0 - main - sysutils/lsof: Fix 16-CURRENT build Message-ID: <6a30cd7a.3e2db.34c9134e@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=221f735298e005a5652ad116feac4bbe99645c47 commit 221f735298e005a5652ad116feac4bbe99645c47 Author: Chris.Torek <chris.torek@gmail.com> AuthorDate: 2026-06-15 16:52:35 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2026-06-16 04:13:00 +0000 sysutils/lsof: Fix 16-CURRENT build Fix, /usr/include/sys/malloc.h:194:7: error: conflicting types for 'malloc' 194 | void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like PR: 295414 Approved by: maintainer timeout --- sysutils/lsof/Makefile | 5 +++ .../lsof/files/patch-lib_dialects_freebsd_dlsof.h | 42 ++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/sysutils/lsof/Makefile b/sysutils/lsof/Makefile index 7648cdc29b99..eb07b5f88525 100644 --- a/sysutils/lsof/Makefile +++ b/sysutils/lsof/Makefile @@ -68,4 +68,9 @@ do-install: ${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_SCRIPT} ${WRKSRC}/scripts/* ${STAGEDIR}${DATADIR} +# Create dummy empty vnode_if.h in case vnode.h includes it +# (true on FreeBSD 16, harmless if not). +post-patch: + ${TOUCH} ${WRKSRC}/include/vnode_if.h + .include <bsd.port.post.mk> diff --git a/sysutils/lsof/files/patch-lib_dialects_freebsd_dlsof.h b/sysutils/lsof/files/patch-lib_dialects_freebsd_dlsof.h index 788ca976508f..d4b9236badd3 100644 --- a/sysutils/lsof/files/patch-lib_dialects_freebsd_dlsof.h +++ b/sysutils/lsof/files/patch-lib_dialects_freebsd_dlsof.h @@ -1,6 +1,44 @@ ---- lib/dialects/freebsd/dlsof.h.orig 2026-03-25 16:34:30 UTC +--- lib/dialects/freebsd/dlsof.h.orig +++ lib/dialects/freebsd/dlsof.h -@@ -147,6 +147,7 @@ int getmntinfo(struct statfs **, int); +@@ -43,14 +43,31 @@ + # include <signal.h> + # include <unistd.h> + +-# if FREEBSDV >= 13000 +-/* This header is a huge mess. Please don't support EOL FreeBSD releases. */ +-# define _KERNEL 1 +-# include <sys/_lock.h> +-# undef _KERNEL +-# endif /* FREEBSDV>=13000 */ ++/* ++ * Pull these in without _KERNEL. Using _KERNEL below is abuse ++ * in the first place, but this mitigates a bunch of new issues in ++ * FreeBSD 16. This relies on the fact that the system includes use ++ * header guards, so once they are included without _KERNEL the ++ * later (implicit/indirect) ones with _KERNEL are no-ops. ++ * ++ * Add dummy declarations for _KERNEL items that we don't actually ++ * need but get pulled in anyway. ++ */ ++# include <sys/types.h> ++# include <sys/systm.h> ++# include <sys/malloc.h> ++ ++# define LOCK_FILE NULL ++# define LOCK_LINE 0 ++# define MALLOC_DECLARE(type) extern struct malloc_type type ++# define TRUE 1 ++# define FALSE 0 ++typedef struct vm_page *vm_page_t; ++ + # define _KERNEL 1 + ++# include <sys/event.h> ++ + # if defined(HAS_VM_MEMATTR_T) + /* + * The d_mmap2_t function typedef in <sys/conf.h> may need the definition +@@ -147,6 +164,7 @@ int getmntinfo(struct statfs **, int); # include <netinet/ip.h> # include <net/route.h> # define _WANT_INPCB /* for FreeBSD 12 and above */home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a30cd7a.3e2db.34c9134e>
