Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD build broken due to -ldl flag #1805

Closed
clemensg opened this issue Apr 29, 2016 · 8 comments

Comments

Projects
None yet
4 participants
@clemensg
Copy link
Contributor

commented Apr 29, 2016

Question 1: What is the problem?

Building passenger 5.0.28/nginx fails on FreeBSD 10.3-RELEASE with the following error message:

...
c++ -o buildout/support-binaries/PassengerAgent buildout/common/libpassenger_common/Logging.o buildout/common/libpassenger_common/Exceptions.o buildout/common/libpassenger_common/Utils/SystemTime.o buildout/common/libpassenger_common/Utils/StrIntUtils.o buildout/common/libpassenger_common/Utils/StrIntUtilsNoStrictAliasing.o buildout/common/libpassenger_common/Utils/IOUtils.o buildout/common/libpassenger_common/Utils.o buildout/common/libpassenger_common/vendor-modified/modp_b64.o buildout/common/libpassenger_common/jsoncpp.o buildout/common/libpassenger_common/UnionStationFilterSupport.o buildout/common/libpassenger_common/Utils/CachedFileStat.o buildout/common/libpassenger_common/Utils/LargeFiles.o buildout/common/libpassenger_common/MemoryKit/mbuf.o buildout/common/libpassenger_common/MemoryKit/palloc.o buildout/common/libpassenger_common/ServerKit/http_parser.o buildout/common/libpassenger_common/ServerKit/Implementation.o buildout/common/libpassenger_common/DataStructures/LString.o buildout/common/libpassenger_common/Utils/Hasher.o buildout/common/libpassenger_common/AppTypes.o buildout/support-binaries/AgentMain.o buildout/support-binaries/AgentBase.o buildout/support-binaries/WatchdogMain.o buildout/support-binaries/CoreMain.o buildout/support-binaries/CoreApplicationPool.o buildout/support-binaries/CoreController.o buildout/support-binaries/UstRouterMain.o buildout/support-binaries/SystemMetricsMain.o buildout/support-binaries/TempDirToucherMain.o buildout/support-binaries/SpawnPreparerMain.o buildout/common/libboost_oxt.a   buildout/libev/.libs/libev.a  -lm buildout/libuv/.libs/libuv.a  -lrt -lpthread -lkvm -L/usr/local/lib -lcurl -lz -lpthread -lrt -ldl
/usr/bin/ld: cannot find -ldl
c++: error: linker command failed with exit code 1 (use -v to see invocation)
rake aborted!
Command failed with status (1): [c++ -o buildout/support-binaries/PassengerAgent buildout/common/libpassenger_common/Logging.o buildout/common/libpassenger_common/Exceptions.o buildout/common/libpassenger_common/Utils/SystemTime.o buildout/common/libpassenger_common/Utils/StrIntUtils.o buildout/common/libpassenger_common/Utils/StrIntUtilsNoStrictAliasing.o buildout/common/libpassenger_common/Utils/IOUtils.o buildout/common/libpassenger_common/Utils.o buildout/common/libpassenger_common/vendor-modified/modp_b64.o buildout/common/libpassenger_common/jsoncpp.o buildout/common/libpassenger_common/UnionStationFilterSupport.o buildout/common/libpassenger_common/Utils/CachedFileStat.o buildout/common/libpassenger_common/Utils/LargeFiles.o buildout/common/libpassenger_common/MemoryKit/mbuf.o buildout/common/libpassenger_common/MemoryKit/palloc.o buildout/common/libpassenger_common/ServerKit/http_parser.o buildout/common/libpassenger_common/ServerKit/Implementation.o buildout/common/libpassenger_common/DataStructures/LString.o buildout/common/libpassenger_common/Utils/Hasher.o buildout/common/libpassenger_common/AppTypes.o buildout/support-binaries/AgentMain.o buildout/support-binaries/AgentBase.o buildout/support-binaries/WatchdogMain.o buildout/support-binaries/CoreMain.o buildout/support-binaries/CoreApplicationPool.o buildout/support-binaries/CoreController.o buildout/support-binaries/UstRouterMain.o buildout/support-binaries/SystemMetricsMain.o buildout/support-binaries/TempDirToucherMain.o buildout/support-binaries/SpawnPreparerMain.o buildout/common/libboost_oxt.a   buildout/libev/.libs/libev.a  -lm buildout/libuv/.libs/libuv.a  -lrt -lpthread -lkvm -L/usr/local/lib -lcurl -lz -lpthread -lrt -ldl  ]
/usr/local/rvm/gems/ruby-2.3.1/gems/passenger-5.0.28/build/support/cplusplus.rb:52:in `run_compiler'
/usr/local/rvm/gems/ruby-2.3.1/gems/passenger-5.0.28/build/support/cplusplus.rb:116:in `create_cxx_executable'
/usr/local/rvm/gems/ruby-2.3.1/gems/passenger-5.0.28/build/agent.rb:81:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => nginx => nginx_without_native_support => buildout/support-binaries/PassengerAgent
...

Looks like it is trying to link to libdl which is not needed and does not exist on FreeBSD.

Question 2: Passenger version and integration mode:
Open source 5.0.28/nginx 1.10.0

Question 3: OS or Linux distro, platform (including version):
FreeBSD 10.3-RELEASE, x86_64
FreeBSD clang version 3.4.1

Question 4: Passenger installation method:
[x] RubyGems, no Gemfile

Question 5: Your app's programming language (including any version managers) and framework (including versions):
Ruby 2.3.1, RVM, Rails

Question 6: Are you using a PaaS and/or containerization? If so which one?
No!

Question 7: Anything else about your setup that we should know?
No!

@FooBarWidget

This comment has been minimized.

Copy link
Member

commented Apr 30, 2016

@OnixGH I think the LVE patch broke this. The build system should only add -ldl if the system actually has dl. There is a PlatformInfo check for this. If you want to test, the easiest way to spin up a FreeBSD box is probably through Digital Ocean.

@clemensg

This comment has been minimized.

Copy link
Contributor Author

commented Apr 30, 2016

@FooBarWidget If you have an idea what commit should be reverted, I can test it for you.

I tried fixing it myself but I could only find -ldl in uv.gyp, however it is only added conditionally for the Linux and Android build, right?

Can you tell where this flag comes from?

@OnixGH OnixGH added this to the 5.0.29 milestone Apr 30, 2016

@OnixGH

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2016

Reproduced on FreeBSD 10.2 (D.O). I'll have a look at the LVE patch in the light of this later on.

@FooBarWidget

This comment has been minimized.

Copy link
Member

commented Apr 30, 2016

In src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb, method portability_c_or_cxx_ldflags:

result << ' -ldl'

There should be a check there that only adds this flag if there actually is a 'dl' library.

OnixGH pushed a commit that referenced this issue Apr 30, 2016

@clemensg

This comment has been minimized.

Copy link
Contributor Author

commented May 1, 2016

Ah, I searched through that file myself before, but forgot to switch to the stable-5.0 branch, was still at master.... I wondered why there is no -ldl flag ;-)
Anyway, thank you!

Fixed by commit dbc3e41

@CirrusThink

This comment has been minimized.

Copy link

commented Jun 1, 2016

We are having same issue when deploying 5.0.28 enterprise edition, how do we patch this ? FreeBSD 10.3

@CirrusThink

This comment has been minimized.

Copy link

commented Jun 1, 2016

manually patched for now worked

@FooBarWidget

This comment has been minimized.

Copy link
Member

commented Jun 1, 2016

Manually patching is fine for now. We will incorporate this fix in the next release, 5.0.29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.