mirror of
https://github.com/ADD-SP/ngx_waf.git
synced 2026-04-26 14:05:52 +03:00
[GH-ISSUE #81] build error in nginx 1.21.5 PCRE2 #59
Labels
No labels
MacOS
Nginx
OpenResty
Tengine
bug
documentation
enhancement
needs-investigation
pull-request
question
stale
stale
stale
timeout
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ngx_waf#59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ehdud8451 on GitHub (Dec 31, 2021).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/81
in build source
Ubuntu 20.04 LTS
ngx_waf.ngx_waf 10.1.0
nginx -V.nginx 1.21.5
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c: In function ‘_change_modsecurity_pcre_callback’:
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:2412:9: error: ‘pcre_malloc’ undeclared (first use in this function); did you mean ‘realloc’?
2412 | if (pcre_malloc != _modsecurity_pcre_malloc) {
| ^~~~~~~~~~~
| realloc
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:2412:9: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:2416:38: error: ‘pcre_free’ undeclared (first use in this function); did you mean ‘curl_free’?
2416 | _old_modsecurity_pcre_free = pcre_free;
| ^~~~~~~~~
| curl_free
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c: In function ‘_recover_modsecurity_pcre_callback’:
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:2435:9: error: ‘pcre_malloc’ undeclared (first use in this function); did you mean ‘realloc’?
2435 | pcre_malloc = _old_modsecurity_pcre_malloc;
| ^~~~~~~~~~~
| realloc
/usr/local/src/ngx_waf/src/ngx_http_waf_module_config.c:2436:9: error: ‘pcre_free’ undeclared (first use in this function); did you mean ‘curl_free’?
2436 | pcre_free = _old_modsecurity_pcre_free;
| ^~~~~~~~~
| curl_free
make[1]: *** [objs/Makefile:1789: objs/addon/src/ngx_http_waf_module_config.o] Error 1
--
I think error occurred when nginx 1.21.5 use pcre2.
github.com/nginx/nginx@c6fec0b027 (diff-bcb19bf17a)what can i do?
@ADD-SP commented on GitHub (Dec 31, 2021):
Try the branch
current-dev, it might work.@ADD-SP commented on GitHub (Dec 31, 2021):
Solved?
@ehdud8451 commented on GitHub (Dec 31, 2021):
I'm sorry for the late response.
An error was found in connection with this, but I'll check if this is an error related to ngx_waf and reply again.
@ehdud8451 commented on GitHub (Dec 31, 2021):
-ldl -lpthread -lcrypt -lm -Wl,-rpath,/usr/local/modsecurity/lib -l modsecurity -l curl -l sodium -lpcre2-8 /usr/local/src/openssl/.openssl/lib/libssl.a /usr/local/src/openssl/.openssl/lib/libcrypto.a -ldl -lpthread -lz
-Wl,-E
/usr/bin/ld: objs/addon/src/ngx_http_waf_module_config.o: undefined reference to symbol 'pcre_malloc'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpcre.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [objs/Makefile:320: objs/nginx] Error 1
make[1]: Leaving directory '/usr/local/src/nginx/nginx-1.21.5'
make: *** [Makefile:10: build] Error 2
I'm a beginner. I can't check why this error appears. What can I do?
@ADD-SP commented on GitHub (Dec 31, 2021):
It looks like there are some compatibility issues with pcre2, I'll let you know when I fix it.
@ADD-SP commented on GitHub (Jan 1, 2022):
Retry the branch
current-dev:) .@ADD-SP commented on GitHub (Jan 3, 2022):
@ehdud8451 Solved?
@ADD-SP commented on GitHub (Jan 7, 2022):
v10.1.1can now be compiled with PCRE2.