Discussion:
Linking gdb with -ltinfow, if libtinfo is not available
Дилян Палаузов
2018-12-05 07:22:56 UTC
Permalink
See https://sourceware.org/bugzilla/show_bug.cgi?id=23950 for details.

diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -592,7 +592,7 @@ case $host_os in
esac

# These are the libraries checked by Readline.
-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncursesw ncurses])
+AC_SEARCH_LIBS(tgetent, [termcap tinfo tinfow curses ncursesw
ncurses])

if test "$ac_cv_search_tgetent" = no; then
CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
Simon Marchi
2018-12-05 14:49:23 UTC
Permalink
Post by Дилян Палаузов
See https://sourceware.org/bugzilla/show_bug.cgi?id=23950 for details.
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -592,7 +592,7 @@ case $host_os in
esac
# These are the libraries checked by Readline.
-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncursesw ncurses])
+AC_SEARCH_LIBS(tgetent, [termcap tinfo tinfow curses ncursesw
ncurses])
if test "$ac_cv_search_tgetent" = no; then
CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
I am not able to test this (since all my systems have a libtinfo.so,
which gets picked up), but I think it makes sense. If you have a system
where the only ncurses available is configured with:

--with-termlib --with-shared --enable-widec

you end up with libtinfow.so and no libtinfo.so. Any objections? I can
take care of ChangeLog and commit message since it is a very small
change, but next time please make sure to follow the checklist [1].

Thanks,

Simon

[1] https://sourceware.org/gdb/wiki/ContributionChecklist
Дилян Палаузов
2018-12-05 16:41:56 UTC
Permalink
Hello,

you should be able to test this by having libtinfo.so in a directory,
that is not introduced to the linker by -L and is not default for the
compiller or linker and have libtinfow.so in а path passed by -L;
possibly moving libtinfo.so to a location that is still considered by
ldconfig.

Regards
Дилян
Post by Simon Marchi
Post by Дилян Палаузов
See https://sourceware.org/bugzilla/show_bug.cgi?id=23950 for details.
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -592,7 +592,7 @@ case $host_os in
esac
# These are the libraries checked by Readline.
-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncursesw ncurses])
+AC_SEARCH_LIBS(tgetent, [termcap tinfo tinfow curses ncursesw
ncurses])
if test "$ac_cv_search_tgetent" = no; then
CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
I am not able to test this (since all my systems have a libtinfo.so,
which gets picked up), but I think it makes sense. If you have a system
--with-termlib --with-shared --enable-widec
you end up with libtinfow.so and no libtinfo.so. Any objections? I can
take care of ChangeLog and commit message since it is a very small
change, but next time please make sure to follow the checklist [1].
Thanks,
Simon
[1] https://sourceware.org/gdb/wiki/ContributionChecklist
Simon Marchi
2018-12-05 19:59:18 UTC
Permalink
Post by Дилян Палаузов
Hello,
you should be able to test this by having libtinfo.so in a directory,
that is not introduced to the linker by -L and is not default for the
compiller or linker and have libtinfow.so in а path passed by -L;
possibly moving libtinfo.so to a location that is still considered by
ldconfig.
I tested this in a docker container, as to avoid messing up my system. I
deleted all traces of libtinfo.so, compiled and installed ncurses by hand with

--with-termlib --with-shared --enable-widec --prefix=/usr

which got me a libtinfow.so. I was then able to reproduce the linking
problem and confirm that your patch works (we just need to re-generate
configure).

So here's what I propose pushing. My cyrillic is not totally on point,
does your name look good in the ChangeLog entry below? Or would you
prefer to have a romanized version in there?


From 70670e00263468aa36dce313d2241b5f953596af Mon Sep 17 00:00:00 2001
From: Simon Marchi <***@ericsson.com>
Date: Wed, 5 Dec 2018 14:21:31 -0500
Subject: [PATCH] Look for tgetent in libtinfow
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On some systems where ncurses is only available in the "wide" version
(compiled with --with-widec), there might be no libtinfo.so, only a
libtinfow.so. Look for libtinfow in addition to libtinfo.

gdb/ChangeLog:

YYYY-MM-DD Simon Marchi <***@ericsson.com>
Дилян Палаузов <***@aegee.org>

PR gdb/23950
* configure.ac: Search for tgetent in libtinfow.
* configure: Re-generate.
---
gdb/configure | 2 +-
gdb/configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 7665ba65319..603c413fe8e 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -9027,7 +9027,7 @@ return tgetent ();
return 0;
}
_ACEOF
-for ac_lib in '' termcap tinfo curses ncursesw ncurses; do
+for ac_lib in '' termcap tinfow tinfo curses ncursesw ncurses; do
if test -z "$ac_lib"; then
ac_res="none required"
else
diff --git a/gdb/configure.ac b/gdb/configure.ac
index e1ea60660b9..b40c53a06cd 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -592,7 +592,7 @@ case $host_os in
esac

# These are the libraries checked by Readline.
-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncursesw ncurses])
+AC_SEARCH_LIBS(tgetent, [termcap tinfow tinfo curses ncursesw ncurses])

if test "$ac_cv_search_tgetent" = no; then
CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
-
Дилян Палаузов
2018-12-05 23:08:52 UTC
Permalink
Hello,

my name is spelled correctly.

A further test would to have libtermcap and no libtinfo.so on the -L
explicit and implicit paths.

Regards
Дилян
Post by Simon Marchi
Post by Дилян Палаузов
Hello,
you should be able to test this by having libtinfo.so in a directory,
that is not introduced to the linker by -L and is not default for the
compiller or linker and have libtinfow.so in а path passed by -L;
possibly moving libtinfo.so to a location that is still considered by
ldconfig.
I tested this in a docker container, as to avoid messing up my system. I
deleted all traces of libtinfo.so, compiled and installed ncurses by hand with
--with-termlib --with-shared --enable-widec --prefix=/usr
which got me a libtinfow.so. I was then able to reproduce the linking
problem and confirm that your patch works (we just need to re-generate
configure).
So here's what I propose pushing. My cyrillic is not totally on point,
does your name look good in the ChangeLog entry below? Or would you
prefer to have a romanized version in there?
From 70670e00263468aa36dce313d2241b5f953596af Mon Sep 17 00:00:00 2001
Date: Wed, 5 Dec 2018 14:21:31 -0500
Subject: [PATCH] Look for tgetent in libtinfow
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On some systems where ncurses is only available in the "wide" version
(compiled with --with-widec), there might be no libtinfo.so, only a
libtinfow.so. Look for libtinfow in addition to libtinfo.
PR gdb/23950
* configure.ac: Search for tgetent in libtinfow.
* configure: Re-generate.
---
gdb/configure | 2 +-
gdb/configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/configure b/gdb/configure
index 7665ba65319..603c413fe8e 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -9027,7 +9027,7 @@ return tgetent ();
return 0;
}
_ACEOF
-for ac_lib in '' termcap tinfo curses ncursesw ncurses; do
+for ac_lib in '' termcap tinfow tinfo curses ncursesw ncurses; do
if test -z "$ac_lib"; then
ac_res="none required"
else
diff --git a/gdb/configure.ac b/gdb/configure.ac
index e1ea60660b9..b40c53a06cd 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -592,7 +592,7 @@ case $host_os in
esac
# These are the libraries checked by Readline.
-AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncursesw ncurses])
+AC_SEARCH_LIBS(tgetent, [termcap tinfow tinfo curses ncursesw ncurses])
if test "$ac_cv_search_tgetent" = no; then
CONFIG_OBS="$CONFIG_OBS stub-termcap.o"
--
2.19.2
Loading...