Package: tintii
Version: 2.2.3-4
Severity: normal
Tags: patch
User: debian-...@lists.debian.org
Usertags: ld-as-needed

The package 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://launchpadlibrarian.net/71522147/buildlog_ubuntu-oneiric-i386.tintii_2.2.3-4_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/tintii/2.2.3-4ubuntu1

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

Kernel: Linux 2.6.38-10-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Description: Fix build problem with --as-needed linker option:
 - use proper method to set compiler/linker parameters
 - also link with -lgomp
Author: Ilya Barygin <bary...@gmail.com>
Bug-Ubuntu: https://launchpad.net/bugs/803206
--- tintii-2.2.3.orig/config.py
+++ tintii-2.2.3/config.py
@@ -12,7 +12,8 @@
 
 # Linux/g++ compiler options
 CXX='g++'
-CXXFLAGS='-O3 -Wall -funroll-loops -fomit-frame-pointer `wx-config --cxxflags` 
-fopenmp -ffast-math'
-LINKFLAGS='`wx-config --libs` `wx-config --libs aui` -fopenmp'
+CXXFLAGS='-O3 -Wall -funroll-loops -fomit-frame-pointer -fopenmp -ffast-math'
+LINKFLAGS='-fopenmp'
+LIBS='gomp'
 NDEBUG='yes'
 
--- tintii-2.2.3.orig/SConstruct
+++ tintii-2.2.3/SConstruct
@@ -21,8 +21,11 @@ opts.AddVariables(PathVariable('PREFIX',
                   ('CXX', 'C++ compiler'),
                   ('CXXFLAGS', 'C++ compiler flags'),
                   ('LINKFLAGS', 'Linker flags'),
+                  ('LIBS', 'Libraries'),
                )
 opts.Update(env)
+env.ParseConfig('wx-config --cxxflags --libs')
+env.ParseConfig('wx-config --libs aui')
 if env['NDEBUG']:
   env.Append(CPPDEFINES = 'NDEBUG')
 

Reply via email to