Quantcast

[gnutls-devel] gnutls.pc includes invalid flags

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[gnutls-devel] gnutls.pc includes invalid flags

Andreas Metzler-3
Hello,

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.)

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'

_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel

0002-Do-not-use-LTLIBZ-in-gnutls.pc.in.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gnutls-devel] gnutls.pc includes invalid flags

Nikos Mavrogiannopoulos
On Thu, Mar 16, 2017 at 6:03 PM, Andreas Metzler <[hidden email]> wrote:

> Hello,
>
> 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. Would it still work if we use the non LT version of the
variables (e.g., LIBZ in that case?)

regards,
Nikos

_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gnutls-devel] gnutls.pc includes invalid flags

Andreas Metzler-3
On 2017-03-17 Nikos Mavrogiannopoulos <[hidden email]> wrote:
> On Thu, Mar 16, 2017 at 6:03 PM, Andreas Metzler <[hidden email]> 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'

_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gnutls-devel] gnutls.pc includes invalid flags

Nikos Mavrogiannopoulos-2
On Sat, 2017-03-18 at 13:52 +0100, Andreas Metzler wrote:

> On 2017-03-17 Nikos Mavrogiannopoulos <[hidden email]> wrote:
> > On Thu, Mar 16, 2017 at 6:03 PM, Andreas Metzler <[hidden email]>
> > 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.

I've modified all the flags to remove the libtool variables, and added
a small test for compilation using these flags:
https://gitlab.com/gnutls/gnutls/merge_requests/317

This will not address the "ugliness" but at least would ensure that
these flags are reasonable and lead to compilation. If you have any
suggestion on something we could additionally check with pkg-config,
let me know.

regards,
Nikos


_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gnutls-devel] gnutls.pc includes invalid flags

Andreas Metzler-3
On 2017-03-18 Nikos Mavrogiannopoulos <[hidden email]> wrote:
[...]
> I've modified all the flags to remove the libtool variables, and added
> a small test for compilation using these flags:
> https://gitlab.com/gnutls/gnutls/merge_requests/317

> This will not address the "ugliness" but at least would ensure that
> these flags are reasonable and lead to compilation. If you have any
> suggestion on something we could additionally check with pkg-config,
> let me know.

This issue is still open:
| ... fix duplicate reference to zlib. If zlib.pc was present it would
| be listed in both Requires.private and Libs.private.

I had listed this in suggested patch's commit message  but forgot to
mention it in the mail, sorry.
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'

_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gnutls-devel] gnutls.pc includes invalid flags

Nikos Mavrogiannopoulos
On Wed, Mar 22, 2017 at 6:57 PM, Andreas Metzler <[hidden email]> wrote:

> On 2017-03-18 Nikos Mavrogiannopoulos <[hidden email]> wrote:
> [...]
>> I've modified all the flags to remove the libtool variables, and added
>> a small test for compilation using these flags:
>> https://gitlab.com/gnutls/gnutls/merge_requests/317
>
>> This will not address the "ugliness" but at least would ensure that
>> these flags are reasonable and lead to compilation. If you have any
>> suggestion on something we could additionally check with pkg-config,
>> let me know.
>
> This issue is still open:
> | ... fix duplicate reference to zlib. If zlib.pc was present it would
> | be listed in both Requires.private and Libs.private.
>
> I had listed this in suggested patch's commit message  but forgot to
> mention it in the mail, sorry.
I saw it but didn't have anything good to propose and then I forgot
about it. What about something like that patch?

regards,
Nikos

_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel

libz-pc.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gnutls-devel] gnutls.pc includes invalid flags

Andreas Metzler-3
On 2017-03-23 Nikos Mavrogiannopoulos <[hidden email]> wrote:
> On Wed, Mar 22, 2017 at 6:57 PM, Andreas Metzler <[hidden email]> wrote:
[...]
[...]
> > This issue is still open:
> > | ... fix duplicate reference to zlib. If zlib.pc was present it would
> > | be listed in both Requires.private and Libs.private.
> >
> > I had listed this in suggested patch's commit message  but forgot to
> > mention it in the mail, sorry.

> I saw it but didn't have anything good to propose and then I forgot
> about it. What about something like that patch?
[...]

Works for me. Tested both with and without having zlib.pc available.

thanks, 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'

_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gnutls-devel] gnutls.pc includes invalid flags

Andreas Metzler-3
On 2017-03-24 Andreas Metzler <[hidden email]> wrote:

> On 2017-03-23 Nikos Mavrogiannopoulos <[hidden email]> wrote:
> > On Wed, Mar 22, 2017 at 6:57 PM, Andreas Metzler <[hidden email]> wrote:
> [...]
> [...]
> > > This issue is still open:
> > > | ... fix duplicate reference to zlib. If zlib.pc was present it would
> > > | be listed in both Requires.private and Libs.private.
> > >
> > > I had listed this in suggested patch's commit message  but forgot to
> > > mention it in the mail, sorry.

> > I saw it but didn't have anything good to propose and then I forgot
> > about it. What about something like that patch?
> [...]

> Works for me. Tested both with and without having zlib.pc available.

Now in GIT, thank you!

Almost the same issue exist for p11-kit, it is also in both Libs.private
and Requires.private. However since compilation requires that
p11-kit-1.pc is present and does not allow non-pkgconfig p11-kit the fix
is trivial. Just drop @P11_KIT_LIBS@ from Libs.private.

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'

_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gnutls-devel] gnutls.pc includes invalid flags

Nikos Mavrogiannopoulos-2
On Sat, 2017-03-25 at 15:30 +0100, Andreas Metzler wrote:

> On 2017-03-24 Andreas Metzler <[hidden email]> wrote:
> > On 2017-03-23 Nikos Mavrogiannopoulos <[hidden email]> wrote:
> > > On Wed, Mar 22, 2017 at 6:57 PM, Andreas Metzler <[hidden email]
> > > e> wrote:
> >
> > [...]
> > [...]
> > > > This issue is still open:
> > > > > ... fix duplicate reference to zlib. If zlib.pc was present
> > > > > it would
> > > > > be listed in both Requires.private and Libs.private.
> > > >
> > > > I had listed this in suggested patch's commit message  but
> > > > forgot to
> > > > mention it in the mail, sorry.
> > > I saw it but didn't have anything good to propose and then I
> > > forgot
> > > about it. What about something like that patch?
> >
> > [...]
> > Works for me. Tested both with and without having zlib.pc
> > available.
>
> Now in GIT, thank you!
>
> Almost the same issue exist for p11-kit, it is also in both
> Libs.private
> and Requires.private. However since compilation requires that
> p11-kit-1.pc is present and does not allow non-pkgconfig p11-kit the
> fix
> is trivial. Just drop @P11_KIT_LIBS@ from Libs.private.

Thank you. I've committed a patch to address it.



_______________________________________________
Gnutls-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
Loading...