From 3c2a0527e038ae56b82b652067f52c7925a16d15 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Fri, 28 Mar 2025 12:57:11 +0000 Subject: [PATCH] setup_board: Add ldconfig wrapper for non-native arches Signed-off-by: James Le Cuirot --- setup_board | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/setup_board b/setup_board index 7073f2d037..f2c45188fe 100755 --- a/setup_board +++ b/setup_board @@ -88,7 +88,11 @@ EOF generate_all_wrappers() { local cmds=() wrappers=() - local wrapper + local wrapper qemu + + # If the QEMU user space emulator is missing for this board arch, that implies + # the board arch matches the SDK arch and therefore emulation is unnecessary. + qemu=$(type -P "qemu-${BOARD_CHOST%%-*}") || unset qemu info "Generating wrapper scripts" @@ -111,6 +115,18 @@ exec ${BOARD_CHOST}-gdb -iex 'set sysroot ${BOARD_ROOT}' "\$@" EOF wrappers+=( "${wrapper}" ) + # ldconfig cannot generate caches for non-native arches. Use QEMU and the + # native ldconfig to work around that. + wrapper="/usr/local/sbin/ldconfig-${BOARD_VARIANT}" + sudo_clobber "${wrapper}" <