[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-readline] Linking Shared libreadline with(out) TERMCAP_LIB

From: Дилян Палаузов
Subject: [Bug-readline] Linking Shared libreadline with(out) TERMCAP_LIB
Date: Fri, 11 Apr 2014 22:11:31 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0


when I do ./configure --with-curses the TERMCAP_LIB Makefile variable is filled with -lcurses, and when I do ./configure --without-curses, TERMCAP_LIB is -ltermcap .

In terms of support/shobj-conf, my system is "linux-gnu-gcc-unknown", so the case "linux*-*|gnu*-*|k*bsd*-gnu-*|freebsd*-gentoo" on line 127 is called.

My SHLIB_LIBS is empty, because only on cygwin* and mingw* TERMCAP_LIB is added to SHLIB_LIBS .

In shlib/Makefile lines 175-182 the same linker parameters are used to link with libhistory and libreadline . To my understanding, libhistory does not need TERMCAP_LIB, as the latter does not contain symbols libhistory needs, but despite of this, on mingw and cygwin, shlib/libhistory is linked with $TERM_CAP.

On the other side, under Linux, shlib/libreadline is liked with:

$(CC) -shared -Wl,-soname,libreadline.so.6.3 -L/usr/lib -L/lib -Wl,-rpath,/usr/lib -Wl,-soname,libreadline.so.6 -o libreadline.so.6.3 readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so misc.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so colors.so parse-colors.so xmalloc.so xfree.so compat.so

-> without passing TERMCAP_LIB, which leads to undefined symbols:

nm shlib/libreadline.so.6.3 | grep " U " | grep -v GLIBC

                 U BC
                 U PC
                 U tgetent
                 U tgetflag
                 U tgetnum
                 U tgetstr
                 U tgoto
                 U tputs
                 U UP

(I intentionally don't use "nm -D" as this would delete the @GLIB marker and hence I cannot filter).

Is there any reason, why TERMCAP_LIB is passed to the static linker (in /Makefile, line 184), but not to the shared linker?

Please add to support/shobj-conf:

--- support/shobj-conf  2014-04-11 19:58:26.385241268 +0000
+++ support/shobj-conf.orig      2014-04-11 19:57:31.815241203 +0000
@@ -130,7 +130,6 @@

SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'


Another approach is to have different shared linking parameters for libreadline and libhistory (with and without TERMCAP_LIB / -lcurses), by adding TERMCAP_LIB to the end of shlib/Makefile(.in) line 177. But choosing this approach I see no reason to continue adding TERMCAP_LIB to SHLIB_LIBS on MinGW and Cygwin.

Kind regards

reply via email to

[Prev in Thread] Current Thread [Next in Thread]