JRuby is hardcoded to use '-mmacos-version-min=10.4' which is not compatible 
with '-rpath' being used
-----------------------------------------------------------------------------------------------------

                 Key: JRUBY-6199
                 URL: https://jira.codehaus.org/browse/JRUBY-6199
             Project: JRuby
          Issue Type: Bug
          Components: C Extensions
    Affects Versions: JRuby 1.6.5
         Environment: matt@foo:~/Projects/personal $ uname -a
Darwin foo 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 2011; 
root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

matt@foo:~/Projects/personal $ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) 
(LLVM build 2335.15.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

matt@foo:~/Projects/personal $ jruby --version
jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (Java HotSpot(TM) 64-Bit 
Server VM 1.6.0_26) [darwin-x86_64-java]
            Reporter: Matthew Denner
            Assignee: Thomas E Enebo
            Priority: Minor


I installed JRuby 1.6.5 using rvm and then tried to do 'gem install mysql2'.  
Unfortunately as I'm running an up-to-date XCode the native extension cannot be 
built because of '-rpath' being used.  The full output is included after this 
description.

The problem is due to '-mmacos-version-min=10.4' being set in the JRuby source 
code.  I've forked the git repo and submitted a pull request 
(https://github.com/jruby/jruby/pull/98) that simply updates the value of this 
to 10.5.  I have compiled JRuby using this change and managed to install the 
mysql2 gem with it.  It might not be the ideal solution but it certainly solves 
this problem.

The full error from 'gem install mysql2':

Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

        /Users/matt/.rvm/rubies/jruby-1.6.5/bin/jruby extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very 
well.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
checking for rb_thread_blocking_region()... checking for 
rb_wait_for_single_fd()... no
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile

make
cc -I. -I. -I/Users/matt/.rvm/rubies/jruby-1.6.5/lib/native/include/ruby -I. 
-DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_MYSQL_H -DHAVE_ERRMSG_H 
-DHAVE_MYSQLD_ERROR_H  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE        
-I/usr/local/mysql/include  -Os -g -fno-common -fno-strict-aliasing -arch 
x86_64 -fPIC -DTARGET_RT_MAC_CFM=0  -fno-omit-frame-pointer 
-fno-strict-aliasing  -fexceptions   -Wall -funroll-loops  -arch x86_64 -c 
client.c
cc -I. -I. -I/Users/matt/.rvm/rubies/jruby-1.6.5/lib/native/include/ruby -I. 
-DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_MYSQL_H -DHAVE_ERRMSG_H 
-DHAVE_MYSQLD_ERROR_H  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE        
-I/usr/local/mysql/include  -Os -g -fno-common -fno-strict-aliasing -arch 
x86_64 -fPIC -DTARGET_RT_MAC_CFM=0  -fno-omit-frame-pointer 
-fno-strict-aliasing  -fexceptions   -Wall -funroll-loops  -arch x86_64 -c 
mysql2_ext.c
cc -I. -I. -I/Users/matt/.rvm/rubies/jruby-1.6.5/lib/native/include/ruby -I. 
-DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_MYSQL_H -DHAVE_ERRMSG_H 
-DHAVE_MYSQLD_ERROR_H  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE        
-I/usr/local/mysql/include  -Os -g -fno-common -fno-strict-aliasing -arch 
x86_64 -fPIC -DTARGET_RT_MAC_CFM=0  -fno-omit-frame-pointer 
-fno-strict-aliasing  -fexceptions   -Wall -funroll-loops  -arch x86_64 -c 
result.c
cc -dynamic -bundle -undefined dynamic_lookup  -o mysql2.bundle client.o 
mysql2_ext.o result.o -L"." -L"/Users/matt/.rvm/rubies/jruby-1.6.5/lib" -bundle 
-framework JavaVM -Wl,-syslibroot, -mmacosx-version-min=10.4  
-Wl,-rpath,/usr/local/mysql/lib  -arch x86_64  -L/usr/local/mysql/lib 
-lmysqlclient_r   -lpthread   
ld: -rpath can only be used when targeting Mac OS X 10.5 or later
collect2: ld returned 1 exit status
make: *** [mysql2.bundle] Error 1


Gem files will remain installed in 
/Users/matt/.rvm/gems/jruby-1.6.5/gems/mysql2-0.3.8 for inspection.
Results logged to 
/Users/matt/.rvm/gems/jruby-1.6.5/gems/mysql2-0.3.8/ext/mysql2/gem_make.out

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to