package/readline: link host shared library against ncurses
PATCH v2 1/1 package/readline: link host shared library against ncurses
Host-readline builds its shared library without linking the curses/termcap library, leaving termcap symbols (UP, BC, PC) undefined. host-gdb pulls in host-readline, and buildroot runs its fakeroot finalization script with $(HOST_DIR)/lib in LD_LIBRARY_PATH; a readline-linked /bin/sh then loads this host libreadline.so and aborts on the undefined symbol:
/bin/sh: symbol lookup error: libreadline.so.8: undefined symbol: UP
Pass the same configure options to the host variant that the target already uses (commit baa81362ef): --with-curses --with-shared-termcap-library, so configure links the shared library against libncursesw.
Reproduction (red) and verification (green), with a minimal config using an external Bootlin aarch64-glibc toolchain (so it builds in minutes):
# config:
BR2_aarch64=y
BR2_cortex_a72=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
make O=/tmp/br-red BR2_DEFCONFIG=<config> defconfig
make O=/tmp/br-red host-readline
nm -D /tmp/br-red/host/lib/libreadline.so | grep -E ' U (UP|BC|PC)$' # red: UP, BC and PC are undefined
# apply this patch, then: make O=/tmp/br-green BR2_DEFCONFIG=<config> defconfig make O=/tmp/br-green host-readline nm -D /tmp/br-green/host/lib/libreadline.so | grep -E ' U (UP|BC|PC)$' # green: no undefined symbols; the library links libncursesw.so.6
---
Changes v1 -> v2:
- rework to use configure options (--with-curses --with-shared-termcap-library) instead of mangling the make step with SHLIB_LIBS (suggested by Arnout Vandecappelle)
--- package/readline/readline.mk | 3 +++ 1 file changed, 3 insertions(+)
package/readline/readline.mk +3 -0
@@ -9,6 +9,9 @@ READLINE_SITE = $(BR2_GNU_MIRROR)/readline READLINE_INSTALL_STAGING = YES READLINE_DEPENDENCIES = ncurses host-autoconf HOST_READLINE_DEPENDENCIES = host-ncurses host-autoconf +HOST_READLINE_CONF_OPTS = \ + --with-curses \ + --with-shared-termcap-library READLINE_CONF_ENV = bash_cv_func_sigsetjmp=yes \ bash_cv_wcwidth_broken=no READLINE_CONF_OPTS = \
Signature · 6 lines
2.55.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot