Package: newt
Version: 0.52.11-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch natty

When building with a linker that defaults to --no-add-needed (see
http://wiki.debian.org/ToolChain/DSOLinking), newt fails to build as
follows:

  gcc -g -o test test.o libnewt.a -lslang
  libnewt.a(form.o): In function `Gpm_Open':
  /home/cjwatson/newt-0.52.11/build-tree/newt-0.52.11/form.c:231: warning: the 
use of `tempnam' is dangerous, better use `mkstemp'
  /usr/bin/ld: libnewt.a(newt.o): undefined reference to symbol 
'dlopen@@GLIBC_2.1'
  /usr/bin/ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /lib/libdl.so.2 so 
try adding it to the linker command line
  /lib/libdl.so.2: could not read symbols: Invalid operation
  collect2: ld returned 1 exit status
  make[1]: *** [test] Error 1

The bidi patch uses dlopen directly, and so libnewt.so and any programs
linked against libnewt.a need to link with -ldl directly as well.  Patch
attached.

Thanks,

-- 
Colin Watson                                       [[email protected]]
  * 020_bidi.patch: Link with -ldl for dlopen, so that we work properly with
    GCC versions that default to --no-add-needed.

diff -u newt-0.52.11/debian/patches/020_bidi.patch newt-0.52.11/debian/patches/020_bidi.patch
--- newt-0.52.11/debian/patches/020_bidi.patch
+++ newt-0.52.11/debian/patches/020_bidi.patch
@@ -1,3 +1,12 @@
+diff -ruN newt-0.52.11-old/Makefile.in newt-0.52.11/Makefile.in
+--- newt-0.52.11-old/Makefile.in	2010-10-15 16:02:24.000000000 +0100
++++ newt-0.52.11/Makefile.in	2010-10-15 16:05:45.000000000 +0100
+@@ -1,4 +1,4 @@
+-LIBS = -lslang
++LIBS = -lslang @LIBS@
+ LIBTCL = -ltcl8.4
+ 
+ CC = @CC@
 diff -ruN newt-0.52.11-old/button.c newt-0.52.11/button.c
 --- newt-0.52.11-old/button.c	2009-09-24 16:03:09.000000000 +0100
 +++ newt-0.52.11/button.c	2010-06-21 13:12:53.000000000 +0100
@@ -62,12 +71,14 @@
 diff -ruN newt-0.52.11-old/configure.ac newt-0.52.11/configure.ac
 --- newt-0.52.11-old/configure.ac	2009-09-24 16:03:09.000000000 +0100
 +++ newt-0.52.11/configure.ac	2010-06-21 13:12:53.000000000 +0100
-@@ -14,7 +14,7 @@
+@@ -14,7 +14,9 @@
  AC_PROG_INSTALL
  AC_PROG_LN_S
  
 -AC_CHECK_HEADERS([sys/select.h alloca.h])
 +AC_CHECK_HEADERS(sys/select.h alloca.h fribidi/fribidi.h dlfcn.h)
++AC_SEARCH_LIBS([dlopen], [dl])
++AC_SUBST([LIBS])
  
  AC_MSG_CHECKING([for python versions])
  PYTHONVERS=$(echo /usr/include/python*/Python.h | sed "s|/usr/include/||g"| sed "s|/Python.h||g" 2> /dev/null)

Reply via email to