Hi Julien,

On 10:35 Sat 28 Sep     , Julien Vehent wrote:
> On 2013-09-27 21:17, Lukas Tribus wrote:
> >Try stable OpenSSL 1.0.1e, that should work.
> 
> I did, and I get the exact same error.
> The problem happens on Debian Squeeze. My laptop on Fedora 19
> doesn't have the issue.
> 

HAProxy's build system does not currently support static linking
against openssl. The reason it works on Fedora 19, is probably because 
the system already ships OpenSSL 1.0.1 in the system library path; I bet 
if you do an ldd against the generated haproxy binary it will be 
dynamically linked against the system's OpenSSL, not statically against 
your own version.

The only way to statically link against OpenSSL would be to patch HAProxy's
Makefile to do more or less what is done with static PCRE: pass -Wl,-Bstatic
before -lssl and -Wl,-Bdynamic afterwards. The following patch should do it
(although it should really introduce a new flag):

diff --git a/Makefile b/Makefile
index 5e12af8..fc4d1bc 100644
--- a/Makefile
+++ b/Makefile
@@ -521,7 +521,7 @@ ifneq ($(USE_OPENSSL),)
 # to specify -I and -L if your OpenSSL library is not in the standard path.
 BUILD_OPTIONS   += $(call ignore_implicit,USE_OPENSSL)
 OPTIONS_CFLAGS  += -DUSE_OPENSSL
-OPTIONS_LDFLAGS += -lssl -lcrypto
+OPTIONS_LDFLAGS += -Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic
 OPTIONS_OBJS  += src/ssl_sock.o src/shctx.o
 ifneq ($(USE_PRIVATE_CACHE),)
 OPTIONS_CFLAGS  += -DUSE_PRIVATE_CACHE

--

Regards,
Apollon

PS: personally I wouldn't link statically against OpenSSL. I'd just
    co-install libssl1.0.0 along with the system's libssl0.9.8.

Reply via email to