mirror of
https://github.com/ADD-SP/ngx_waf.git
synced 2026-04-26 14:05:52 +03:00
[GH-ISSUE #78] tengine静态编译出错 #57
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#57
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 @prprpr on GitHub (Dec 15, 2021).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/78
报错日志如下:
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -std=gnu99 -fstack-protector-strong -Wno-sign-compare -fstack-protector-strong -Wno-sign-compare -I src/core -I src/event -I src/event/modules -I src/os/unix -I src/proc -I ../openssl-1.1.1m/.openssl/include -I objs -I src/http -I src/http/modules -I src/http/v2 -I ../ngx_waf-10.1.0/inc -I ../ngx_waf-10.1.0/lib -I /usr/local/modsecurity/include -I ../ngx_waf-10.1.0/lib/uthash/include -I src/stream
-o objs/addon/src/ngx_http_waf_module_lru_cache.o
../ngx_waf-10.1.0/src/ngx_http_waf_module_lru_cache.c
In file included from ../ngx_waf-10.1.0/inc/ngx_http_waf_module_config.h:18:0,
from ../ngx_waf-10.1.0/src/ngx_http_waf_module_config.c:1:
../ngx_waf-10.1.0/src/ngx_http_waf_module_config.c: In function ‘ngx_http_waf_captcha_conf’:
../ngx_waf-10.1.0/inc/ngx_http_waf_module_macro.h:359:33: error: the comparison will always evaluate as ‘false’ for the address of ‘sitekey’ will never be NULL [-Werror=address]
#define ngx_is_null_str(s) ((s) == NULL || (s)->data == NULL || (s)->len == 0 || ((s)->data[0] == '\0' && (s)->len == 1))
^
../ngx_waf-10.1.0/src/ngx_http_waf_module_config.c:823:13: note: in expansion of macro ‘ngx_is_null_str’
if (ngx_is_null_str(&sitekey)) {
^
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -std=gnu99 -fstack-protector-strong -Wno-sign-compare -fstack-protector-strong -Wno-sign-compare -I src/core -I src/event -I src/event/modules -I src/os/unix -I src/proc -I ../openssl-1.1.1m/.openssl/include -I objs -I src/http -I src/http/modules -I src/http/v2 -I ../ngx_waf-10.1.0/inc -I ../ngx_waf-10.1.0/lib -I /usr/local/modsecurity/include -I ../ngx_waf-10.1.0/lib/uthash/include -I src/stream
-o objs/addon/src/ngx_http_waf_module_mem_pool.o
../ngx_waf-10.1.0/src/ngx_http_waf_module_mem_pool.c
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_waf_module_config.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/data/installer/tengine-2.3.3'
make: *** [build] Error 2
@ADD-SP commented on GitHub (Dec 15, 2021):
gcc 的版本是不是比较低,似乎数据流分析和测试用的版本行为不一样。
解决方法是运行完
configure脚本后手动编辑objs/Makefile,在开头为CFLAGS那一行中删除-Werror,然后再编译。@prprpr commented on GitHub (Dec 15, 2021):
按大佬说的解决了,那就是centos7 yum包太旧的锅 Package gcc-4.8.5-44.el7.x86_64 already installed and latest version,谢谢