git: 0840bdbf2a07 - main - Don't try and run kldxref for arm kernels

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Thu, 14 Dec 2023 16:44:26 UTC
The branch main has been updated by jrtc27:

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

commit 0840bdbf2a07b68e29267bc49057ca6df2351360
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2023-12-14 16:40:08 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2023-12-14 16:40:08 +0000

    Don't try and run kldxref for arm kernels
    
    Surprisingly, kldxref does not currently support arm, and unhelpfully
    this means it silently does nothing rather than give an error, so the
    linker.hints entry added to the METALOG for -DNO_ROOT builds (and
    pkgbase ones) refers to a file that doesn't exist. Ideally it would be
    supported (and ideally the METALOG handling would be less fragile, but
    without integrating it into kldxref the only real option would be to
    just run find(1) to get the list of linker.hints files, which feels a
    little backwards), but for now just paper over this by skipping the
    build step on arm.
    
    Reported by:    bapt
    Fixes:          ff7c12c1f17e ("Make kldxref a bootstrap tool and use unconditionally")
---
 sys/conf/kmod.mk     | 3 ++-
 sys/modules/Makefile | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 5d4dcd4371bc..4482034baf67 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -354,7 +354,8 @@ _kmodinstall: .PHONY
 
 .include <bsd.links.mk>
 
-.if !defined(NO_XREF)
+# XXX: kldxref lacks support for arm
+.if !defined(NO_XREF) && ${MACHINE_CPUARCH} != "arm"
 afterinstall: _kldxref
 .ORDER: realinstall _kldxref
 .ORDER: _installlinks _kldxref
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index c14933eebda4..dc914946ff41 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -908,7 +908,8 @@ SUBDIR:= ${SUBDIR:N${reject}}
 .endif # MODULES_OVERRIDE -- Keep last
 
 # Calling kldxref(8) for each module is expensive.
-.if !defined(NO_XREF)
+# XXX: kldxref lacks support for arm
+.if !defined(NO_XREF) && ${MACHINE_CPUARCH} != "arm"
 .MAKEFLAGS+=	-DNO_XREF
 afterinstall: .PHONY
 	${KLDXREF_CMD} ${DESTDIR}${KMODDIR}