rbczmq icon indicating copy to clipboard operation
rbczmq copied to clipboard

Ensure linking bundled libraries

Open kou opened this issue 8 years ago • 2 comments

If dependency libraries (czmq, libsodium and zeromq) are already installed in system and they exist in Ruby's library path, rbczmq uses headers of bundled libraries and shared objects of system libraries. Because link command generated by mkmf.rb uses $DEFLIBPATH | $LIBPATH as library search path. $DEFLIBPATH includes Ruby's library path. If dependency libraries already exist in Ruby's library path, they are used instead of bundled libraries.

It causes segmentation fault.

kou avatar May 08 '16 14:05 kou

See also:

  • https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2184
  • https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2256
  • https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2266
  • https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2514

kou avatar May 08 '16 14:05 kou

It seems that https://github.com/SciRuby/iruby/issues/70 is occurred by this problem.

kou avatar May 08 '16 14:05 kou