我目前正在尝试使用以下命令在arch Linux发行版上通过luajit支持编译suricata(http://suricata-ids.org/):

./configure --enable-luajit --with-libpcap-includes=/usr/local/pfring/include \
--with-libpcap-libraries=/usr/local/pfring/lib --with-libnss-libraries=/usr/lib \
--with-libnss-includes=/usr/include/nss/ --with-libnspr-libraries=/usr/lib \
--with-libnspr-includes=/usr/include/nspr \
--with-libluajit-includes=/usr/local/include/luajit-2.0/ \
--with-libluajit-libraries=/usr/lib/

然后:
make

但是在制作项目时出现以下错误:
detect-luajit.o: In function `LuaDumpStack':
detect-luajit.c:(.text+0x46e): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitMatchBuffer':
detect-luajit.c:(.text+0x5d6): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0x6b9): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0x7d5): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitMatch':
detect-luajit.c:(.text+0xaac): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0xde4): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0xf00): undefined reference to `lua_tonumberx'
detect-luajit.o: In function `DetectLuajitThreadInit':
detect-luajit.c:(.text+0x1864): undefined reference to `lua_pcallk'
detect-luajit.o: In function `DetectLuaSetupPrime':
detect-luajit.c:(.text+0x1fe7): undefined reference to `lua_pcallk'
detect-luajit.c:(.text+0x2167): undefined reference to `lua_getglobal'
detect-luajit.c:(.text+0x24bf): undefined reference to `lua_pcallk'
collect2: error: ld returned 1 exit status
make[2]: *** [suricata] Error 1

我首先虽然是来自lua版本的问题。因此,我尝试同时安装lua 5.1.5和5.2.2,也重新构建了库和符号链接(symbolic link),但没有任何效果。
谢谢你的帮助

最佳答案

在Debian和Ubuntu中,库文件安装在/usr/lib/x86_64-linux-gnu/中。如果arch执行相同的操作,则您的配置行应包括:--with-libluajit-libraries =/usr/lib/x86_64-linux-gnu/

关于compilation - Suricata Luajit编译错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19339674/

10-10 16:45