git: c4df3e37784e - stable/14 - 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:04:01 UTC
The branch stable/14 has been updated by ngie:

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

commit c4df3e37784ebc5a0e4095f401aff80dc0a6e5fa
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:03:15 +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 67c4e642ea00..5c955596e28c 100644
--- a/lib/libproc/Makefile
+++ b/lib/libproc/Makefile
@@ -16,7 +16,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 c6e3d1bcba39..72ef522c887c 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -334,7 +334,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