使用HAProxy编译时出现Lua问题



问题如下。。当我运行命令make-j$(nproc(TARGET=linux glibc USE_PCRE=1 USE_PCRE_JIT=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LIUX_TPROXY=1 USE_REGPARM=1 USE_LUA=1 USE_THREAD=1 USE_TFO=1 时

我得到下面的错误。。我正在尝试从源代码使用Lua 5.4构建HaProxy 2.5。

src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_hook':
/src/haproxy-2.5.5/src/hlua.c:1325: undefined reference to `lua_isyieldable'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_load_state':
/src/haproxy-2.5.5/src/hlua.c:11134: undefined reference to `luaL_loadfilex'
/src/haproxy-2.5.5/src/hlua.c:11142: undefined reference to `lua_pcallk'
src/hlua.o: In function `hlua_prepend_path':
/src/haproxy-2.5.5/src/hlua.c:11236: undefined reference to `lua_getglobal'
src/hlua.o: In function `hlua_filter_parse_fct':
/src/haproxy-2.5.5/src/hlua.c:10875: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_sleep_yield':
/src/haproxy-2.5.5/src/hlua.c:8289: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_applet_tcp_recv_yield':
/src/haproxy-2.5.5/src/hlua.c:4557: undefined reference to `lua_copy'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_txn_reply_add_header':
/src/haproxy-2.5.5/src/hlua.c:8185: undefined reference to `lua_rawlen'
src/hlua.o: In function `hlua_applet_http_addheader':
/src/haproxy-2.5.5/src/hlua.c:5242: undefined reference to `lua_rawlen'
src/hlua.o: In function `hlua_txn_reply_new':
/src/haproxy-2.5.5/src/hlua.c:8067: undefined reference to `lua_rotate'
/src/haproxy-2.5.5/src/hlua.c:8071: undefined reference to `lua_rotate'
/src/haproxy-2.5.5/src/hlua.c:8088: undefined reference to `lua_rawlen'
/src/haproxy-2.5.5/src/hlua.c:8007: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_filter_init_per_thread':
/src/haproxy-2.5.5/src/hlua.c:10299: undefined reference to `lua_rotate'
/src/haproxy-2.5.5/src/hlua.c:10319: undefined reference to `lua_rawlen'
/src/haproxy-2.5.5/src/hlua.c:10322: undefined reference to `lua_pcallk'
src/hlua.o: In function `hlua_lua2arg':
/src/haproxy-2.5.5/src/hlua.c:603: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_lua2smp':
/src/haproxy-2.5.5/src/hlua.c:739: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_txn_forward_reply':
/src/haproxy-2.5.5/src/hlua.c:7757: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o:/src/haproxy-2.5.5/src/hlua.c:1158: more undefined references to `lua_yieldk' follow
src/hlua.o: In function `hlua_http_get_headers':
/src/haproxy-2.5.5/src/hlua.c:5614: undefined reference to `lua_rawlen'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_socket_connect':
/src/haproxy-2.5.5/src/hlua.c:2742: undefined reference to `luaL_prepbuffsize'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_httpclient_get_headers':
/src/haproxy-2.5.5/src/hlua.c:7022: undefined reference to `lua_rawlen'
src/hlua.o: In function `hlua_applet_http_recv_yield':
/src/haproxy-2.5.5/src/hlua.c:5094: undefined reference to `lua_copy'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o:/src/haproxy-2.5.5/src/hlua.c:1158: more undefined references to `lua_yieldk' follow
src/hlua.o: In function `hlua_applet_http_send_response':
/src/haproxy-2.5.5/src/hlua.c:5345: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_socket_receive_yield':
/src/haproxy-2.5.5/src/hlua.c:2069: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_socket_receive':
/src/haproxy-2.5.5/src/hlua.c:2279: undefined reference to `lua_copy'
/src/haproxy-2.5.5/src/hlua.c:2268: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_filter_callback':
/src/haproxy-2.5.5/src/hlua.c:10615: undefined reference to `lua_rotate'
/src/haproxy-2.5.5/src/hlua.c:10658: undefined reference to `lua_rotate'
/src/haproxy-2.5.5/src/hlua.c:10673: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_filter_tcp_payload':
/src/haproxy-2.5.5/src/hlua.c:10812: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_filter_http_payload':
/src/haproxy-2.5.5/src/hlua.c:10776: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_action':
/src/haproxy-2.5.5/src/hlua.c:9076: undefined reference to `lua_tointegerx'
src/hlua.o: In function `hlua_filter_new':
/src/haproxy-2.5.5/src/hlua.c:10487: undefined reference to `lua_rotate'
src/hlua.o: In function `hlua_yieldk':
/src/haproxy-2.5.5/src/hlua.c:1158: undefined reference to `lua_yieldk'
src/hlua.o: In function `hlua_init_state':
/src/haproxy-2.5.5/src/hlua.c:11723: undefined reference to `lua_setglobal'
/src/haproxy-2.5.5/src/hlua.c:11746: undefined reference to `lua_setglobal'
/src/haproxy-2.5.5/src/hlua.c:11768: undefined reference to `lua_setglobal'
/src/haproxy-2.5.5/src/hlua.c:11814: undefined reference to `lua_setglobal'
src/hlua_fcn.o: In function `hlua_stktable_dump':
/src/haproxy-2.5.5/src/hlua_fcn.c:719: undefined reference to `lua_rawlen'
/src/haproxy-2.5.5/src/hlua_fcn.c:744: undefined reference to `lua_tointegerx'
src/hlua_fcn.o: In function `hlua_fcn_post_init':
/src/haproxy-2.5.5/src/hlua_fcn.c:1390: undefined reference to `lua_getglobal'
src/hlua_fcn.o: In function `hlua_fcn_reg_core_fcn':
/src/haproxy-2.5.5/src/hlua_fcn.c:1713: undefined reference to `lua_setglobal'
collect2: error: ld returned 1 exit status
make: *** [haproxy] Error 1

当使用默认的Lua(CentOS7为5.1.4(时,HAProxy找不到它。HAProxy不适用于5.1.4 Lua。在将Lua更新为5.3或更高版本并运行命令之后

make -j $(nproc) TARGET=linux-glibc USE_PCRE=1 USE_PCRE_JIT=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LINUX_TPROXY=1 USE_REGPARM=1 USE_LUA=1 LUA_LIB_NAME=lua5.4 USE_THREAD=1 USE_TFO=1 

我仍然得到上面的错误。请记住,CentOS7是一个ARM64基础设施。我试着在AMD64上构建HAProxy和Lua,它成功地通过了。这可能是ARM的问题吗?

好的,要解决这个问题,首先安装最新的Lua包,然后使用此命令编译HaProxy。

make -j $(nproc) USE_NS=1 > USE_TFO=1 > USE_ZLIB=1 > USE_LUA=1 > USE_PCRE=1 > USE_SYSTEMD=1 > USE_LIBCRYPT=1 > USE_THREAD=1 > TARGET=linux-glibc > LUA_INC=/src/lua-5.3.3/include > LUA_LIB=/src/lua-5.3.3/lib

只需勾勒出Lua库的路径并包含目录即可。

最新更新