Repository navigation
Description
Debian 9 AMD64 build fails with four(4) undefined reference to lua_* directives
...
Making all in rules-check
make[3]: Entering directory '/usr/src/build/tekitl/ModSecurity/tools/rules-check'
/bin/bash ../../libtool --tag=CXX --mode=link g++ -g -O2 -fdebug-prefix-map=/usr/src/build/tekitl/ModSecurity=. -fstack-protector-strong -Wformat -
Werror=format-security -Wl,-z,relro -lpcre -L/usr/lib/x86_64-linux-gnu/ -L/usr/lib/x86_64-linux-gnu/ -Wl,-z,relro -lpcre -o modsec-rules-check mods
ec_rules_check-rules-check.o ../../src/.libs/libmodsecurity.la -lcurl -lGeoIP -lmaxminddb -lrt -lxml2 -llmdb -lluajit-5.1 -lpcre -lpcre -lfuzzy -lyaj
l
libtool: link: g++ -g -O2 -fdebug-prefix-map=/usr/src/build/tekitl/ModSecurity=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z -Wl,r
elro -Wl,-z -Wl,relro -o .libs/modsec-rules-check modsec_rules_check-rules-check.o -L/usr/lib/x86_64-linux-gnu/ ../../src/.libs/libmodsecurity.so /usr
/lib/x86_64-linux-gnu/libcurl-gnutls.so -lGeoIP -lmaxminddb -lrt -lxml2 -llmdb -lluajit-5.1 -lpcre -lfuzzy -lyajl -pthread
../../src/.libs/libmodsecurity.so: undefined reference to lua_setglobal' ../../src/.libs/libmodsecurity.so: undefined reference to lua_pcallk'
../../src/.libs/libmodsecurity.so: undefined reference to lua_getglobal' ../../src/.libs/libmodsecurity.so: undefined reference to lua_rawlen'
collect2: error: ld returned 1 exit status
make[3]: *** [modsec-rules-check] Error 1
Makefile:552: recipe for target 'modsec-rules-check' failed
make[3]: Leaving directory '/usr/src/build/tekitl/ModSecurity/tools/rules-check'
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
dh_auto_build: make -j1 returned exit code 2
Makefile:486: recipe for target 'all-recursive' failed
make[2]: Leaving directory '/usr/src/build/tekitl/ModSecurity/tools'
Makefile:1020: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/usr/src/build/tekitl/ModSecurity'
make: *** [binary-arch] Error 2
debian/rules:9: recipe for target 'binary-arch' failed
dpkg-buildpackage: error: fakeroot debian/rules binary-arch gave error exit status 2
Notice: Be carefully to not leak any confidential information.
To Reproduce
git clone https://github.com/SpiderLabs/ModSecurity
wget http://deb.debian.org/debian/pool/main/m/modsecurity/modsecurity_3.0.3-1.debian.tar.xz
tar -C ModSecurity -xvPf modsecurity_3.0.3-1.debian.tar.xz
cd ModSecurity
cat debian/patches/series
disable-network-dependent-tests.patch
(only above patch applied as the other two are obsolete for this newer ModSecurity)
dpkg-buildpackage -F -us -uc -j1 -T binary-arch,binary-indep
Expected behavior
I expected to generate at least a couple of debian 9 stretch-backports ModSecurity packages.
Server (please complete the following information):
Linux xiuhcohuatl 4.20.0-1+reiser4.0.2-amd64 #1 SMP Debian 4.20.13-1+reiser4.0.2 (2018-12-26) x86_64 GNU/Linux
Thanks
Activity
victorhora commentedon Mar 5, 2019
Hi @Metztli,
These error messages related with Lua:
Suggests that the configure script failed to select the proper libLua src/headers and it might be trying to compile with a given feature (e.g. JIT) that is not present.
I suggest checking for the version of libLua installed. You may have issues if you have multiple versions of it installed.
Do you get different results If you try compile without using dpkg-buildpackage, but actually running
makeyourself?Metztli commentedon Mar 6, 2019
Niltze, @victorhora-
Thank you for the lua -related hints. I made sure to install/leave only latest and gave the build one more try. Unlike yesterday (where I spent considerable time online searching for a similar error and thus a proper solution) this time build succeeded.
If interested in the log of the build:
https://metztli.it/blog/index.php/amatl/aO0
Once again, thanks Victor.
Best Professional Regards.
bbrendon commentedon Jul 21, 2021
@Metztli can you elaborate on how you resolved this? Did you install an lua package? what do you mean by leave only latest?
Metztli commentedon Jul 21, 2021
If your build is failing, make sure to read the note at the very end of my reply.
Yet, if you need a hint on requirements prior to build ModSecurity 3...
@bbrendon
i.e.:
We fetch Debian packaging for ModSecurity 3 XZ compressed TAR archive, either for Buster, Bullseye, or Sid, from https://packages.debian.org/buster/libmodsecurity3
For instance, we select for Debian 10 Buster stable distribution:
http://deb.debian.org/debian/pool/main/m/modsecurity/modsecurity_3.0.3-1+deb10u2.debian.tar.xz
If you untar the above and view debian/control file, please observe the Build-Depends to fulfill requirements, with liblua5.3-dev (latest for Debian 10 [codename Buster]) being one of those dependencies.
Nginx at Metztli IT: ModSecurity v3 module, Engine X v1.15.9, and libmodsecurity3 Connector, Integrated Hack.
[1] with root privilege,
apt-get purge libluajit-5.1-devGood luck!
airween commentedon Jul 21, 2021
Just for the record: if you want to use libmodsecurity3 (and optionally Nginx), you can use this repository.
I try to keep up-to-date all packages (especially now I'm a bit late for all distrib, except Debian 10, which is up-to-date)