Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2026 05:47:05 +0000
From:      Don Lewis <truckman@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: 6fe0bef5a5f5 - main - devel/libgtop: Fix build on 16.0-CURRENT
Message-ID:  <6a13e259.3626d.1daccf9c@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by truckman:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6fe0bef5a5f5b7c87e8f394b04e6dbecd83c961e

commit 6fe0bef5a5f5b7c87e8f394b04e6dbecd83c961e
Author:     Chris Torek <chris.torek@gmail.com>
AuthorDate: 2026-05-25 05:39:30 +0000
Commit:     Don Lewis <truckman@FreeBSD.org>
CommitDate: 2026-05-25 05:46:37 +0000

    devel/libgtop: Fix build on 16.0-CURRENT
    
    ugly patch to make build on freebsd
    
    As with the lsof patch (bug #395414), this makes things build on
    16-current, but I don't know if it breaks older supported releases.
    
    Build tested on: (truckman)
      14.3-RELEASE, 14.4-RELEASE amd64 and i386
      15.0-RELEASE, 15.1-RC1 amd64
      16.0-CURRENT amd64
    
    PR:             295284
---
 .../libgtop/files/patch-sysdeps_freebsd_procmap.c  | 42 +++++++++++++++++++---
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_procmap.c b/devel/libgtop/files/patch-sysdeps_freebsd_procmap.c
index a3b4fcc550f2..6135db88e95d 100644
--- a/devel/libgtop/files/patch-sysdeps_freebsd_procmap.c
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_procmap.c
@@ -1,6 +1,30 @@
---- sysdeps/freebsd/procmap.c.orig	2023-01-15 10:43:14 UTC
+--- sysdeps/freebsd/procmap.c.orig
 +++ sysdeps/freebsd/procmap.c
-@@ -26,6 +26,8 @@
+@@ -20,12 +20,32 @@
+ */
+ 
+ #include <config.h>
++
++/*
++ * FreeBSD-16 specific stuff that shouldn't hurt earlier FreeBSD:
++ *
++ * Need sys/event.h early with _KERNEL, before glibtop/procmap.h.
++ * This gets us macros for some inline vnode functions that crop up
++ * with _KERNEL later.
++ *
++ * After that, we need to neuter MPASS by including kassert.h.  Last,
++ * a boolean_t conflict appears (sys/types.h vs vm/vm.h), so whack it as well.
++ */
++#define _KERNEL
++#include <sys/types.h>
++#include <sys/event.h>
++#include <sys/kassert.h>
++#undef _KERNEL
++#define HAVE_BOOLEAN /* until vm/vm.h is cleaned-up */
++
+ #include <glibtop.h>
+ #include <glibtop/error.h>
+ #include <glibtop/procmap.h>
  
  #include <glibtop_suid.h>
  
@@ -9,7 +33,15 @@
  #include <kvm.h>
  #include <sys/param.h>
  #include <sys/proc.h>
-@@ -51,12 +53,14 @@
+@@ -43,6 +63,7 @@
+ #define _WANT_FILE
+ #include <sys/file.h>
+ #undef _WANT_FILE
++#include <sys/systm.h> /* early and without _KERNEL, for FreeBSD 16 */
+ #else
+ #define _KERNEL
+ #include <sys/file.h>
+@@ -51,12 +72,14 @@
  #define _KERNEL
  #include <sys/mount.h>
  #include <ufs/ufs/quota.h>
@@ -25,7 +57,7 @@
  
  
  #if (__FreeBSD_version >= 1101001)
-@@ -100,7 +104,7 @@ _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, s
+@@ -100,7 +123,7 @@ _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, struct vnode *vnode,
          *inum = 0;
          *dev = 0;
  
@@ -34,7 +66,7 @@
   	             (char *) &tagptr, sizeof (tagptr)) != sizeof (tagptr) ||
              kvm_read (server->machine->kd, (gulong) tagptr,
  		     (char *) tagstr, sizeof (tagstr)) != sizeof (tagstr))
-@@ -120,7 +124,7 @@ _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, s
+@@ -120,7 +143,7 @@ _glibtop_sysdeps_freebsd_dev_inode (glibtop *server, struct vnode *vnode,
                  return;
          }
  


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a13e259.3626d.1daccf9c>