centos-stream中安装nginx遇到的问题一二

在centos-stream中安装nginx-1.9.15时

遇到在make时遇到如下问题:

在nginx文件夹里执行make命令报错

src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[2] << 16;
         ~~^~~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
     case 2:
     ^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[1] << 8;
         ~~^~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
     case 1:
     ^~~~ 

解决
修改Makefile文件,将Werror字样去掉

[root@localhost fastdfs]# vim ./nginx-1.8.0/objs/Makefile

CFLAGS =  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g 


修改ngx_user.c文件,将cd.current_salt[0] = ~salt[0]注释掉

/* work around the glibc bug */
/* cd.current_salt[0] = ~salt[0]; */

posted @ 2022-12-20 16:41  平凡的人生-野草  阅读(258)  评论(0编辑  收藏  举报