tengine2.2.2 build fails when using gcc8.1.1 compiler under Fedora28 system

2fjabf4q  于 4个月前  发布在  其他
关注(0)|答案(5)|浏览(107)

Example make error:

src/os/unix/ngx_user.c: In function ‘ngx_libc_crypt’:
src/os/unix/ngx_user.c:37:7: error: ‘struct crypt_data’ has no member named ‘current_salt’
cd.current_salt[0] = ~salt[0];
^
make[1]: *** [objs/Makefile:826: objs/src/os/unix/ngx_user.o] Error 1
make[1]: Leaving directory '/usr/local/src/tengine'
make: *** [Makefile:8: build] Error 2

Attach another Bug that has found a solution( https://trac.nginx.org/nginx/ticket/1259):

src/core/ngx_murmurhash.c
src/core/ngx_murmurhash.c: In function ‘ngx_murmur_hash2’:
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:
^~~~

bweufnob

bweufnob1#

Compilation parameters:
./configure --prefix=/usr/local/tengine --user=tengine --group=tengine --with-threads --with-file-aio --with-force-exit --with-mail --with-pcre-jit --with-libatomic --http-log-path=/usr/local/tengine/logs/access.log --with-google_perftools_module --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_concat_module

3vpjnl9f

3vpjnl9f2#

I accidentally modified a variable name. As a result, this file is compiled without error. Although I can't figure out the reason, I hope that "Dalao" can answer this question for me.

before change:
#ifdef GLIBC
/* work around the glibc bug */
cd.current_salt[0] = ~salt[0];
#endif

after change:
#ifdef GLIBC
/* work around the glibc bug */
cd.current_salt[0] = ~salt[0];
#endif

guz6ccqo

guz6ccqo3#

Problems come one after another[/Beat table]:

src/http/ngx_http_script.c: In function ‘ngx_http_script_add_copy_code’:
src/http/ngx_http_script.c:696:18: error: cast between incompatible function types from ‘size_t (*)(ngx_http_script_engine_t )’ {aka ‘long unsigned int ()(struct )’} to ‘void ()(ngx_http_script_engine_t )’ {aka ‘void ()(struct )’} [-Werror=cast-function-type]
code->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
^
src/http/ngx_http_script.c: In function ‘ngx_http_script_add_var_code’:
src/http/ngx_http_script.c:785:18: error: cast between incompatible function types from ‘size_t (
)(ngx_http_script_engine_t )’ {aka ‘long unsigned int ()(struct )’} to ‘void ()(ngx_http_script_engine_t )’ {aka ‘void ()(struct )’} [-Werror=cast-function-type]
code->code = (ngx_http_script_code_pt) ngx_http_script_copy_var_len_code;
^
src/http/ngx_http_script.c: In function ‘ngx_http_script_add_capture_code’:
src/http/ngx_http_script.c:1179:18: error: cast between incompatible function types from ‘size_t (
)(ngx_http_script_engine_t )’ {aka ‘long unsigned int ()(struct )’} to ‘void ()(ngx_http_script_engine_t )’ {aka ‘void ()(struct )’} [-Werror=cast-function-type]
code->code = (ngx_http_script_code_pt)
^
src/http/ngx_http_script.c: In function ‘ngx_http_script_add_full_name_code’:
src/http/ngx_http_script.c:1294:18: error: cast between incompatible function types from ‘size_t (
)(ngx_http_script_engine_t )’ {aka ‘long unsigned int ()(struct )’} to ‘void ()(ngx_http_script_engine_t )’ {aka ‘void ()(struct *)’} [-Werror=cast-function-type]
code->code = (ngx_http_script_code_pt) ngx_http_script_full_name_len_code;

1tu0hz3e

1tu0hz3e4#

@AlbertGandolf the problem that has been fixed here #1007 thx.

o2gm4chl

o2gm4chl5#

@wangfakang Hello, respected developer.As mentioned above,I have solved the issue you mentioned with reference to the solution you gave. But then there were two new problems,I hope you can take the time to solve it.Thanks.

相关问题