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

[Truffle] Begin Sulong integration #3800

Merged
merged 22 commits into from
Apr 13, 2016
Merged

Conversation

chrisseaton
Copy link
Contributor

Adds a command jruby-cext-c to compile C extensions.

Loads Sulong modules and calls the Init_ method.

Example:

$ bin/jruby bin/jruby-cext-c test/truffle/cexts/minimum
$ jt run --sulong -Itest/truffle/cexts/minimum/lib test/truffle/cexts/minimum/bin/minimum

At the moment none of the C API is supported, and there is some bug that stops printf working from the Init_ method, so it's hard to see that anything is happening, but it is!

You need Sulong, obviously. Depends on graalvm/sulong#150.

@mrigger @nirvdrum @pitr-ch @eregon


MX_DIR = ENV['MX_DIR']

if MX_DIR.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless MX_DIR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same below)

@eregon
Copy link
Member

eregon commented Apr 13, 2016

What does the final c in bin/jruby-cext-c means? compile? Should it be cc so we relate by name to the standard C compiler? Maybe it could also be jruby-cext-make, as standard workflow to compile a C-ext is: cd ext/dir; ruby extconf.rb; make;.

@chrisseaton
Copy link
Contributor Author

Yes it means JRuby's C extension compiler. I didn't call it 'cc' as it'll need to be able to compile C++ as well. Do people use other languages as well? make might be a better idea. Hopefully this isn't for the long term though, as we should modify the rake plugin at some point.

@nirvdrum
Copy link
Contributor

I know of extensions written in Rust used in the wild. I've seen interesting in writing them in Go, which is evidently possible now.

@chrisseaton chrisseaton added this to the truffle-dev milestone Apr 13, 2016
@chrisseaton chrisseaton merged commit 6426629 into truffle-head-next Apr 13, 2016
@chrisseaton chrisseaton deleted the truffle-cexts branch April 13, 2016 15:51
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants