[Debian GNUstep maintainers] Bug#633556: lusernet.app: FTBFS with ld that defaults to --as-needed: undefined reference to `__objc_class_name_CWCharset'

Colin Watson cjwatson at ubuntu.com
Mon Jul 11 14:42:38 UTC 2011


Package: lusernet.app
Version: 0.4.2-6
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric

I noticed that somebody had synced the base GNUstep packages from
experimental into Ubuntu oneiric, so I started work on rebuilding all
the application packages against that new version so that we can drop
the older library versions.  lusernet.app failed to build as follows:

  https://launchpadlibrarian.net/74974344/buildlog_ubuntu-oneiric-i386.lusernet.app_0.4.2-6build2_FAILEDTOBUILD.txt.gz

  gcc  -rdynamic -lPantomime    -Wl,-z,defs -Wl,--as-needed -shared-libgcc -fexceptions -fgnu-runtime -o LuserNET.app/./LuserNET \
          ./obj/LuserNET.obj/NNTPServer.m.o ./obj/LuserNET.obj/MsgDB.m.o ./obj/LuserNET.obj/NNTPSource.m.o ./obj/LuserNET.obj/KeyWindow.m.o ./obj/LuserNET.obj/NNTPSourceGUI.m.o ./obj/LuserNET.obj/main.m.o ./obj/LuserNET.obj/main_prefs.m.o ./obj/LuserNET.obj/FolderListController.m.o ./obj/LuserNET.obj/FolderWindowController.m.o ./obj/LuserNET.obj/FolderThreader.m.o ./obj/LuserNET.obj/LogWindowController.m.o ./obj/LuserNET.obj/MessageViewController.m.o ./obj/LuserNET.obj/ComposeWindowController.m.o ./obj/LuserNET.obj/PreferencesWindowController.m.o ./obj/LuserNET.obj/Pref_Sources.m.o ./obj/LuserNET.obj/Pref_MessageViewing.m.o ./obj/LuserNET.obj/Pref_ReadAhead.m.o ./obj/LuserNET.obj/Pref_Posting.m.o ./obj/LuserNET.obj/autokeyviewchain.m.o      -L/usr/local/lib -L/usr/lib     -lgnustep-gui    -lgnustep-base   -lpthread -lobjc   -lm
  ./obj/LuserNET.obj/main.m.o:(.data.rel+0x1c): undefined reference to `__objc_class_name_CWCharset'
  ./obj/LuserNET.obj/FolderThreader.m.o:(.data.rel+0x4): undefined reference to `__objc_class_name_CWMIMEUtility'
  ./obj/LuserNET.obj/MessageViewController.m.o:(.data.rel+0x14): undefined reference to `__objc_class_name_CWUUFile'
  ./obj/LuserNET.obj/MessageViewController.m.o:(.data.rel+0x18): undefined reference to `__objc_class_name_CWMessage'
  ./obj/LuserNET.obj/MessageViewController.m.o:(.data.rel+0x20): undefined reference to `__objc_class_name_CWPart'
  ./obj/LuserNET.obj/MessageViewController.m.o:(.data.rel+0x28): undefined reference to `__objc_class_name_CWMIMEMultipart'
  ./obj/LuserNET.obj/ComposeWindowController.m.o:(.data.rel+0x3c): undefined reference to `__objc_class_name_CWInternetAddress'
  ./obj/LuserNET.obj/ComposeWindowController.m.o:(.data.rel+0x44): undefined reference to `__objc_class_name_CWMessage'
  ./obj/LuserNET.obj/Pref_MessageViewing.m.o:(.data.rel+0xc): undefined reference to `__objc_class_name_CWCharset'

It appears that link-libs.patch needs to be extended to cover this;
-lPantomime is clearly in the wrong place on the link line for
--as-needed (http://wiki.debian.org/ToolChain/DSOLinking).  This
probably doesn't affect Debian right now because --as-needed is a
positional option and only affects those libraries listed after it, but
Ubuntu's linker defaults to --as-needed right out of the gate.
Nevertheless, I believe that the debian-gcc team is tracking these
problems and wants to make Debian packages work cleanly with such a
linker.

Here's a patch.  Does it seem like a reasonable approach?

  * debian/patches/30_link_order.dpatch: Fix link order with 'ld
    --as-needed'.

diff -u lusernet.app-0.4.2/debian/patches/00list lusernet.app-0.4.2/debian/patches/00list
--- lusernet.app-0.4.2/debian/patches/00list
+++ lusernet.app-0.4.2/debian/patches/00list
@@ -4,0 +5,1 @@
+30_link_order
only in patch2:
unchanged:
--- lusernet.app-0.4.2.orig/debian/patches/30_link_order.dpatch
+++ lusernet.app-0.4.2/debian/patches/30_link_order.dpatch
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 30_link_order.dpatch by Colin Watson <cjwatson at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Put -lPantomime in LuserNET_GUI_LIBS rather than LuserNET_LDFLAGS,
+## DP: fixing build with 'ld --as-needed'.
+
+ at DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lusernet.app~/GNUmakefile lusernet.app/GNUmakefile
+--- lusernet.app~/GNUmakefile	2011-07-11 15:36:05.000000000 +0100
++++ lusernet.app/GNUmakefile	2011-07-11 15:36:12.000000000 +0100
+@@ -44,7 +44,7 @@
+ 
+ MAKE_STRINGS_OPTIONS = --aggressive-match --aggressive-remove
+ 
+-LuserNET_LDFLAGS += -lPantomime
++LuserNET_GUI_LIBS += -lPantomime
+ #-lMime
+ 
+ include $(GNUSTEP_MAKEFILES)/application.make

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the pkg-GNUstep-maintainers mailing list