[Debian-med-packaging] Bug#647401: sitplus: FTBFS with ld --as-needed

Ilya Barygin randomaction at ubuntu.com
Wed Nov 2 10:58:22 UTC 2011


Package: sitplus
Version: 1.0.1-1
Severity: normal
Tags: upstream patch
User: debian-gcc at lists.debian.org
Usertags: ld-as-needed

sitplus fails to build when --as-needed linker option is enabled,
because of incorrect order of parameters passed to ld. Here's a log of
failed build in Ubuntu:
https://launchpad.net/ubuntu/+source/sitplus/1.0.1-1/+build/2865320/+files/buildlog_ubuntu-precise-i386.sitplus_1.0.1-1_FAILEDTOBUILD.txt.gz

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

The attached patch was used in Ubuntu to fix the problem.
https://launchpad.net/ubuntu/+source/sitplus/1.0.1-1ubuntu1

-- System Information:
Debian Release: wheezy/sid
  APT prefers oneiric-updates
  APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500, 'oneiric-proposed'), (500, 'oneiric'), (100, 'oneiric-backports')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-13-generic (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
-------------- next part --------------
Description: fix underlinked library libsphost.a
 This allows building with --as-needed linker option.
Author: Ilya Barygin <randomaction at ubuntu.com>

--- sitplus-1.0.1.orig/src/sphost/CMakeLists.txt
+++ sitplus-1.0.1/src/sphost/CMakeLists.txt
@@ -22,6 +22,7 @@
 target_link_libraries(sphost widgets_base)
 target_link_libraries(sphost ${Boost_FILESYSTEM_LIBRARY})
 target_link_libraries(sphost ${Boost_THREAD_LIBRARY})
+target_link_libraries(sphost ${Boost_SYSTEM_LIBRARY})
 
 if (ENABLE_NLS)
 	target_link_libraries(sphost ${LIBINTL_LIBRARIES})
--- sitplus-1.0.1.orig/CMakeLists.txt
+++ sitplus-1.0.1/CMakeLists.txt
@@ -129,9 +129,11 @@ set(Boost_USE_MULTITHREAD ON)
 
 find_package(Boost COMPONENTS thread REQUIRED)
 find_package(Boost COMPONENTS program_options REQUIRED)
+find_package(Boost COMPONENTS system REQUIRED)
 message(STATUS "Boost_INCLUDE_DIR    : ${Boost_INCLUDE_DIR}")
 message(STATUS "Boost_THREAD_LIBRARY : ${Boost_THREAD_LIBRARY}")
 message(STATUS "Boost_PROGRAM_OPTIONS_LIBRARY : ${Boost_PROGRAM_OPTIONS_LIBRARY}")
+message(STATUS "Boost_SYSTEM_LIBRARY : ${Boost_SYSTEM_LIBRARY}")
 
 # Boost version 1.39 or greater required 
 # Lower versions fail to compile with g++ 4.4


More information about the Debian-med-packaging mailing list