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}" <