[gnutls-devel] gnutls.pc includes invalid flags

Andreas Metzler ametzler at bebt.de
Sat Mar 18 13:52:51 CET 2017


On 2017-03-17 Nikos Mavrogiannopoulos <nmav at gnutls.org> wrote:
> On Thu, Mar 16, 2017 at 6:03 PM, Andreas Metzler <ametzler at bebt.de> wrote:
>> this is https://bugs.debian.org/857943 reported by Aaron M. Ucko:
>> ----------------
>> he output of `pkg-config gnutls --libs --static` includes a flag of
>> the form -R/usr/lib/$DEB_HOST_MULTIARCH, which is not only superfluous
>> but also outright broken without a leading -Wl,:

>> $ gcc `pkg-config gnutls --libs --static`
>> gcc: error: unrecognized command line option ‘-R’; did you mean ‘-R’?
>> $ pkg-config gnutls --libs --static
>> -lgnutls -lz -R/usr/lib/x86_64-linux-gnu     -lp11-kit   -lgmp -lnettle -lhogweed -lgmp -lnettle -ltasn1 -lidn -lp11-kit -lz
>> ----------------
>> Attached patch works for me.

>> (I am not totally sure whether it is useful to carter for incomplete
>> pkg-config setups at all. If there is no zlib.pc, the user will probably
>> not install gnutls.pc either.)

> I'm thinking that this may apply to all the LT variables used
> Libs.private.

Hello,

I think so, too. It just has not hit us at Debian yet since the other
@LT variables in gnutls.pc.in expand to empty strings in our builds.

> Would it still work if we use the non LT version of the
> variables (e.g., LIBZ in that case?)

It probably would work, but definitely is not pretty, "./configure
--libdir=/usr/lib/x86_64-linux-gnu" will produce these output variables
when libz.so is in /usr/lib/x86_64-linux-gnu (which is in the standard
linker search path):

HAVE_LIBZ=yes
LIBZ=/usr/lib/x86_64-linux-gnu/libz.so -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu
LIBZ_PREFIX=
LTLIBZ=-L/usr/lib/x86_64-linux-gnu -lz -R/usr/lib/x86_64-linux-gnu

This seems to be a general problem with AC_LIB_HAVE_LINKFLAGS.

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'



More information about the Gnutls-devel mailing list