build error on bash 4.3.30

During the building operations of bash 4.3.30 using buildroot, some errors may occur:

bashline.o: In function `bash_event_hook':
bashline.c:(.text+0x2328): undefined reference to `rl_signal_event_hook'
bashline.o: In function `bash_execute_unix_command':
bashline.c:(.text+0x2d5c): undefined reference to `rl_executing_keyseq'
bashline.o: In function `bashline_set_event_hook':
bashline.c:(.text+0x3734): undefined reference to `rl_signal_event_hook'
bashline.o: In function `bashline_reset_event_hook':
bashline.c:(.text+0x3748): undefined reference to `rl_signal_event_hook'
bashline.o: In function `initialize_readline':
bashline.c:(.text+0x4464): undefined reference to `rl_filename_stat_hook'
bashline.o: In function `attempt_shell_completion':
bashline.c:(.text+0x4b0c): undefined reference to `rl_filename_stat_hook'
bashline.o: In function `bashline_reset':
bashline.c:(.text+0x4bb8): undefined reference to `rl_filename_stat_hook'
bashline.c:(.text+0x4bc0): undefined reference to `rl_signal_event_hook'
bashline.o: In function `command_word_completion_function':
bashline.c:(.text+0x572c): undefined reference to `rl_filename_stat_hook'
collect2: error: ld returned 1 exit status
make[2]: *** [bash] Error 1

This error may depend on your external toolchain, however solution is as easy as making symlink. Main source of this error comes from readline library. It seems that readline 6.2 & 6 (afaik) do not have above functions.

In buildroot sysroot directory,

$BUILDROOT_DIR/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/

libreadline.so exists in usr/lib/arm-linux-gnueabihf and linked to lib/arm-linux-gnueabihf/libreadline.so.6 which also linked to libreadline.so.6.2. Changing this linkage to libreadline.so.6.3:

cp usr/lib/libreadline.so.6.3 lib/arm-linux-gnueabihf/
cd usr/lib
ln -sf libreadline.so.6.3 libreadline.so.6

should solve the build problem.

Leave a Reply

Your email address will not be published. Required fields are marked *