git: 73902ed85ab7 - main - ldconfig: only configure compat32 when kernel supports it

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Fri, 24 Nov 2023 16:39:21 UTC
The branch main has been updated by kib:

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

commit 73902ed85ab73d455d4be8c77336c88a07512230
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-11-18 13:09:30 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-11-24 16:38:42 +0000

    ldconfig: only configure compat32 when kernel supports it
    
    and eliminate hard-coded arch list.
    
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D42669
---
 libexec/rc/rc.d/ldconfig | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libexec/rc/rc.d/ldconfig b/libexec/rc/rc.d/ldconfig
index ed3484017d84..beb79ba95b84 100755
--- a/libexec/rc/rc.d/ldconfig
+++ b/libexec/rc/rc.d/ldconfig
@@ -39,10 +39,7 @@ ldconfig_start()
 		startmsg 'ELF ldconfig path:' ${_LDC}
 		${ldconfig} -elf ${_ins} ${_LDC}
 
-		machine_arch=$(sysctl -n hw.machine_arch)
-
-		case ${machine_arch} in
-		aarch64|amd64|powerpc64)
+		if check_kern_features compat_freebsd32; then
 			for i in ${ldconfig_local32_dirs}; do
 				if [ -d "${i}" ]; then
 					_files=`find ${i} -type f`
@@ -67,7 +64,7 @@ ldconfig_start()
 			startmsg '32-bit compatibility ldconfig path:' ${_LDC}
 			${ldconfig} -32 ${_ins} ${_LDC}
 			;;
-		esac
+		fi
 
 	fi
 }