Bug#651672: code-saturne: FTBFS with ld --as-needed
Ilya Barygin
randomaction at ubuntu.com
Sun Dec 11 10:52:29 UTC 2011
Package: code-saturne
Version: 2.1.0-3
Severity: normal
Tags: upstream patch
User: debian-gcc at lists.debian.org
Usertags: ld-as-needed
code-saturne 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/code-saturne/2.1.0-3/+build/2985556/+files/buildlog_ubuntu-precise-i386.code-saturne_2.1.0-3_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/code-saturne/2.1.0-3ubuntu1
-- 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-14-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 FTBFS with ld --as-needed option
-lm should be added to LDADD, not LDFLAGS. This way it's put after object
files when invoking linker
Author: Ilya Barygin <randomaction at ubuntu.com>
--- code-saturne-2.1.0.orig/src/apps/Makefile.am
+++ code-saturne-2.1.0/src/apps/Makefile.am
@@ -147,10 +147,10 @@ cs_check_syntax_CPPFLAGS = \
cs_check_syntax_SOURCES = cs_check_syntax.c
cs_check_syntax_LDADD = \
$(top_builddir)/src/mei/libmei.la \
-$(top_builddir)/src/bft/libbft.la
-cs_check_syntax_LDFLAGS = \
-$(ORIGINRUNPATH) \
+$(top_builddir)/src/bft/libbft.la \
-lm
+cs_check_syntax_LDFLAGS = \
+$(ORIGINRUNPATH)
endif
--- code-saturne-2.1.0.orig/src/apps/Makefile.in
+++ code-saturne-2.1.0/src/apps/Makefile.in
@@ -637,11 +637,11 @@ $(FCLIBS)
@HAVE_FRONTEND_TRUE at cs_check_syntax_SOURCES = cs_check_syntax.c
@HAVE_FRONTEND_TRUE at cs_check_syntax_LDADD = \
@HAVE_FRONTEND_TRUE@$(top_builddir)/src/mei/libmei.la \
- at HAVE_FRONTEND_TRUE@$(top_builddir)/src/bft/libbft.la
+ at HAVE_FRONTEND_TRUE@$(top_builddir)/src/bft/libbft.la \
+ at HAVE_FRONTEND_TRUE@-lm
@HAVE_FRONTEND_TRUE at cs_check_syntax_LDFLAGS = \
- at HAVE_FRONTEND_TRUE@$(ORIGINRUNPATH) \
- at HAVE_FRONTEND_TRUE@-lm
+ at HAVE_FRONTEND_TRUE@$(ORIGINRUNPATH)
# Code_Saturne partitioner
More information about the debian-science-maintainers
mailing list