I tried to build Suricata to link with Lua-5.4.3. However, there are a lot of undefined reference errors returning. For examples:
output-lua.o: In function ‘LuaStatsLogger’:
output-lua.c:385: undefined reference to ‘lua_getglobal’
ouput-lua.c:495: undefined reference to ‘lua_pcallk’
From what I understand, Suri Makefile is hardcoded to expect Lua-5.1. On Ubuntu (20.04, maybe), locally, I know that @sbhardwaj has made it work, with some changes to said Makefile.
Can you tell us: are you building Suri from master? How did you link it to Lua-5.4.3?
Unfortunately, there are a lot of undefined reference errors returning, such as the following.
output-lua.o: In function LuaStatsLogger': /local_home/suricata-5.0.7/src/output-lua.c:385: undefined reference to lua_getglobal’
/local_home/suricata-5.0.7/src/output-lua.c:419: undefined reference to lua_pcallk' output-lua.o: In function LuaFlowLogger’:
/local_home/suricata-5.0.7/src/output-lua.c:364: undefined reference to lua_getglobal' /local_home/suricata-5.0.7/src/output-lua.c:366: undefined reference to lua_pcallk’
output-lua.o: In function LuaFileLogger': /local_home/suricata-5.0.7/src/output-lua.c:334: undefined reference to lua_getglobal’
/local_home/suricata-5.0.7/src/output-lua.c:336: undefined reference to lua_pcallk' output-lua.o: In function LuaPacketLogger’:
/local_home/suricata-5.0.7/src/output-lua.c:278: undefined reference to lua_getglobal' /local_home/suricata-5.0.7/src/output-lua.c:287: undefined reference to lua_pcallk’
output-lua.o: In function LuaPacketLoggerAlerts': /local_home/suricata-5.0.7/src/output-lua.c:229: undefined reference to lua_pcallk’
/local_home/suricata-5.0.7/src/output-lua.c:214: undefined reference to lua_getglobal' output-lua.o: In function LuaTxLogger’:
/local_home/suricata-5.0.7/src/output-lua.c:114: undefined reference to lua_getglobal' /local_home/suricata-5.0.7/src/output-lua.c:118: undefined reference to lua_pcallk’
output-lua.o: In function LuaStreamingLogger': /local_home/suricata-5.0.7/src/output-lua.c:159: undefined reference to lua_getglobal’
/local_home/suricata-5.0.7/src/output-lua.c:159: undefined reference to lua_getglobal' /local_home/suricata-5.0.7/src/output-lua.c:165: undefined reference to lua_pcallk’
output-lua.o: In function LuaScriptSetup': /local_home/suricata-5.0.7/src/output-lua.c:614: undefined reference to luaL_loadfilex’
/local_home/suricata-5.0.7/src/output-lua.c:624: undefined reference to lua_pcallk' /local_home/suricata-5.0.7/src/output-lua.c:629: undefined reference to lua_getglobal’
/local_home/suricata-5.0.7/src/output-lua.c:642: undefined reference to lua_pcallk' output-lua.o: In function LuaScriptInit’:
/local_home/suricata-5.0.7/src/output-lua.c:468: undefined reference to luaL_loadfilex' /local_home/suricata-5.0.7/src/output-lua.c:478: undefined reference to lua_pcallk’
/local_home/suricata-5.0.7/src/output-lua.c:483: undefined reference to lua_getglobal' /local_home/suricata-5.0.7/src/output-lua.c:499: undefined reference to lua_pcallk’
/local_home/suricata-5.0.7/src/output-lua.c:561: undefined reference to `lua_getgloba
When I try to link Lua library like that, it doesn’t work for me either, meaning that I also get lots of undefined references when I try to build Suri.
I did manage to make it work, though, by editing configure.ac and replacing all mentions to Lua 5.1 (the default dependency, as per Suri documentation) for Lua 5.3, before running ./configure again. After that, I finally managed to compile Suricata without undefined reference errors.
So, my conclusion is that Suri does support newer versions of Lua (in my case, tested with Ubuntu 20.04 and Lua 5.3), but, as it is hardcoded to expect Lua 5.1, just passing a different version via command-line doesn’t suffice. Unless you manually change the file, it probably won’t work!