You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2013/01/02 14:28:43 UTC
[Bug 54252] acinclude.m4 requires -lz when linking with ssl static
libraries
https://issues.apache.org/bugzilla/show_bug.cgi?id=54252
Kaspar Brand <as...@velox.ch> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #2 from Kaspar Brand <as...@velox.ch> ---
(In reply to comment #1)
> "-lz" would only appear in pkg-config's --libs output if
> pkg-config was called with" --static" - and that's something we don't want
> to unconditionally add to pkg-config calls in acinclude.m4/configure.
After a closer look at the OpenSSL sources, I realized that -lz (and other
potential linker flags for the static libs) were only moved to Libs.private in
the openssl.pc file with OpenSSL 1.0.0h/1.0.1 and later
(http://cvs.openssl.org/chngview?cn=22120 and
http://cvs.openssl.org/chngview?cn=22121, respectively). With previous
releases, pkg-config would output -lz also when "--static" was not specified.
That being said, relying on pkg-config for figuring out the proper
ap_openssl_libs should be doable, I think... could you try the changes shown
below and let me know if they fix the problem for you? (to be applied against a
checkout of http://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x, and
buildconf must be run afterwards)
With the modifications from r1390518, additional flags from pkg-config's
"--static" option will only be added to modules/ssl/modules.mk and ab_LDFLAGS,
i.e. we avoid the side effect of everything having unnecessary references to
libz.
--- acinclude.m4 (revision 1427763)
+++ acinclude.m4 (working copy)
@@ -517,7 +517,7 @@
PKG_CONFIG_PATH="${ap_openssl_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
fi
- ap_openssl_libs="`$PKGCONFIG --libs-only-l openssl 2>&1`"
+ ap_openssl_libs="`$PKGCONFIG --silence-errors --static --libs-only-l
openssl`"
if test $? -eq 0; then
ap_openssl_found="yes"
pkglookup="`$PKGCONFIG --cflags-only-I openssl`"
@@ -557,7 +557,7 @@
[AC_MSG_RESULT(FAILED)])
if test "x$ac_cv_openssl" = "xyes"; then
- ap_openssl_libs="-lssl -lcrypto `$apr_config --libs`"
+ ap_openssl_libs="${ap_openssl_libs:--lssl -lcrypto} `$apr_config
--libs`"
APR_ADDTO(MOD_LDFLAGS, [$ap_openssl_libs])
APR_ADDTO(LIBS, [$ap_openssl_libs])
APR_SETVAR(ab_LDFLAGS, [$MOD_LDFLAGS])
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org