Package: osmium
Version: 0.0~20111114-ga147fb1-1
Severity: wishlist
User: debian-...@lists.debian.org
Usertags: ld-as-needed
Tags: patch

osmium fails to build with ld --as-needed.
This is caused by wrong placement of libraries on the commandline.
Libraries must be placed behind the objects needing their symbols when
building with --as-needed
See the buildlog in ubuntu:
https://launchpadlibrarian.net/89413757/buildlog_ubuntu-precise-i386.osmium_0.0~20111114-ga147fb1-1_FAILEDTOBUILD.txt.gz

attached a patch that fixes the issue.
Description: fix build with ld --as-needed
 libraries must be placed after objects needing their symbols
Author: Julian Taylor <jtay...@ubuntu.com>

--- a/test/run_tests.sh
+++ b/test/run_tests.sh
@@ -13,7 +13,8 @@
 
 CXX="g++"
 CXXFLAGS="-g -Wall -Wextra -Wredundant-decls -Wdisabled-optimization -pedantic -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo"
-COMPILE="$CXX -I../include -I. $CXXFLAGS -lboost_unit_test_framework -o tests test_utils.cpp"
+LIBADD="-lboost_unit_test_framework"
+COMPILE="$CXX -I../include -I. $CXXFLAGS -o tests test_utils.cpp"
 
 if [ "x$1" = "x-v" ]; then
     VALGRIND="valgrind --leak-check=full --show-reachable=yes"
@@ -30,8 +31,8 @@
         echo "\nTesting group $GROUP...\n"
         . $DIR/setup.sh
         FILES="test_main.cpp $DIR/*/test_*.cpp"
-        echo $COMPILE $FLAGS $FILES
-        $COMPILE $FLAGS $FILES
+        echo $COMPILE $FLAGS $FILES $LIBS $LIBADD
+        $COMPILE $FLAGS $FILES $LIBS $LIBADD
         $VALGRIND ./tests
     done
 else
@@ -41,14 +42,14 @@
     if [ "x$2" = "x" ]; then
         echo "\nTesting group $GROUP...\n"
         FILES="test_main.cpp $DIR/*/test_*.cpp"
-        echo $COMPILE $FLAGS $FILES
-        $COMPILE $FLAGS $FILES
+        echo $COMPILE $FLAGS $FILES $LIBS $LIBADD
+        $COMPILE $FLAGS $FILES $LIBS $LIBADD
         $VALGRIND ./tests
     else
         echo "\nTesting file $2 in group $GROUP...\n"
         FILES="-DSTAND_ALONE $DIR/$2"
-        echo $COMPILE $FLAGS $FILES
-        $COMPILE $FLAGS $FILES
+        echo $COMPILE $FLAGS $FILES $LIBS $LIBADD
+        $COMPILE $FLAGS $FILES $LIBS $LIBADD
         $VALGRIND ./tests
     fi
 fi
--- a/test/testgroup_geos/setup.sh
+++ b/test/testgroup_geos/setup.sh
@@ -1 +1,2 @@
 FLAGS="-DOSMIUM_WITH_GEOS `geos-config --cflags` `geos-config --libs`"
+LIBS="-DOSMIUM_WITH_GEOS `geos-config --libs`"
--- a/test/testgroup_ogr/setup.sh
+++ b/test/testgroup_ogr/setup.sh
@@ -1 +1,2 @@
-FLAGS="-DOSMIUM_WITH_OGR `gdal-config --cflags` `gdal-config --libs`"
+FLAGS="-DOSMIUM_WITH_OGR `gdal-config --cflags`"
+LIBS="-DOSMIUM_WITH_OGR `gdal-config --libs`"
--- a/test/testgroup_plain/setup.sh
+++ b/test/testgroup_plain/setup.sh
@@ -1 +1 @@
-FLAGS=""
+FLAGS="`gdal-config --cflags`"

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Pkg-osm-maint mailing list
Pkg-osm-maint@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-osm-maint

Reply via email to