Re: building haproxy with lua support

2015-03-17 Thread Baptiste
On Tue, Mar 17, 2015 at 1:51 AM, Joe Williams williams@gmail.com wrote:
 List,

 I seem to be running into issues building haproxy with lua support using
 HEAD. Any thoughts?

 joe@ubuntu:~/haproxy$ make DEBUG=-ggdb CFLAGS=-O0 TARGET=linux2628
 USE_LUA=yes LUA_LIB=/opt/lua53/lib/ LUA_INC=/opt/lua53/include/ LDFLAGS=-ldl
 snip
 /opt/lua53/lib//liblua.a(loadlib.o): In function `lookforfunc':
 loadlib.c:(.text+0x502): undefined reference to `dlsym'
 loadlib.c:(.text+0x549): undefined reference to `dlerror'
 loadlib.c:(.text+0x576): undefined reference to `dlopen'
 loadlib.c:(.text+0x5ed): undefined reference to `dlerror'
 /opt/lua53/lib//liblua.a(loadlib.o): In function `gctm':
 loadlib.c:(.text+0x781): undefined reference to `dlclose'
 collect2: error: ld returned 1 exit status
 make: *** [haproxy] Error 1

 joe@ubuntu:~/haproxy$ /opt/lua53/bin/lua -v
 Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio

 Thanks!

 -Joe

Hi Joe,

You're missing an LDFLAGS=-ldl.
More information on this blog page, including some quickstart code example:
http://blog.haproxy.com/2015/03/12/haproxy-1-6-dev1-and-lua/

Baptiste



Re: building haproxy with lua support

2015-03-17 Thread Thierry FOURNIER
On Tue, 17 Mar 2015 08:38:23 +0100
Baptiste bed...@gmail.com wrote:

 On Tue, Mar 17, 2015 at 1:51 AM, Joe Williams williams@gmail.com wrote:
  List,
 
  I seem to be running into issues building haproxy with lua support using
  HEAD. Any thoughts?
 
  joe@ubuntu:~/haproxy$ make DEBUG=-ggdb CFLAGS=-O0 TARGET=linux2628
  USE_LUA=yes LUA_LIB=/opt/lua53/lib/ LUA_INC=/opt/lua53/include/ LDFLAGS=-ldl
  snip
  /opt/lua53/lib//liblua.a(loadlib.o): In function `lookforfunc':
  loadlib.c:(.text+0x502): undefined reference to `dlsym'
  loadlib.c:(.text+0x549): undefined reference to `dlerror'
  loadlib.c:(.text+0x576): undefined reference to `dlopen'
  loadlib.c:(.text+0x5ed): undefined reference to `dlerror'
  /opt/lua53/lib//liblua.a(loadlib.o): In function `gctm':
  loadlib.c:(.text+0x781): undefined reference to `dlclose'
  collect2: error: ld returned 1 exit status
  make: *** [haproxy] Error 1
 
  joe@ubuntu:~/haproxy$ /opt/lua53/bin/lua -v
  Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio
 
  Thanks!
 
  -Joe


Thank you,

In fact I build with the SSL activated, and the libssl is already
linked with thz dl library, so I don't sew this compilation error.

It is fixed, the patch is in attachment.

Thierry


 
 Hi Joe,
 
 You're missing an LDFLAGS=-ldl.
 More information on this blog page, including some quickstart code example:
 http://blog.haproxy.com/2015/03/12/haproxy-1-6-dev1-and-lua/
 
 Baptiste
 
From a1d13d7f72f3dd1f3b39cf43ec27e9f67797e650 Mon Sep 17 00:00:00 2001
From: Thierry FOURNIER tfourn...@haproxy.com
Date: Tue, 17 Mar 2015 11:14:26 +0100
Subject: [PATCH 03/11] BUILD: lua: it miss the '-ldl' directive

The Lua library requires the 'dl' library.
---
 Makefile |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a12e4c9..e403239 100644
--- a/Makefile
+++ b/Makefile
@@ -575,7 +575,7 @@ $(error unable to automatically detect the Lua library name, you can enforce its
 endif
 endif
 
-OPTIONS_LDFLAGS += $(LUA_LD_FLAGS) -l$(LUA_LIB_NAME) -lm
+OPTIONS_LDFLAGS += $(LUA_LD_FLAGS) -l$(LUA_LIB_NAME) -lm -ldl
 OPTIONS_OBJS+= src/hlua.o
 endif
 
-- 
1.7.10.4



Re: building haproxy with lua support

2015-03-17 Thread Dmitry Sivachenko

 On 17 марта 2015 г., at 13:17, Thierry FOURNIER tfourn...@haproxy.com wrote:
 
 On Tue, 17 Mar 2015 08:38:23 +0100
 Baptiste bed...@gmail.com wrote:
 
 On Tue, Mar 17, 2015 at 1:51 AM, Joe Williams williams@gmail.com wrote:
 List,
 
 I seem to be running into issues building haproxy with lua support using
 HEAD. Any thoughts?
 
 joe@ubuntu:~/haproxy$ make DEBUG=-ggdb CFLAGS=-O0 TARGET=linux2628
 USE_LUA=yes LUA_LIB=/opt/lua53/lib/ LUA_INC=/opt/lua53/include/ LDFLAGS=-ldl
 snip
 /opt/lua53/lib//liblua.a(loadlib.o): In function `lookforfunc':
 loadlib.c:(.text+0x502): undefined reference to `dlsym'
 loadlib.c:(.text+0x549): undefined reference to `dlerror'
 loadlib.c:(.text+0x576): undefined reference to `dlopen'
 loadlib.c:(.text+0x5ed): undefined reference to `dlerror'
 /opt/lua53/lib//liblua.a(loadlib.o): In function `gctm':
 loadlib.c:(.text+0x781): undefined reference to `dlclose'
 collect2: error: ld returned 1 exit status
 make: *** [haproxy] Error 1
 
 joe@ubuntu:~/haproxy$ /opt/lua53/bin/lua -v
 Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio
 
 Thanks!
 
 -Joe
 
 
 Thank you,
 
 In fact I build with the SSL activated, and the libssl is already
 linked with thz dl library, so I don't sew this compilation error.
 
 It is fixed, the patch is in attachment.


This patch will break FreeBSD (and other OSes) which do not have libdl.


Re: building haproxy with lua support

2015-03-17 Thread Thierry FOURNIER
On Tue, 17 Mar 2015 14:35:20 +0300
Dmitry Sivachenko trtrmi...@gmail.com wrote:

 
  On 17 марта 2015 г., at 13:17, Thierry FOURNIER tfourn...@haproxy.com 
  wrote:
  
  On Tue, 17 Mar 2015 08:38:23 +0100
  Baptiste bed...@gmail.com wrote:
  
  On Tue, Mar 17, 2015 at 1:51 AM, Joe Williams williams@gmail.com 
  wrote:
  List,
  
  I seem to be running into issues building haproxy with lua support using
  HEAD. Any thoughts?
  
  joe@ubuntu:~/haproxy$ make DEBUG=-ggdb CFLAGS=-O0 TARGET=linux2628
  USE_LUA=yes LUA_LIB=/opt/lua53/lib/ LUA_INC=/opt/lua53/include/ 
  LDFLAGS=-ldl
  snip
  /opt/lua53/lib//liblua.a(loadlib.o): In function `lookforfunc':
  loadlib.c:(.text+0x502): undefined reference to `dlsym'
  loadlib.c:(.text+0x549): undefined reference to `dlerror'
  loadlib.c:(.text+0x576): undefined reference to `dlopen'
  loadlib.c:(.text+0x5ed): undefined reference to `dlerror'
  /opt/lua53/lib//liblua.a(loadlib.o): In function `gctm':
  loadlib.c:(.text+0x781): undefined reference to `dlclose'
  collect2: error: ld returned 1 exit status
  make: *** [haproxy] Error 1
  
  joe@ubuntu:~/haproxy$ /opt/lua53/bin/lua -v
  Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio
  
  Thanks!
  
  -Joe
  
  
  Thank you,
  
  In fact I build with the SSL activated, and the libssl is already
  linked with thz dl library, so I don't sew this compilation error.
  
  It is fixed, the patch is in attachment.
 
 
 This patch will break FreeBSD (and other OSes) which do not have libdl.

Hi,

Thanks. Willy just fix this. now -ldl is implicit on LInx and it must be
activated or deactivated explicitely on other OS.

Thierry



Re: building haproxy with lua support

2015-03-17 Thread Joe Williams
Thanks everyone, the patch worked perfectly for me.

On Tue, Mar 17, 2015 at 6:36 AM, Thierry FOURNIER tfourn...@haproxy.com
wrote:

 On Tue, 17 Mar 2015 14:35:20 +0300
 Dmitry Sivachenko trtrmi...@gmail.com wrote:

 
   On 17 марта 2015 г., at 13:17, Thierry FOURNIER tfourn...@haproxy.com
 wrote:
  
   On Tue, 17 Mar 2015 08:38:23 +0100
   Baptiste bed...@gmail.com wrote:
  
   On Tue, Mar 17, 2015 at 1:51 AM, Joe Williams williams@gmail.com
 wrote:
   List,
  
   I seem to be running into issues building haproxy with lua support
 using
   HEAD. Any thoughts?
  
   joe@ubuntu:~/haproxy$ make DEBUG=-ggdb CFLAGS=-O0 TARGET=linux2628
   USE_LUA=yes LUA_LIB=/opt/lua53/lib/ LUA_INC=/opt/lua53/include/
 LDFLAGS=-ldl
   snip
   /opt/lua53/lib//liblua.a(loadlib.o): In function `lookforfunc':
   loadlib.c:(.text+0x502): undefined reference to `dlsym'
   loadlib.c:(.text+0x549): undefined reference to `dlerror'
   loadlib.c:(.text+0x576): undefined reference to `dlopen'
   loadlib.c:(.text+0x5ed): undefined reference to `dlerror'
   /opt/lua53/lib//liblua.a(loadlib.o): In function `gctm':
   loadlib.c:(.text+0x781): undefined reference to `dlclose'
   collect2: error: ld returned 1 exit status
   make: *** [haproxy] Error 1
  
   joe@ubuntu:~/haproxy$ /opt/lua53/bin/lua -v
   Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio
  
   Thanks!
  
   -Joe
  
  
   Thank you,
  
   In fact I build with the SSL activated, and the libssl is already
   linked with thz dl library, so I don't sew this compilation error.
  
   It is fixed, the patch is in attachment.
 
 
  This patch will break FreeBSD (and other OSes) which do not have libdl.

 Hi,

 Thanks. Willy just fix this. now -ldl is implicit on LInx and it must be
 activated or deactivated explicitely on other OS.

 Thierry



building haproxy with lua support

2015-03-16 Thread Joe Williams
List,

I seem to be running into issues building haproxy with lua support using
HEAD. Any thoughts?

joe@ubuntu:~/haproxy$ make DEBUG=-ggdb CFLAGS=-O0 TARGET=linux2628
USE_LUA=yes LUA_LIB=/opt/lua53/lib/ LUA_INC=/opt/lua53/include/ LDFLAGS=-ldl
snip
/opt/lua53/lib//liblua.a(loadlib.o): In function `lookforfunc':
loadlib.c:(.text+0x502): undefined reference to `dlsym'
loadlib.c:(.text+0x549): undefined reference to `dlerror'
loadlib.c:(.text+0x576): undefined reference to `dlopen'
loadlib.c:(.text+0x5ed): undefined reference to `dlerror'
/opt/lua53/lib//liblua.a(loadlib.o): In function `gctm':
loadlib.c:(.text+0x781): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make: *** [haproxy] Error 1

joe@ubuntu:~/haproxy$ /opt/lua53/bin/lua -v
Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio

Thanks!

-Joe