Skip to content

"Make error" on centos 6 #2528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
065191 opened this issue Mar 4, 2021 · 9 comments
Closed

"Make error" on centos 6 #2528

065191 opened this issue Mar 4, 2021 · 9 comments
Assignees

Comments

@065191
Copy link

065191 commented Mar 4, 2021

Describe the bug

make
...
 /bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.  -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL -DWITH_GEOIP -I/usr/include     -I/usr/include  -DWITH_SSDEEP -I/usr/include  -DWITH_LUA -DWITH_LUA_5_1 -I/usr/include -I/usr/include/libxml2 -DWITH_LIBXML2   -g -O2 -MT utils/libmodsecurity_la-regex.lo -MD -MP -MF utils/.deps/libmodsecurity_la-regex.Tpo -c -o utils/libmodsecurity_la-regex.lo `test -f 'utils/regex.cc' || echo './'`utils/regex.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL -DWITH_GEOIP -I/usr/include -I/usr/include -DWITH_SSDEEP -I/usr/include -DWITH_LUA -DWITH_LUA_5_1 -I/usr/include -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT utils/libmodsecurity_la-regex.lo -MD -MP -MF utils/.deps/libmodsecurity_la-regex.Tpo -c utils/regex.cc  -fPIC -DPIC -o utils/.libs/libmodsecurity_la-regex.o
utils/regex.cc: In member function ‘bool modsecurity::Utils::Regex::searchGlobal(const string&, std::vector<modsecurity::Utils::SMatchCapture>&) const’:
utils/regex.cc:150:28: error: ‘PCRE_NOTEMPTY_ATSTART’ was not declared in this scope
             **pcre_options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED;
                            ^~~~~~~~~~~~~~~~~~~~~
utils/regex.cc:150:28: note: suggested alternative: ‘PCRE_NOTEMPTY’
             pcre_options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED;
                            ^~~~~~~~~~~~~~~~~~~~~
                            PCRE_NOTEMPTY**
make[3]: *** [Makefile:3221: utils/libmodsecurity_la-regex.lo] Error 1
make[3]: Leaving directory '/home/ModSecurity/src'
make[2]: *** [Makefile:3473: all-recursive] Error 1
make[2]: Leaving directory '/home/ModSecurity/src'
make[1]: *** [Makefile:1218: all] Error 2
make[1]: Leaving directory '/home/ModSecurity/src'
make: *** [Makefile:1029: all-recursive] Error 1

utils/regex.cc:150:28: error: ‘PCRE_NOTEMPTY_ATSTART’ was not declared in this scope
             **pcre_options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED;
                            ^~~~~~~~~~~~~~~~~~~~~
utils/regex.cc:150:28: note: suggested alternative: ‘PCRE_NOTEMPTY’
             pcre_options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED;
                            ^~~~~~~~~~~~~~~~~~~~~
                            PCRE_NOTEMPTY**

Info
gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)
OS - Centos 6.8
scl enable devtoolset-8 bash
git clone --branch v3/master

On ubuntu assembled without problems. On centos 6 - problems

@065191 065191 changed the title Compile error on centos 6 Make error on centos 6 Mar 4, 2021
@065191 065191 changed the title Make error on centos 6 "Make error" on centos 6 Mar 4, 2021
@065191
Copy link
Author

065191 commented Mar 4, 2021

fix : scl enable devtoolset-2 bash
and new error
Centos 6

utils/geo_lookup.cc: In member function ‘bool modsecurity::Utils::GeoLookup::lookup(const string&, modsecurity::Transaction*, std::function<bool(int, const std::basic_string<char>&)>) const’:
utils/geo_lookup.cc:131:78: error: invalid conversion from ‘const MMDB_s*’ to ‘MMDB_s*’ [-fpermissive]
         r = MMDB_lookup_string(&mmdb, target.c_str(), &gai_error, &mmdb_error);
                                                                              ^
In file included from ../src/utils/geo_lookup.h:22:0,
                 from utils/geo_lookup.cc:25:
/usr/include/maxminddb.h:186:33: error:   initializing argument 1 of ‘MMDB_lookup_result_s MMDB_lookup_string(MMDB_s*, const char*, int*, int*)’ [-fpermissive]
     extern MMDB_lookup_result_s MMDB_lookup_string(MMDB_s *const mmdb,
                                 ^
make[3]: *** [Makefile:3179: utils/libmodsecurity_la-geo_lookup.lo] Error 1

@martinhsv
Copy link
Contributor

Hi @065191 ,

For the first of the two issues that you report, my guess is that your version of pcre is sufficiently out of date that that constant is not defined. I believe the relevant package for CentOS is pcre-devel.

@065191
Copy link
Author

065191 commented Mar 5, 2021

pcre-devel

Package pcre-devel-7.8-7.el6.x86_64 already installed and latest version

@martinhsv martinhsv self-assigned this Mar 5, 2021
@martinhsv
Copy link
Contributor

Hi @065191 ,

From this source: https://www.pcre.org/original/changelog.txt ...

PCRE_NOTEMPTY_ATSTART

... was added to pcre in version 8, which is later than yours. Version 8.00 itself is already very old. If the 7.8 version of pcre that you have is the most recent available via repo, that may be because CentOS 6.8 itself is past end-of-life.

I would suggest upgrading to a supported version of the OS. If for some reason you need to stick with that, you could try upgrading your pcre version manually.

@065191
Copy link
Author

065191 commented Mar 6, 2021

cd /opt
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar -xvzf pcre-8.44.tar.gz
cd pcre-8.44
./configure
make
make install

@liudongmiao
Copy link
Contributor

PCRE_NOTEMPTY_ATSTART
@martinhsv It seems this would be used only for rxGlobal, introduced in 2672db1.
Could you give a reference / documentation for rxGlobal?

@rtomaf
Copy link

rtomaf commented Apr 20, 2023

How about this error: "geo_lookup.cc:131:78: error: invalid conversion from ‘const MMDB_s*’ to ‘MMDB_s*’"?

I have the same issue and can't find the cause.

@065191 were you able to solve it?

@madecto
Copy link

madecto commented May 9, 2023

@rtomaf I encountered the error too while compiling on a CentOS7. Upon further digging I found the problem being tracked in #2254.
Solution is either disable maxminddb for versions of maxmind < 1.4.2 and modsecurity > 3.0.4 or upgrade/downgrade accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants