[Buildroot] libreadline undefined symbol error when generating rootfs tarball

Peter Seiderer ps.report at gmx.net
Fri Sep 19 14:20:48 UTC 2025


On Fri, 19 Sep 2025 05:18:13 +0700, Bagas Sanjaya <bagasdotme at gmail.com> wrote:

> On 9/18/25 13:52, Peter Seiderer wrote:
> > On Thu, 18 Sep 2025 07:28:05 +0700, Bagas Sanjaya <bagasdotme at gmail.com> wrote:
> >   
> >> On 9/17/25 22:20, Peter Seiderer wrote:  
> >>> On Wed, 17 Sep 2025 12:20:22 +0700, Bagas Sanjaya <bagasdotme at gmail.com> wrote:
> >>>      
> >>>> On Tue, Sep 16, 2025 at 08:42:17AM +0200, Peter Seiderer wrote:  
> >>>>> The following patch fixed the problem for me:
> >>>>>
> >>>>> diff --git a/package/readline/readline.mk b/package/readline/readline.mk
> >>>>> index f69cbe45e2..078607a0c5 100644
> >>>>> --- a/package/readline/readline.mk
> >>>>> +++ b/package/readline/readline.mk
> >>>>> @@ -15,6 +15,10 @@ READLINE_CONF_OPTS = \
> >>>>>    	--disable-install-examples \
> >>>>>    	--with-curses \
> >>>>>    	--with-shared-termcap-library
> >>>>> +HOST_READLINE_CONF_OPTS = \
> >>>>> +	--disable-install-examples \
> >>>>> +	--with-curses \
> >>>>> +	--with-shared-termcap-library
> >>>>>    READLINE_LICENSE = GPL-3.0+
> >>>>>    READLINE_LICENSE_FILES = COPYING
> >>>>>    READLINE_CPE_ID_VENDOR = gnu  
> >>>>
> >>>> Applying your patch, I get another build error (this time on gdb):
> >>>>
> >>>> ```
> >>>>     CXX    init.o
> >>>>     CXXLD  gdb
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `tgoto at NCURSES6_TINFO_5.0.19991023'
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `UP at NCURSES6_TINFO_5.0.19991023'
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `tgetent at NCURSES6_TINFO_5.0.19991023'
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `tgetnum at NCURSES6_TINFO_5.0.19991023'
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `PC at NCURSES6_TINFO_5.0.19991023'
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `tgetstr at NCURSES6_TINFO_5.0.19991023'
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `tgetflag at NCURSES6_TINFO_5.0.19991023'
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `BC at NCURSES6_TINFO_5.0.19991023'
> >>>> /usr/bin/ld: /home/bagas/repo/buildroot/output/host/lib/libreadline.so: undefined reference to `tputs at NCURSES6_TINFO_5.0.19991023'
> >>>> collect2: error: ld returned 1 exit status
> >>>> make[3]: *** [Makefile:2232: gdb] Error 1
> >>>> ```
> >>>>
> >>>> Thanks.
> >>>>        
> >>>
> >>> Sorry, could not reproduce your failure...., did you make a complete
> >>>
> >>> 	$ make clean
> >>> 	$ make
> >>>
> >>> re-build after applying the patch/change?
> >>>      
> >>
> >> I can still reproduce the issue, unfortunately.
> >>
> >> (FYI: I encountered this on host-gdb.)  
> > 
> > One last try, does your buildroot git souce tree already contain this (recent) commmit?
> > 
> > 	From: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
> > 	Date: Fri, 29 Aug 2025 17:24:39 +0200
> > 	Subject: [PATCH] package/gdb: really fix build with GCC 15.x by using externalreadline
> > 
> > 	https://gitlab.com/buildroot.org/buildroot/-/commit/d98e15a3639d9758ab3223f0a6de3a94d506e6fa.patch
> >   
> 
> It's already in my tree.
> 
> Thanks.
> 

On my system:

        $ nm -A ./host/lib64/*.so | grep tputs at NCURSES6_TINFO_5.0.19991023
./host/lib64/libreadline.so:                 U tputs at NCURSES6_TINFO_5.0.19991023

        $ ldd ./host/lib64/libreadline.so
        linux-vdso.so.1 (0x00007f6e7f520000)
        libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f6e7f452000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f6e7f200000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6e7f522000)

With the following patch:

diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index 864f62b57c..a837ac96bf 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -162,7 +162,9 @@ HOST_NCURSES_CONF_OPTS = \
 	--without-ada \
 	--with-default-terminfo-dir=/usr/share/terminfo \
 	--disable-db-install \
-	--without-normal
+	--without-normal \
+	--with-termlib \
+	--disable-widec
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))


	$ ldd ./host/lib64/libreadline.so
	linux-vdso.so.1 (0x00007f1b32fd3000)
	libtinfo.so.6 => /home/seiderer/Work/Buildroot/build_aarch64_gdb_libreadline_001/host/lib/libtinfo.so.6 (0x00007f1b32f2a000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f1b32c00000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f1b32fd5000)

Regards,
Peter


More information about the buildroot mailing list