[GH-ISSUE #78] tengine静态编译出错 #57

Closed
opened 2026-03-04 12:18:31 +03:00 by kerem · 2 comments
Owner

Originally created by @prprpr on GitHub (Dec 15, 2021).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/78

报错日志如下:

../ngx_waf-10.1.0/src/ngx_http_waf_module_ip_trie.c

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

Originally created by @prprpr on GitHub (Dec 15, 2021). Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/78 报错日志如下: ../ngx_waf-10.1.0/src/ngx_http_waf_module_ip_trie.c 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
kerem 2026-03-04 12:18:31 +03:00
Author
Owner

@ADD-SP commented on GitHub (Dec 15, 2021):

gcc 的版本是不是比较低,似乎数据流分析和测试用的版本行为不一样。

解决方法是运行完 configure 脚本后手动编辑 objs/Makefile,在开头为 CFLAGS 那一行中删除 -Werror,然后再编译。

<!-- gh-comment-id:994542617 --> @ADD-SP commented on GitHub (Dec 15, 2021): gcc 的版本是不是比较低,似乎数据流分析和测试用的版本行为不一样。 解决方法是运行完 `configure` 脚本后手动编辑 `objs/Makefile`,在开头为 `CFLAGS` 那一行中删除 `-Werror`,然后再编译。
Author
Owner

@prprpr commented on GitHub (Dec 15, 2021):

按大佬说的解决了,那就是centos7 yum包太旧的锅 Package gcc-4.8.5-44.el7.x86_64 already installed and latest version,谢谢

<!-- gh-comment-id:994561088 --> @prprpr commented on GitHub (Dec 15, 2021): 按大佬说的解决了,那就是centos7 yum包太旧的锅 Package gcc-4.8.5-44.el7.x86_64 already installed and latest version,谢谢
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ngx_waf#57
No description provided.