Gentoo Archives: gentoo-devhelp

From: Thomas Kahle <tom111@×××.de>
To: gentoo-devhelp@l.g.o
Subject: Re: [gentoo-devhelp] autotools and as-needed
Date: Wed, 19 Aug 2009 21:04:00
Message-Id: 4A8C6827.1000901@gmx.de
In Reply to: Re: [gentoo-devhelp] autotools and as-needed by Peter Volkov
Peter Volkov wrote:
> В Срд, 12/08/2009 в 00:03 +0200, Thomas Kahle пишет: >> the following check in configure.ac fails with --as-needed but works >> without it. Any hints what is wrong ? Thanks / Thomas > > Common reason for failure with --as-needed is the order of libraries. In > you previous mail you wrote that with > > sed "s/\"-lntl\"/\"-lntl\" \"-lgf2x -lntl\"/" -i "${S}/configure.ac" > > it works but here: > >> for lib in "" "-lntl" "-lntl -lgf2x" > > I see different order. Try to change order of -lgf2x and -lntl inside > ebuild. Also
This change of order is actually since I tried what you suggested. I find that this check fails just because the compile fails. It has nothing to do with configure. So here is my problem stripped down: $cat ntlcheck.c #include <NTL/tools.h> int main () { _ntl_GetTime(); } g++ ntlcheck.c -lntl -lgf2x works $g++ -Wl,--as-needed ntlcheck.c -lntl -lgf2x /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libntl.so: undefined reference to `gf2x_mul' collect2: ld returned 1 exit status $ g++ -Wl,--as-needed ntlcheck.c -lgf2x -lntl /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libntl.so: undefined reference to `gf2x_mul' collect2: ld returned 1 exit status BTW, installing ntl without gf2x support makes $g++ -Wl,--as-needed ntlcheck.c -lntl work ! It feels like it has something to do with ntl-headers having gf2x includes.
> sed 's/"-lntl"/"-lntl" "-lgf2x -lntl"/' -i "${S}/configure.ac"
good point. No need to escape the ' " ' :) thanks Thomas -- Thomas Kahle The fundamental theorem of algebra is open source. Like any other mathematical theorem it can be applied free of charge and everybody has access to its proof and can convince himself how it works. Why should software be any different?

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-devhelp] autotools and as-needed Mike Frysinger <vapier@g.o>