1 |
Peter Volkov wrote: |
2 |
> В Срд, 12/08/2009 в 00:03 +0200, Thomas Kahle пишет: |
3 |
>> the following check in configure.ac fails with --as-needed but works |
4 |
>> without it. Any hints what is wrong ? Thanks / Thomas |
5 |
> |
6 |
> Common reason for failure with --as-needed is the order of libraries. In |
7 |
> you previous mail you wrote that with |
8 |
> |
9 |
> sed "s/\"-lntl\"/\"-lntl\" \"-lgf2x -lntl\"/" -i "${S}/configure.ac" |
10 |
> |
11 |
> it works but here: |
12 |
> |
13 |
>> for lib in "" "-lntl" "-lntl -lgf2x" |
14 |
> |
15 |
> I see different order. Try to change order of -lgf2x and -lntl inside |
16 |
> ebuild. Also |
17 |
|
18 |
This change of order is actually since I tried what you suggested. I |
19 |
find that this check fails just because the compile fails. It has |
20 |
nothing to do with configure. So here is my problem stripped down: |
21 |
|
22 |
$cat ntlcheck.c |
23 |
#include <NTL/tools.h> |
24 |
int main () { _ntl_GetTime(); } |
25 |
|
26 |
g++ ntlcheck.c -lntl -lgf2x |
27 |
works |
28 |
|
29 |
$g++ -Wl,--as-needed ntlcheck.c -lntl -lgf2x |
30 |
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libntl.so: undefined |
31 |
reference to `gf2x_mul' |
32 |
collect2: ld returned 1 exit status |
33 |
|
34 |
$ g++ -Wl,--as-needed ntlcheck.c -lgf2x -lntl |
35 |
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libntl.so: undefined |
36 |
reference to `gf2x_mul' |
37 |
collect2: ld returned 1 exit status |
38 |
|
39 |
BTW, installing ntl without gf2x support makes |
40 |
$g++ -Wl,--as-needed ntlcheck.c -lntl |
41 |
work ! |
42 |
|
43 |
It feels like it has something to do with ntl-headers having gf2x includes. |
44 |
|
45 |
> sed 's/"-lntl"/"-lntl" "-lgf2x -lntl"/' -i "${S}/configure.ac" |
46 |
good point. No need to escape the ' " ' :) |
47 |
|
48 |
thanks |
49 |
Thomas |
50 |
|
51 |
|
52 |
|
53 |
-- |
54 |
Thomas Kahle |
55 |
|
56 |
The fundamental theorem of algebra is open source. Like any other |
57 |
mathematical theorem it can be applied free of charge and everybody |
58 |
has access to its proof and can convince himself how it works. Why |
59 |
should software be any different? |