首页 > 其他分享 >tengine 编译错误

tengine 编译错误

时间:2022-09-01 17:58:26浏览次数:47  
标签:http 错误 lua -- module 编译 tengine ngx usr

操作系  CentOS Linux release 8
tengine版本:tengine-2.3.3

安骤:
1、创建nginx用户
useradd -s /sbin/nologin -r nginx
2、安装依赖
yum -y install gcc pcre-devel openssl-devel zlib-devel perl-ExtUtils-Embed
3. 编译:

 ./configure --prefix=/data/nginx --sbin-path=/usr/bin/ --user=www --group=www --with-select_module --without-select_module --with-poll_module --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module  --with-http_image_filter_module  --with-http_sub_module --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module --with-stream --with-stream_ssl_module --with-stream_realip_module   --with-stream_ssl_preread_module --with-compat --with-pcre --with-http_lua_module  --with-luajit-inc=/usr/local/include/luajit-2.1/ --with-lua-inc=/usr/local/include/luajit-2.1/ --with-lua-lib=/usr/local/lib  --with-luajit-lib=/usr/local/lib --add-module=./modules/ngx_http_upstream_check_module/ --add-module=./modules/ngx_http_reqstat_module --add-module=./modules/ngx_http_upstream_consistent_hash_module --add-module=./modules/ngx_http_upstream_session_sticky_module/ --add-module=./modules/ngx_http_upstream_dyups_module/ --add-module=./modules/ngx_http_upstream_dynamic_module/ 

################

报错信息:

str1.1' can not be used when making a PIE object; recompile with -fPIC

/usr/bin/ld: objs/addon/src/ngx_http_lua_ssl_ocsp.o: relocation R_X86_64_32S against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: objs/addon/src/ngx_http_lua_balancer.o: relocation R_X86_64_32 against symbol `ngx_http_lua_traceback' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: objs/addon/src/ngx_http_lua_ssl_session_storeby.o: relocation R_X86_64_32 against symbol `ngx_http_lua_traceback' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: objs/addon/src/ngx_http_lua_ssl_session_fetchby.o: relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: objs/addon/src/ngx_http_lua_ssl.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[1]: *** [objs/Makefile:393: objs/nginx] Error 1
make[1]: Leaving directory '/root/tengine-2.3.3'
make: *** [Makefile:8: build] Error 2

 

 

解决办法:

cd tengine-2.3.3

vim objs/Makefile 
在CFLAGS后面加上-fPIC,如下:
CFLAGS = -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -fPIC

标签:http,错误,lua,--,module,编译,tengine,ngx,usr
From: https://www.cnblogs.com/webnginx/p/16647361.html

相关文章