Bug 279005

Summary: Cannot build 14-STABLE kernel due to ld: error: undefined symbol: ktrcapfail (ktrace)
Product: Base System Reporter: jakub_lach
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: emaste, jfree
Priority: ---    
Version: 14.0-STABLE   
Hardware: Any   
OS: Any   

Description jakub_lach 2024-05-15 11:37:08 UTC
Hello, 

I'm on FreeBSD 14.1-STABLE #0 stable/14-91df7d335 with custom kernel with KTRACE removed, after updating git I wanted to rebuild the same kernel and world, kernel failed with:

--- kernel ---
linking kernel
ld: error: undefined symbol: ktrcapfail
>>> referenced by vfs_lookup.c
>>>               vfs_lookup.o:(namei)
>>> referenced by vfs_lookup.c
>>>               vfs_lookup.o:(namei_setup)
>>> referenced by vfs_lookup.c
>>>               vfs_lookup.o:(vfs_lookup)
>>> referenced 3 more times
*** [kernel] Error code 1

I suspect recent ktrace changes.
Comment 1 jakub_lach 2024-05-15 12:18:49 UTC
Adding

options         KTRACE                  # ktrace(1) support

allowed kernel to build/link/install.

FreeBSD 14.1-STABLE #1 stable/14-0418d7a09
Comment 2 jakub_lach 2024-05-15 14:01:04 UTC
Fixed by kib@
Comment 3 Ed Maste freebsd_committer freebsd_triage 2024-05-16 14:43:36 UTC
commit 00cf2f3092e462b8840b8cb9c3d86c471da065e5
Author: Konstantin Belousov <kib@FreeBSD.org>
Date:   Wed Apr 24 22:06:14 2024 +0300

    vfs_lookup.c: only call ktrcapfail() if KTRACE is enabled
    
    (cherry picked from commit 6b0cf2a2379b86b67269ed4549057cd6d69490e5)