git: 7d87c1ba6c4a - stable/15 - libproc: link against libctf if MK_CTF != no instead of MK_CDDL != no

From: Enji Cooper <ngie_at_FreeBSD.org>
Date: Fri, 04 Sep 2026 06:01:35 UTC
The branch stable/15 has been updated by ngie:

URL: https://cgit.FreeBSD.org/src/commit/?id=7d87c1ba6c4ad73d02ffbfe7dd67c1bcf7c392f1

commit 7d87c1ba6c4ad73d02ffbfe7dd67c1bcf7c392f1
Author:     Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2026-07-16 21:48:37 +0000
Commit:     Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-09-04 06:01:27 +0000

    libproc: link against libctf if MK_CTF != no instead of MK_CDDL != no
    
    Logic prior to this change would incorrectly try linking when MK_CDDL != no,
    instead of MK_CTF != no, which could result in the library and the tests being
    broken if/when MK_CTF == no and MK_CDDL != no (an uncommon, but possible
    combination with today's build knobs).
    
    This change updates the conditional to correctly track the value of MK_CTF, which
    in turn is properly toggled to no if/when MK_CDDL == no as it's a dependent build
    knob.
    
    This [niche] build bug has been present in FreeBSD since 2014.
    
    MFC after:      1 week
    
    (cherry picked from commit f2e6a8b9e50c7552037cb635f17b955ead84a813)
---
 lib/libproc/Makefile     | 2 +-
 share/mk/src.libnames.mk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile
index 41643505f999..d0cbbbd79d55 100644
--- a/lib/libproc/Makefile
+++ b/lib/libproc/Makefile
@@ -15,7 +15,7 @@ CFLAGS+=	-I${.CURDIR}
 
 LIBADD+=	cxxrt elf procstat rtld_db util z
 
-.if ${MK_CDDL} != "no"
+.if ${MK_CTF} != "no"
 LIBADD+=	ctf
 IGNORE_PRAGMA=	YES
 CFLAGS+= -DIN_BASE
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 945df60769fc..205b8e42662d 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -376,7 +376,7 @@ _DP_radius=	crypto
 _DP_rtld_db=	elf procstat
 _DP_procstat=	kvm util elf
 _DP_proc=	cxxrt
-.if ${MK_CDDL} != "no"
+.if ${MK_CTF} != "no"
 _DP_proc+=	ctf
 .endif
 _DP_proc+=	elf procstat rtld_db util z