Hi Lukas

I am trying to follow the steps you mentioned and the OpenSSL installs
fine, but am getting the following when trying to build haproxy and I would
appreciate any thoughts on why this maybe happening.  This is a CEntOS 5.3
32bit system, I have tried with the target like you mentioned and also with
linux26 and linux24, I removed haproxy-1.5-dev18 directory and untar the
haproxy-1.5-dev18.tar.gz file each time.  but I am still getting the same
sort of errors:


make TARGET=linux2628 USE_OPENSSL=1 ADDINC=-I$LIBSSLBUILD/include
ADDLIB="-L$LIBSSLBUILD/lib -ldl"

gcc  -g -o haproxy src/haproxy.o src/sessionhash.o src/base64.o
src/protocol.o src/uri_auth.o src/standard.o src/buffer.o src/log.o
src/task.o src/chunk.o src/channel.o src/listener.o src/time.o src/fd.o
src/pipe.o src/regex.o src/cfgparse.o src/server.o src/checks.o src/queue.o
src/frontend.o src/proxy.o src/peers.o src/arg.o src/stick_table.o
src/proto_uxst.o src/connection.o src/proto_http.o src/raw_sock.o
src/appsession.o src/backend.o src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o
src/lb_map.o src/lb_fas.o src/stream_interface.o src/dumpstats.o
src/proto_tcp.o src/session.o src/hdr_idx.o src/ev_select.o src/signal.o
src/acl.o src/sample.o src/memory.o src/freq_ctr.o src/auth.o
src/compression.o src/payload.o src/ev_poll.o src/ev_epoll.o src/ssl_sock.o
src/shctx.o ebtree/ebtree.o ebtree/eb32tree.o ebtree/eb64tree.o
ebtree/ebmbtree.o ebtree/ebsttree.o ebtree/ebimtree.o ebtree/ebistree.o
-lcrypt -lssl -lcrypto -L/opt/libsslbuild/lib -ldl
src/listener.o: In function `listener_accept':
/root/haproxy-1.5-dev18/src/listener.c:314: undefined reference to `accept4'
src/shctx.o: In function `atomic_dec':
/root/haproxy-1.5-dev18/src/shctx.c:134: undefined reference to
`__sync_sub_and_fetch_4'
src/shctx.o: In function `cmpxchg':
/root/haproxy-1.5-dev18/src/shctx.c:129: undefined reference to
`__sync_val_compare_and_swap_4'
src/shctx.o: In function `atomic_dec':
/root/haproxy-1.5-dev18/src/shctx.c:134: undefined reference to
`__sync_sub_and_fetch_4'
/root/haproxy-1.5-dev18/src/shctx.c:134: undefined reference to
`__sync_sub_and_fetch_4'
src/shctx.o: In function `cmpxchg':
/root/haproxy-1.5-dev18/src/shctx.c:129: undefined reference to
`__sync_val_compare_and_swap_4'
src/shctx.o: In function `atomic_dec':
/root/haproxy-1.5-dev18/src/shctx.c:134: undefined reference to
`__sync_sub_and_fetch_4'
src/shctx.o: In function `cmpxchg':
/root/haproxy-1.5-dev18/src/shctx.c:129: undefined reference to
`__sync_val_compare_and_swap_4'
collect2: ld returned 1 exit status
make: *** [haproxy] Error 1


Thanks

Joe


On Fri, May 10, 2013 at 8:24 PM, Lukas Tribus <[email protected]> wrote:

> Hi Bryan,
>
>
> > What's required to build haproxy and statically link with openssl libs
> > like can be done with pcre?
>
> The following procedure will install a static build of latest openssl
> in a directory of your choice without interfering with your OS headers
> and libraries:
>
> > export LIBSSLBUILD=/tmp/libsslbuild
> > mkdir $LIBSSLBUILD
> > cd ~
> > wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
> > tar zxvf openssl-1.0.1e.tar.gz
> > cd openssl-1.0.1e &&
> > ./config --prefix=$LIBSSLBUILD no-shared
> > make
> > make install_sw
>
>
> Then build haproxy by pointing to the proper path:
> > make TARGET=linux2628 USE_OPENSSL=1 ADDINC=-I$LIBSSLBUILD/include \
> > ADDLIB="-L$LIBSSLBUILD/lib -ldl"
>
> OpenSSL depends on libdl, so we need pass -ldl along.
>
>
> When everything is compiled, checkout your openssl version (use a
> snapshot from Apr 27th or younger to see build and runtime
> openssl version). Both should say 1.0.1e in our case. Also check with
> ldd; it should not show any openssl libraries loaded dynamically.
>
> > lukas@ubuntuvm:~/haproxy$ ./haproxy -vv | grep OpenSSL
> > Built with OpenSSL version : OpenSSL 1.0.1e 11 Feb 2013
> > Running on OpenSSL version : OpenSSL 1.0.1e 11 Feb 2013
> > OpenSSL library supports TLS extensions : yes
> > OpenSSL library supports SNI : yes
> > OpenSSL library supports prefer-server-ciphers : yes
> > lukas@ubuntuvm:~/haproxy$ ldd haproxy
> >         linux-gate.so.1 =>  (0xb76e4000)
> >         libcrypt.so.1 => /lib/i386-linux-gnu/libcrypt.so.1 (0xb76ab000)
> >         libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb76a6000)
> >         libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb74fb000)
> >         /lib/ld-linux.so.2 (0xb76e5000)
> > lukas@ubuntuvm:~/haproxy$
>
>
>
> Regards,
>
> Lukas
>

Reply via email to