FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

LinkBack Thread Tools
Old 07-04-2012, 08:16 PM
Nicolas Boulenguez
Default Bug#680292: gnatmake: linker arguments order incompatible with --as-needed

Package: gnat-4.6
Version: 4.6.3-4
Severity: minor

Hello. Gnatmake calls gcc -shared in a way incompatible with
--as-needed. Gprbuild uses a better ordering.

-- bug.ads
package Bug is
end Bug;
-- bug.gpr
project Bug is
for Library_Name use "bug";
for Library_Version use "libbug.so.1";
for Library_Kind use "dynamic";
for Library_Dir use "lib";
for Library_Options use ("-lncurses");
end Bug;
$ mkdir lib
$ gnatmake -v -Pbug
/usr//bin/gcc-4.6 -shared ... -lncurses ... -lgnat-4.6 -Wl,-soname,libbug.so.1 /tmp/bug/bug.o
$ gnatclean -Pbug
$ gprbuild -v -Pbug
/usr/bin/gcc-4.6 -shared ... -lgnat-4.6 ... -Wl,-soname,libbug.so.1 /tmp/bug/bug.o -lncurses

When adding -Wl,--as-needed before -lncurses in Library_Options (or
using GNU gold linker with default options), symbols from -lgnat-4.6
are ignored because they are not used by any object *yet*. In this
minimal example, this is not a problem, but any useful library will
use symbols from -lgnat-4.6.

As a more real-life example, read dpkg_shlibdeps warnings when building
libtexttools-2.1.0-1 with

LDFLAGS += -Wl,--as-needed # or remove the lines stripping it

-- System Information:
ii gcc-4.6 4.6.3-1

To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/20120704201655.GA14911@pegase

Thread Tools

All times are GMT. The time now is 04:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org