Package: frogatto
Version: 1.1+dfsg-4
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric

frogatto fails to build with a linker that defaults to --as-needed, as
shown in this Ubuntu bug report (see comment #1):

  https://bugs.launchpad.net/ubuntu/+source/frogatto/+bug/771073

This is because of incorrect link ordering: it puts libraries before the
objects that use them rather than after.  See:

  http://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries

The following patch fixes this.

  * Fix link order to list libraries after the objects that require them.

diff -Nru frogatto-1.1+dfsg/debian/patches/link-order.patch 
frogatto-1.1+dfsg/debian/patches/link-order.patch
--- frogatto-1.1+dfsg/debian/patches/link-order.patch   1970-01-01 
01:00:00.000000000 +0100
+++ frogatto-1.1+dfsg/debian/patches/link-order.patch   2011-09-14 
12:49:02.000000000 +0100
@@ -0,0 +1,40 @@
+Description: List libraries after the objects that require them
+Author: Colin Watson <cjwat...@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/771073
+Forwarded: no
+Last-Update: 2011-09-14
+
+Index: b/Makefile
+===================================================================
+--- a/Makefile
++++ b/Makefile
+@@ -16,10 +16,10 @@
+       $(CXX) -DIMPLEMENT_SAVE_PNG -fno-inline-functions -g $(OPT) `sdl-config 
--cflags` -D_GNU_SOURCE=1 -D_REENTRANT -Wnon-virtual-dtor -Wreturn-type 
-fthreadsafe-statics -c $<
+ 
+ game: $(objects)
+-      $(CXX) -g $(OPT) -L. -L/sw/lib -L. -D_GNU_SOURCE=1 -D_REENTRANT 
-Wnon-virtual-dtor -Wreturn-type -L/usr/lib `sdl-config --libs` -lSDLmain -lSDL 
-lGL -lGLU -lGLEW -lSDL_image -lSDL_ttf -lSDL_mixer -lpng -lboost_regex-mt 
-lboost_system-mt -lpthread -fthreadsafe-statics $(objects) -o game
++      $(CXX) -g $(OPT) -L. -L/sw/lib -L. -D_GNU_SOURCE=1 -D_REENTRANT 
-Wnon-virtual-dtor -Wreturn-type $(objects) -L/usr/lib `sdl-config --libs` 
-lSDLmain -lSDL -lGL -lGLU -lGLEW -lSDL_image -lSDL_ttf -lSDL_mixer -lpng 
-lboost_regex-mt -lboost_system-mt -lpthread -fthreadsafe-statics -o game
+ 
+ server: $(server_objects)
+-      $(CXX) -fno-inline-functions -g $(OPT) -L/sw/lib -D_GNU_SOURCE=1 
-D_REENTRANT -Wnon-virtual-dtor -Wreturn-type -L/usr/lib `sdl-config --libs` 
-lSDLmain -lSDL -lGL -lGLU -lSDL_image -lSDL_ttf -lSDL_mixer -lboost_regex-mt 
-lboost_system-mt -lboost_thread-mt -lboost_iostreams-mt -fthreadsafe-statics 
$(server_objects) -o server
++      $(CXX) -fno-inline-functions -g $(OPT) -L/sw/lib -D_GNU_SOURCE=1 
-D_REENTRANT -Wnon-virtual-dtor -Wreturn-type $(server_objects) -L/usr/lib 
`sdl-config --libs` -lSDLmain -lSDL -lGL -lGLU -lSDL_image -lSDL_ttf 
-lSDL_mixer -lboost_regex-mt -lboost_system-mt -lboost_thread-mt 
-lboost_iostreams-mt -fthreadsafe-statics -o server
+ 
+ poolalloc.o: src/poolalloc.c
+       $(CC) -fno-inline-functions -g $(OPT) `sdl-config --cflags` 
-D_GNU_SOURCE=1 -D_REENTRANT -Wreturn-type -c src/poolalloc.c
+@@ -28,13 +28,13 @@
+       $(CC) -fno-inline-functions -g $(OPT) `sdl-config --cflags` 
-D_GNU_SOURCE=1 -D_REENTRANT -DUSE_LOCKS=1 -Wreturn-type -c src/malloc.c
+ 
+ formula_test: $(formula_test_objects)
+-      $(CXX) -O2 -g -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT 
-DUNIT_TEST_FORMULA -Wnon-virtual-dtor -Wreturn-type -L/usr/lib -lSDL -lGL 
-lGLU -lSDL_image -lSDL_ttf -lSDL_mixer -lboost_regex src/formula.cpp 
$(formula_test_objects) -o test
++      $(CXX) -O2 -g -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT 
-DUNIT_TEST_FORMULA -Wnon-virtual-dtor -Wreturn-type src/formula.cpp 
$(formula_test_objects) -L/usr/lib -lSDL -lGL -lGLU -lSDL_image -lSDL_ttf 
-lSDL_mixer -lboost_regex -o test
+ 
+ wml_modify_test: $(wml_modify_test_objects)
+-      $(CXX) -O2 -g -framework Cocoa -I/usr/local/include/boost-1_34 
-I/sw/include/SDL -Isrc/ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT 
-DUNIT_TEST_WML_MODIFY -Wnon-virtual-dtor -Wreturn-type -L/usr/lib 
-lboost_regex src/wml_modify.cpp $(wml_modify_test_objects) -o test
++      $(CXX) -O2 -g -framework Cocoa -I/usr/local/include/boost-1_34 
-I/sw/include/SDL -Isrc/ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT 
-DUNIT_TEST_WML_MODIFY -Wnon-virtual-dtor -Wreturn-type src/wml_modify.cpp 
$(wml_modify_test_objects) -L/usr/lib -lboost_regex -o test
+ 
+ wml_schema_test: $(wml_schema_test_objects)
+-      $(CXX) -O2 -g -framework Cocoa -I/usr/local/include/boost-1_34 
-I/sw/include/SDL -Isrc/ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT 
-DUNIT_TEST_WML_SCHEMA -Wnon-virtual-dtor -Wreturn-type -L/usr/lib 
-lboost_regex src/wml_schema.cpp $(wml_schema_test_objects) -o test
++      $(CXX) -O2 -g -framework Cocoa -I/usr/local/include/boost-1_34 
-I/sw/include/SDL -Isrc/ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT 
-DUNIT_TEST_WML_SCHEMA -Wnon-virtual-dtor -Wreturn-type src/wml_schema.cpp 
$(wml_schema_test_objects) -L/usr/lib -lboost_regex -o test
+ 
+ update-pot:
+       utils/make-pot.sh > po/frogatto.pot
diff -Nru frogatto-1.1+dfsg/debian/patches/series 
frogatto-1.1+dfsg/debian/patches/series
--- frogatto-1.1+dfsg/debian/patches/series     2011-06-19 14:21:06.000000000 
+0100
+++ frogatto-1.1+dfsg/debian/patches/series     2011-09-14 12:45:37.000000000 
+0100
@@ -1 +1,2 @@
 disable-ccache.patch
+link-order.patch

-- 
Colin Watson                                       [cjwat...@ubuntu.com]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to