[GH-ISSUE #112] 错误:无法识别的命令行选项“-fstack-protector-strong” #84

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

Originally created by @ighack on GitHub (Oct 21, 2022).
Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/112

/opt/nginx-1.22.0-src# ./configure --prefix=/opt/nginx-1.22.0-waf --with-threads --with-file-aio --with-http_v2_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --add-module=/opt/ngx_waf

adding module in /opt/ngx_waf
: command not found: line 2: 
: command not found: line 16: 
: command not found: line 31: 
: command not found: line 32: 
: command not found: line 34: 
: command not found: line 36: 
/opt/ngx_waf/config: line 103: syntax error near unexpected token `elif'
'opt/ngx_waf/config: line 103: `elif [ ! -e "${ngx_addon_dir}/src/ngx_http_waf_module_lexer.c" ] ; then
 was configured_module
sed -i 's/^\(CFLAGS.*\)/\1 -fstack-protector-strong -Wno-sign-compare/' objs/Makefile
make
make -f objs/Makefile
make[1]: Entering directory `/opt/nginx-1.22.0-src'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -fstack-protector-strong -Wno-sign-compare -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
		-o objs/src/core/nginx.o \
		src/core/nginx.c
cc1: 错误:无法识别的命令行选项“-fstack-protector-strong”
make[1]: *** [objs/src/core/nginx.o] 错误 1
make[1]: Leaving directory `/opt/nginx-1.22.0-src'
make: *** [build] 错误 2

Originally created by @ighack on GitHub (Oct 21, 2022). Original GitHub issue: https://github.com/ADD-SP/ngx_waf/issues/112 `/opt/nginx-1.22.0-src# ./configure --prefix=/opt/nginx-1.22.0-waf --with-threads --with-file-aio --with-http_v2_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --add-module=/opt/ngx_waf` ``` adding module in /opt/ngx_waf : command not found: line 2: : command not found: line 16: : command not found: line 31: : command not found: line 32: : command not found: line 34: : command not found: line 36: /opt/ngx_waf/config: line 103: syntax error near unexpected token `elif' 'opt/ngx_waf/config: line 103: `elif [ ! -e "${ngx_addon_dir}/src/ngx_http_waf_module_lexer.c" ] ; then was configured_module ``` ``` sed -i 's/^\(CFLAGS.*\)/\1 -fstack-protector-strong -Wno-sign-compare/' objs/Makefile make ``` ``` make -f objs/Makefile make[1]: Entering directory `/opt/nginx-1.22.0-src' cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -fstack-protector-strong -Wno-sign-compare -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \ -o objs/src/core/nginx.o \ src/core/nginx.c cc1: 错误:无法识别的命令行选项“-fstack-protector-strong” make[1]: *** [objs/src/core/nginx.o] 错误 1 make[1]: Leaving directory `/opt/nginx-1.22.0-src' make: *** [build] 错误 2 ```
kerem 2026-03-04 12:18:48 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@ighack commented on GitHub (Oct 21, 2022):

set ff=unix 我在windows下git的

<!-- gh-comment-id:1286409214 --> @ighack commented on GitHub (Oct 21, 2022): set ff=unix 我在windows下git的
Author
Owner

@ighack commented on GitHub (Oct 21, 2022):

重新在linux下clone一个

nginx-1.22.0 下 configure时报下面错

adding module in /opt/ngx_waf
/usr/bin/flex
/usr/bin/bison

./configure: error: the ngx_http_waf_module module requires the following command to be run to generate the necessary files.

    cd /opt/ngx_waf && make && cd /opt/nginx-1.22.0-src

执行下面的命令

cd /opt/ngx_waf && make && cd /opt/nginx-1.22.0-src

bison/parser.yacc:33.20-34: syntax error, unexpected {...}
make: *** [parser] 错误 1
<!-- gh-comment-id:1286409378 --> @ighack commented on GitHub (Oct 21, 2022): 重新在linux下clone一个 nginx-1.22.0 下 configure时报下面错 ``` adding module in /opt/ngx_waf /usr/bin/flex /usr/bin/bison ./configure: error: the ngx_http_waf_module module requires the following command to be run to generate the necessary files. cd /opt/ngx_waf && make && cd /opt/nginx-1.22.0-src ``` 执行下面的命令 ``` cd /opt/ngx_waf && make && cd /opt/nginx-1.22.0-src bison/parser.yacc:33.20-34: syntax error, unexpected {...} make: *** [parser] 错误 1 ```
Author
Owner

@stale[bot] commented on GitHub (Oct 28, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
此 issue 因为最近没有任何活动已经被标记,如果在此之后的一段时间内仍没有任何活动则会被关闭。感谢您对项目的支持。

<!-- gh-comment-id:1295089276 --> @stale[bot] commented on GitHub (Oct 28, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. 此 issue 因为最近没有任何活动已经被标记,如果在此之后的一段时间内仍没有任何活动则会被关闭。感谢您对项目的支持。
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#84
No description provided.