You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Joe Orton <jo...@redhat.com> on 2013/01/03 12:20:44 UTC
Re: svn commit: r1428184 - /httpd/httpd/trunk/acinclude.m4
On Thu, Jan 03, 2013 at 07:23:27AM -0000, kbrand@apache.org wrote:
> Author: kbrand
> Date: Thu Jan 3 07:23:27 2013
> New Revision: 1428184
>
> URL: http://svn.apache.org/viewvc?rev=1428184&view=rev
> Log:
> Improve pkg-config usage for mod_ssl/ab:
>
> also use pkg-config for determining the -l flags (and fall back
> to a hardcoded default of "-lssl -lcrypto")
>
> add --static to pkg-config invocations, so that libraries for
> static linking are also taken into account (PR 54252 - note that
> the additional flags will only appear in modules/ssl/modules.mk
> and ab_LDFLAGS, so potential side effects are limited)
This is the wrong thing to do in 99% of cases and a static OpenSSL build
is the wrong thing to use in 99.99% of cases*, so it seems like a poor
default. I'd rather see a new configure flag which does this for users
who really know what they are doing. --with-static-openssl?
Regards, Joe
* stats courtesy of the hyperbole dept
Re: svn commit: r1428184 - /httpd/httpd/trunk/acinclude.m4
Posted by Kaspar Brand <ht...@velox.ch>.
On 04.01.2013 22:40, Stefan Fritsch wrote:
> On Thursday 03 January 2013, Joe Orton wrote:
>>> Maybe the wording of pkg-config's "--static" option is somewhat
>>> misleading. It doesn't force linking against the static libs
>>> (i.e. lib{ssl,crypto}.a), but outputs the libraries from
>>> openssl.pc's Libs.private line instead.
>>
>> Yup. Having httpd (mod_ssl/ab) link against whatever is listed in
>> Libs.private is the wrong default, it should be a special case for
>> the handful of people who build custom OpenSSL libraries.
>
> Yes. Linking mod_ssl/ab with libz.so introduces spurious dependencies.
> Linux distributions would have to undo that change.
Ok, seems like I underestimated the effect of occasionally having one
or two "not directly needed" DT_NEEDED tags in mod_ssl.so... I was more
concerned about having an additional, clumsy (and hard-to-explain) option
in configure, but here we go:
--enable-ssl-staticlib-deps
link mod_ssl with dependencies of OpenSSL's static
libraries (as indicated by "pkg-config --static").
Must be specified in addition to --enable-ssl.
Added in r1429228, 2.4.x backport proposal adapted.
Kaspar
Re: svn commit: r1428184 - /httpd/httpd/trunk/acinclude.m4
Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Thursday 03 January 2013, Joe Orton wrote:
> > Maybe the wording of pkg-config's "--static" option is somewhat
> > misleading. It doesn't force linking against the static libs
> > (i.e. lib{ssl,crypto}.a), but outputs the libraries from
> > openssl.pc's Libs.private line instead.
>
> Yup. Having httpd (mod_ssl/ab) link against whatever is listed in
> Libs.private is the wrong default, it should be a special case for
> the handful of people who build custom OpenSSL libraries.
Yes. Linking mod_ssl/ab with libz.so introduces spurious dependencies.
Linux distributions would have to undo that change.
Re: svn commit: r1428184 - /httpd/httpd/trunk/acinclude.m4
Posted by Joe Orton <jo...@redhat.com>.
On Thu, Jan 03, 2013 at 02:00:22PM +0100, Kaspar Brand wrote:
> On 03.01.2013 12:20, Joe Orton wrote:
> >> add --static to pkg-config invocations, so that libraries for
> >> static linking are also taken into account (PR 54252 - note that
> >> the additional flags will only appear in modules/ssl/modules.mk
> >> and ab_LDFLAGS, so potential side effects are limited)
> >
> > This is the wrong thing to do in 99% of cases and a static OpenSSL build
> > is the wrong thing to use in 99.99% of cases*, so it seems like a poor
> > default.
>
> Maybe the wording of pkg-config's "--static" option is somewhat
> misleading. It doesn't force linking against the static libs (i.e.
> lib{ssl,crypto}.a), but outputs the libraries from openssl.pc's
> Libs.private line instead.
Yup. Having httpd (mod_ssl/ab) link against whatever is listed in
Libs.private is the wrong default, it should be a special case for the
handful of people who build custom OpenSSL libraries.
Regards, Joe
Re: svn commit: r1428184 - /httpd/httpd/trunk/acinclude.m4
Posted by Kaspar Brand <ht...@velox.ch>.
On 03.01.2013 12:20, Joe Orton wrote:
>> add --static to pkg-config invocations, so that libraries for
>> static linking are also taken into account (PR 54252 - note that
>> the additional flags will only appear in modules/ssl/modules.mk
>> and ab_LDFLAGS, so potential side effects are limited)
>
> This is the wrong thing to do in 99% of cases and a static OpenSSL build
> is the wrong thing to use in 99.99% of cases*, so it seems like a poor
> default.
Maybe the wording of pkg-config's "--static" option is somewhat
misleading. It doesn't force linking against the static libs (i.e.
lib{ssl,crypto}.a), but outputs the libraries from openssl.pc's
Libs.private line instead.
In most cases, the only relevant difference in the pkg-config
--libs-only-l output when adding "--static" is that "-lz" will appear
there, too, if OpenSSL was configured with "[enable-]zlib". It doesn't
cause anything like "-static", "-Bstatic" or similar to be thrown into
the LDFLAGS mix, i.e. mod_ssl will still be linked against the dynamic
libs if they are found in the search path. (Prior to OpenSSL 1.0.0h and
1.0.1, "--static" doesn't even make any difference in its pkg-config
output, see https://issues.apache.org/bugzilla/show_bug.cgi?id=54252#c2).
Kaspar