Details
-
Type:
Task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.5
-
Fix Version/s: JRuby 1.5
-
Component/s: None
-
Labels:None
-
Number of attachments :5
Description
The current release of jffi bundled with JRuby has binaries for Darwin (all arches), i386-Linux, x86_64-Linux, i386-Windows, x86_64-Windows. It might be useful to have binary builds for more esoteric platforms like i386-FreeBSD and x86_64-FreeBSD.
To build jffi, do something like:
git clone git://github.com/wmeissner/jffi.git jffi.git cd jffi.git git checkout 1.0.0 ant jar test cp dist/jffi-x86_64-FreeBSD.jar /path/to/jruby/build_lib/ cd /path/to/jruby ant clean test
The resulting dist/jffi-$CPU-$OS.jar file could also be attached to this issue, and someone could commit it to jruby.
-
Hide
- jffi-x86_64-FreeBSD.jar
- 08/Apr/10 2:13 AM
- 22 kB
- Vlad Galu
-
- META-INF/MANIFEST.MF 0.1 kB
- jni/x86_64-FreeBSD/libjffi-1.0.so 64 kB
-
Hide
- jffi-ppc-Linux.jar
- 28/May/10 11:38 AM
- 27 kB
- Antoine Toulme
-
- META-INF/MANIFEST.MF 0.1 kB
- jni/ppc-Linux/libjffi-1.0.so 79 kB
-
Hide
- jffi-i386-SunOS.jar
- 09/Jul/10 1:02 AM
- 20 kB
- Neil Brennan
-
- META-INF/MANIFEST.MF 0.1 kB
- jni/i386-SunOS/libjffi-1.0.so 53 kB
-
Hide
- jffi-Darwin.jar
- 17/Apr/10 12:01 AM
- 18 kB
- Adam Gardner
-
- META-INF/MANIFEST.MF 0.1 kB
- jni/Darwin/libjffi-1.0.jnilib 60 kB
-
Hide
- jffi.zip
- 06/May/10 12:29 AM
- 331 kB
- Jean-Dominique Morani
-
- jffi-complete.jar 232 kB
- jffi.jar 85 kB
- jffi-ppc-AIX.jar 36 kB
Activity
Thanks Vlad, we already have amd64/x86_64 FreeBSD stubs ... unless they don't work on 8.0 with the diablo-jdk.
Can you test that the existing binaries in 1.5.0.dev work or not under your setup?
The best way to find out, is to checkout the latest ruby-ffi from github.com/ffi/ffi, build the testlib (either 'rake test' or 'rake build/libtest.so'), and run jruby against it via:
/path/to/jruby/bin/jruby -S spec spec/ffi
You might also need to install the 'rspec' gem under jruby.
This is a jffi-Darwin.jar build from a PowerPC Mac. Specifically, a G5 iMac running OS X 10.4.11, with Java 1.5.
I added an updated jffi-Darwin.jar that combines the ppc, i386, x86_64 jni stubs into a single binary in commit f4f572ede5c0c633fbdd15af597b470eed37153c. Seems to pass all tests on x86_64, but needs testing.
Wayne: Does this mean that PPC support is back in the release? If so, I know a lot of Darwin-PPC users that will be happy ![]()
If I cherry-pick f4f572ede5c0c633fbdd15af597b470eed37153c to jruby-1_5, is that all I need to do?
Yes it should be all there in that commit.
(and you know a lot of ppc-darwin users? I thought there was only two left).
Well, no, I guess not a lot
But I know of at least three that are also JRuby users.
Cherry-picked to jruby-1_5 branch in 4ef46e7.
All set for release. There's another bug that's been traced back to the PPC re-addition commit, but we'll deal with it there.
Thanks, Jean-Dominique! I've rolled your AIX build into master in 2dd322a and jruby-1_5 in 90c5dad.
I thought I was done with this stuff when I build linux-ppc for 1.4.
I tried again and all tests fail over this:
[junit] Test com.kenai.jffi.StructTest FAILED
[junit] Testsuite: com.kenai.jffi.TypeTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.25 sec
[junit]
[junit] Testcase: lookupBuiltinType(com.kenai.jffi.TypeTest): Caused an ERROR
[junit] Could not locate stub library (/jni/ppc64-Linux/libjffi-1.0.so) in jar file
[junit] java.lang.UnsatisfiedLinkError: Could not locate stub library (/jni/ppc64-Linux/libjffi-1.0.so) in jar file
[junit] at com.kenai.jffi.Init.getStubLibraryStream(Init.java:150)
[junit] at com.kenai.jffi.Init.loadFromJar(Init.java:115)
[junit] at com.kenai.jffi.Init.load(Init.java:64)
[junit] at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:35)
[junit] at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:31)
[junit] at java.lang.J9VMInternals.initializeImpl(Native Method)
[junit] at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
[junit] at com.kenai.jffi.Foreign.getInstance(Foreign.java:81)
[junit] at com.kenai.jffi.TypeTest.lookupBuiltinType(TypeTest.java:46)
It looks like jruby complains in particular that there is no library for pcc64:
/shared/common/jruby-1.5.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require': Could not load FFI Provider: FFI not available: Could not locate stub library (/jni/ppc64-Linux/libjffi-1.0.so) in jar file (LoadError)
I can't remember how to force jruby to work in 32 bit mode. I'll try with a different JVM. I'm ok with creating the 64 bit libs if that's of interest.
I rebuilt with a 32 bit JVM and attached the results here for your convenience. I don't know if the .so file needs updating with 1.5. The old ppc .so file seems to still be working.
I get a segmentation fault at the end of the program execution right now. I will report if it's annoying or occurring right when exiting.
Here is the log I get when running ant jar test over jffi for linux 64 bit pcc:
http://gist.github.com/417581
I hope it helps.
Antoine, make sure you're using the latest jffi master source, not the 1.0.0 tag for ppc64-linux builds - I remember last time we messed about with ppc-linux, we needed to tweak the Makefile, and that would be post 1.0.0.
From your logs, it looks like even on ppc64, its assuming the build is 32bit, so just check in jni/Makefile that it has a testcase for ppc64 that sets MODEL = 64.
btw, I thought we shipped 32bit ppc-linux support in jruby-1.5? (i.e. the binary you built months ago). Does it not work?
If I'm understanding right, the 32-bit linux ppc FFI works ok, but on whatever system Antoine is using it's running under a 64-bit JVM.
Antoine: Except on OS X, which has "fat" binaries, the only way to make any Java app run in 32 or 64 bit mode is to run them with a 32 or 64-bit JVM to begin with. I suspect you're either running the build with a 64-bit JVM or Ant is forking and picking up the wrong JVM.
Compiling this is a ghastly experience no one else should have to suffer. In particular, Solaris does not provide libxslt.so out of the box. Once you install it (and all its dependencies) you may need to modify your LD_LIBRARY_PATH. We sourced libxslt.so from http://www.sunfreeware.com/indexintel10.html
We already have builds for:
i386-linux
i386-freebsd
i386-darwin
i386-windows
x86_64-linux
x86_64-freebsd
x86_64-darwin
x86_64-windows
ppc-linux
sparc-sunos (Solaris 32bit)
sparcv9-sunos (Solaris 64bit)
You can check if your arch has a build by looking at the archive/jffi-$CPU-$OS.jar file. If it does not exist, or does not have a libjffi-1.0.so in it, then it needs a rebuild for jffi 1.0
Note: ppc-darwin is not supported - to build, you require a leopard (10.5) machine of i386 or x86_64 arch, and a patch to the jffi makefile. If someone cares enough to build it, let me know.