[alibaba/tengine]tengine-2.3.1源码编译安装报错(openssl-1.1.1c)

2024-08-21 483 views
1
Question

源码编译tengine-2.3.1,开启dyups 并且openssl-1.1.1c 无法编译成功

报错内容如下: -o objs/addon/ngx_http_upstream_dyups_module/ngx_http_dyups_module.o \ /tmp/nginxbuild/tengine-2.3.1/modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c cc1: warnings being treated as errors /tmp/nginxbuild/tengine-2.3.1/modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c: In function ‘ngx_http_dyups_set_peer_session’: /tmp/nginxbuild/tengine-2.3.1/modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c:2366: error: implicit declaration of function ‘SSL_get_ref’ make[1]: [objs/addon/ngx_http_upstream_dyups_module/ngx_http_dyups_module.o] Error 1 make[1]: Leaving directory `/tmp/nginxbuild/tengine-2.3.1' make: [build] Error 2

回答

7

vim objs/Makefile CFLAGS = -I/usr/local/LuaJIT/include/luajit-2.0/ -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DNDK_SET_VAR -DNDK_SET_VAR -DNDK_UPSTREAM_LIST -DNDK_SET_VAR -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free

删除:-Werror

之后报错变为: objs/ngx_modules.o \ -L/usr/local/LuaJIT/lib/ -Wl,-E -ldl -lrt -lpthread -lpthread -lcrypt -L/usr/local/LuaJIT/lib/ -lluajit-5.1 -lm -ldl -lpcre /tmp/nginxbuild/openssl-1.1.1c//.openssl/lib/libssl.a /tmp/nginxbuild/openssl-1.1.1c//.openssl/lib/libcrypto.a -ldl -lpthread -lz -lgd /tmp/nginxbuild/jemalloc-5.2.0/lib/libjemalloc.a -lpthread \ -Wl,-E objs/addon/ngx_http_upstream_dyups_module/ngx_http_dyups_module.o: In function ngx_http_dyups_save_peer_session': /tmp/nginxbuild/tengine-2.3.1/modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c:2392: undefined reference toSSL_get_ref' /tmp/nginxbuild/tengine-2.3.1/modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c:2405: undefined reference to SSL_get_ref' objs/addon/ngx_http_upstream_dyups_module/ngx_http_dyups_module.o: In functionngx_http_dyups_set_peer_session': /tmp/nginxbuild/tengine-2.3.1/modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c:2366: undefined reference to SSL_get_ref' collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory/tmp/nginxbuild/tengine-2.3.1' make: *** [build] Error 2

1

编译的时候不编译dyups 一切正常

--add-module=/tmp/nginxbuild/tengine-2.3.1/modules/ngx_http_upstream_dyups_module
2

有大神回复么?是编译方法不对 还是Tengine 对openssl 1.1.1 支持不好??

4

@wangfakang SSL_get_ref 应该是内部 API,开源 openssl 并没有这个

9

收到多谢各位

2

关闭中,已经解决,有问题可以继续评论