0

I've just installed passenger by:

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

Then edited /etc/apt/sources.list and added:

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

Then apt-get update, cd /var/tmp and apt-get source nginx. Added --add-module=/usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/src/nginx_module \ to debian\rules at the right place.

The problem comes when compiling nginx with passenger module support:

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

This is the output of passenger-config --nginx-addon-dir:

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

The curious thing is if i try to compile nginx from source through passenger-install-nginx-module everything works fine.

Anyway, does any one know how could i fix this issue? For me, compiling nginx following the mentioned procedure is a must. I would like to be able to follow the above procedure while fixing the issue.

Thanks :)

0

Finally i edited /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb and replaced this line flags << "-fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED" by flags << "-fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -fPIC". Then compiled passenger by running the previous rake command, env NOEXEC_DISABLE=1 /usr/local/rvm/gems/ruby-2.4.0/wrappers/rake nginx:clean nginx RELEASE=yes.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.