Package: celestia Version: 1.6.1+dfsg-2 Severity: important Tags: patch User: peter.fritzs...@gmx.de Usertags: no-add-needed
celestia fails to build with ld --no-add-needed (or --no-copy-dt-needed): /usr/bin/ld: ../celengine/libcelengine.a(libcelengine_a-render.o): undefined reference to symbol 'glDepthFunc' /usr/bin/ld: note: 'glDepthFunc' is defined in DSO /usr/lib/i386-linux-gnu/mesa/libGL.so.1 so try adding it to the linker command line /usr/lib/i386-linux-gnu/mesa/libGL.so.1: could not read symbols: Invalid operation https://launchpadlibrarian.net/135887636/buildlog_ubuntu-raring-i386.celestia_1.6.1%2Bdfsg-2ubuntu1_FAILEDTOBUILD.txt.gz debian uses this ld flag too, but due to a bug it only triggers with binutils in experimental. Attached a patch to fix the issue. Additionally it also fails with ld --as-needed which is only used in ubuntu, another patch is attached for that too. The issue is that libraries must be placed behind objects needing their symbols with this flag. Thanks for considering the patches.
--- a/src/celestia/Makefile.am +++ b/src/celestia/Makefile.am @@ -88,7 +88,8 @@ celestia_LDADD = \ ../cel3ds/libcel3ds.a \ ../celmath/libcelmath.a \ ../celutil/libcelutil.a \ - $(SPICE_LIBS) + $(SPICE_LIBS) \ + $(GL_LIBS) noinst_HEADERS = $(wildcard *.h) noinst_DATA = ../../celestia --- a/src/celestia/Makefile.in +++ b/src/celestia/Makefile.in @@ -538,7 +538,8 @@ celestia_LDADD = \ ../cel3ds/libcel3ds.a \ ../celmath/libcelmath.a \ ../celutil/libcelutil.a \ - $(SPICE_LIBS) + $(SPICE_LIBS) \ + $(GL_LIBS) noinst_HEADERS = $(wildcard *.h) noinst_DATA = ../../celestia
Index: celestia-1.6.1+dfsg/src/celestia/Makefile.am =================================================================== --- celestia-1.6.1+dfsg.orig/src/celestia/Makefile.am 2011-06-05 18:11:13.000000000 +0200 +++ celestia-1.6.1+dfsg/src/celestia/Makefile.am 2012-05-27 12:11:36.000000000 +0200 @@ -7,14 +7,14 @@ if ENABLE_KDE SUBDIRS += kde -celestiaKDELIBS = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) \ - $(LIBSOCKET) -lDCOP kde/libkdegui.a +celestiaKDELIBS = kde/libkdegui.a $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) \ + $(LIB_KFILE) $(LIBSOCKET) -lDCOP celestia_LDFLAGS = $(all_libraries) $(KDE_RPATH) endif if ENABLE_GTK SUBDIRS += gtk -celestiaGTKLIBS = $(GTK_LIBS) gtk/libgtkgui.a +celestiaGTKLIBS = gtk/libgtkgui.a $(GTK_LIBS) endif COMMONSOURCES = \ Index: celestia-1.6.1+dfsg/src/celestia/Makefile.in =================================================================== --- celestia-1.6.1+dfsg.orig/src/celestia/Makefile.in 2011-06-05 20:34:28.000000000 +0200 +++ celestia-1.6.1+dfsg/src/celestia/Makefile.in 2012-05-27 12:13:35.000000000 +0200 @@ -473,11 +473,11 @@ xdg_menudir = @xdg_menudir@ SUBDIRS = res $(am__append_1) $(am__append_2) INCLUDES = -I.. -@ENABLE_KDE_TRUE@celestiaKDELIBS = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) \ -@ENABLE_KDE_TRUE@ $(LIBSOCKET) -lDCOP kde/libkdegui.a +@ENABLE_KDE_TRUE@celestiaKDELIBS = kde/libkdegui.a $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) \ +@ENABLE_KDE_TRUE@ $(LIB_KFILE) $(LIBSOCKET) -lDCOP @ENABLE_KDE_TRUE@celestia_LDFLAGS = $(all_libraries) $(KDE_RPATH) -@ENABLE_GTK_TRUE@celestiaGTKLIBS = $(GTK_LIBS) gtk/libgtkgui.a +@ENABLE_GTK_TRUE@celestiaGTKLIBS = gtk/libgtkgui.a $(GTK_LIBS) COMMONSOURCES = \ celestiacore.cpp \ configfile.cpp \