Project

General

Profile

Bug #8455

Linking one Ruby extension to another Ruby extension with mkmf

Added by steved (Steve Dierker) over 7 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
[ruby-core:55180]

Description

The problem lies within 'mkmf' of ruby.
If we have a gem which contains a native extension consisting of two libraries called 'libfail' and 'good' in C/C++ and both of these libraries have Ruby extensions it is not possible to compile and link them against each other without patching 'mkmf.rb'.
A sample git-repository is here: https://github.com/FlavourSys/ruby-native-extension-bug

If we call 'rake compile' it terminates with an error, because 'find_library' of 'mkmf' is not able to link against 'libfail'. The problem is that the 'ruby-static' libraries are added as g++ option before 'libfail' is.

A simple monkey patch is provided in the git repository. The solution is to just change the order of arguments for the compiler.


Files

mkmf.log (4.9 KB) mkmf.log steved (Steve Dierker), 05/28/2013 01:40 AM

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Open to Rejected

It's a known limitation.
Reference between dynamically loaded libraries is not portable.

Also available in: Atom PDF