Erro ao compilar o nginx com suporte a passageiros

0

Acabei de instalar o passageiro por:

gem install passenger
cd /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2
env NOEXEC_DISABLE=1 /usr/local/rvm/gems/ruby-2.4.0/wrappers/rake nginx:clean nginx RELEASE=yes

Em seguida, editei /etc/apt/sources.list e adicionei:

deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx

Em seguida, apt-get update , cd /var/tmp e apt-get source nginx . Adicionou --add-module=/usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/src/nginx_module \ a debian\rules no lugar certo.

O problema surge quando compilamos o nginx com suporte ao módulo de passageiros:

apt-get build-dep nginx
dpkg-buildpackage -b
-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie -ldl -lpthread -lpthread -lcrypt /var/tmp/ngx_pagespeed-1.12.34.2-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a -lstdc++ -lrt -pthread -lm -lexpat /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Logging.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Exceptions.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Utils/SystemTime.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Utils/StrIntUtils.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Utils/StrIntUtilsNoStrictAliasing.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Utils/IOUtils.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Utils.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/WatchdogLauncher.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/AppTypes.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Utils/CachedFileStat.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/UnionStationFilterSupport.o /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libboost_oxt.a -lstdc++ -lpthread -lm -lrt -lpcre -lssl -lcrypto -ldl -lz -lGeoIP \
-Wl,-E
/usr/bin/ld.bfd.real: /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Logging.o: relocation R_X86_64_32 against '.bss' can not be used when making a shared object; recompile with -fPIC
/usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/buildout/common/libpassenger_common/Logging.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
objs/Makefile:344: recipe for target 'objs/nginx' failed
make[2]: *** [objs/nginx] Error 1
make[2]: Leaving directory '/var/tmp/t/nginx-1.10.3/debian/build-nginx'
Makefile:8: recipe for target 'build' failed
make[1]: *** [build] Error 2
make[1]: Leaving directory '/var/tmp/t/nginx-1.10.3/debian/build-nginx'
debian/rules:60: recipe for target 'build-arch.nginx' failed
make: *** [build-arch.nginx] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Esta é a saída de passenger-config --nginx-addon-dir :

/usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/src/nginx_module

O curioso é que se eu tento compilar o nginx do código-fonte até passenger-install-nginx-module , tudo funciona bem.

De qualquer forma, alguém sabe como posso corrigir esse problema? Para mim, compilar o nginx seguindo o procedimento mencionado é obrigatório. Eu gostaria de poder seguir o procedimento acima ao corrigir o problema.

Obrigado :)

    
por user846226 11.03.2017 / 12:01

1 resposta

0

Por fim, editei /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb e substitui essa linha flags << "-fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED" por flags << "-fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -fPIC" . Em seguida, compilou o passageiro executando o comando de rake anterior, env NOEXEC_DISABLE=1 /usr/local/rvm/gems/ruby-2.4.0/wrappers/rake nginx:clean nginx RELEASE=yes .

    
por 12.03.2017 / 18:16