tech-toolchain archive

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

Re: mknative-gdb: curses detection failure ... TUI disabled



On Tue, Dec 14, 2010 at 12:07:30AM +0100, Nicolas Joly wrote:
> 
> Hi,
> 
> While trying to add support for 32bit objects in gdb(1) on my -current
> amd64 workstation, i had to run mknative-gdb tool. But i noticed that
> generated init.c file had all _initialize_tui_* symbols removed
> 
> The problem comes from the gdb/configure script that now fails to detect
> the curses library :
> 
> configure:8145: /local/src/NetBSD/tool/bin/x86_64--netbsd-gcc -isystem 
> /local/src/NetBSD/dest/amd64/usr/include -L/local/src/NetBSD/dest/amd64/lib 
> -L/local/src/NetBSD/dest/amd64/usr/lib 
> -B/local/src/NetBSD/dest/amd64/usr/lib/ -o conftest    conftest.c -lcurses  
> -lm  >&5
> /local/src/NetBSD/tool/lib/gcc/x86_64--netbsd/4.1.3/../../../../x86_64--netbsd/bin/ld:
>  warning: libterminfo.so.1, needed by 
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so, not found (try using 
> -rpath or -rpath-link)
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so: undefined reference to 
> `del_curterm'
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so: undefined reference to 
> `ti_setupterm'
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so: undefined reference to 
> `t_vparm'
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so: undefined reference to 
> `vtparm'
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so: undefined reference to 
> `tputs'
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so: undefined reference to 
> `ti_puts'
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so: undefined reference to 
> `cur_term'
> /local/src/NetBSD/dest/amd64/usr/lib/libcurses.so: undefined reference to 
> `set_curterm'
> collect2: ld returned 1 exit status
> configure:8151: $? = 1

For the record, this is a ld(1) problem which does not deals nicely
with implicit libraries dependencies ... unless they exists in the
default location (-L flag has no effect).

And on -current libcurses.so now depends on libterminfo.so, which
works fine with a native compiler/linker, but fails when
cross-compiling where cross-linker set default location to
${TOOLDIR}/x86_64--netbsd/lib

The attached patch, which i plan to commit, works around the curses
detection problem by setting the expected result for waddstr()
configure tests, in MKNATIVE_CONFIGURE_PRESET.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
Index: tools/gdb/Makefile
===================================================================
RCS file: /cvsroot/src/tools/gdb/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- tools/gdb/Makefile  8 May 2010 23:18:44 -0000       1.17
+++ tools/gdb/Makefile  20 Dec 2010 14:23:07 -0000
@@ -28,6 +28,7 @@ MKNATIVE_CONFIGURE_PRESET= \
        ac_cv_prog_cc_cross=yes \
        ac_cv_func_fork_works=yes \
        ac_cv_func_strcoll_works=yes \
+       ac_cv_search_waddstr="-lcurses -lterminfo" \
        bash_cv_func_ctype_nonascii=yes \
        bash_cv_func_sigsetjmp=present \
        bash_cv_func_strcoll_broken=no \


Home | Main Index | Thread Index | Old Index