bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9728: Incorrect -L flags order for HP-UX


From: Peter O'Gorman
Subject: bug#9728: Incorrect -L flags order for HP-UX
Date: Wed, 12 Oct 2011 21:52:36 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.22) Gecko/20110906 Fedora/3.1.14-1.fc14 Thunderbird/3.1.14

On 10/11/2011 08:58 AM, Vincent Lefevre wrote:
With libtool 2.4 and automake 1.11.1, we have the following problem
for MPFR 3.1.0. We have received a bug report saying that when the
tests are run on a HP-UX machine, the following command is run:

libtool: link: gcc -O2 -s -o tversion tversion.o  -L/opt/gnu/lib 
./.libs/libfrtests.a -lm -L../src/.libs -lmpfr -lgmp -Wl,+b 
-Wl,/xxx/gnu/mpfr-3.1.0/objdir/src/.libs:/opt/gnu/lib

The problem is that -L../src/.libs comes after -L/opt/gnu/lib, so that
linking is done against the MPFR version installed in /opt/gnu/lib
instead of the one from ../src/.libs, which has just been compiled.

Hi Vincent,

Unfortunately this is a fairly common problem.

If the flags were added by the user, they could set LIBS=-L/opt/gnu/lib instead on some platfroms, but that won't work on HP-UX either because its linker is rather strict that -L flags for paths that contain the library be ordered before the -l flag for that library.

Anyway, the problem can be avoided by not putting the -L and -l flags for gmp in LDFLAGS and LIBS, instead put both in e.g. GMP_LIBS, (GMP_LIBS="-L/opt/gnu/lib -lgmp"), then add $(GMP_LIBS) to LDADD.

Peter





reply via email to

[Prev in Thread] Current Thread [Next in Thread]