Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 06a73547c960
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 92e6ebaab6a0
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 5, 2016

  1. Copy the full SHA
    fc44aea View commit details
  2. Copy the full SHA
    bd24a32 View commit details
  3. Copy the full SHA
    92e6eba View commit details
Showing with 15 additions and 6 deletions.
  1. +1 −0 test/truffle/cexts/nokogiri/.jruby-cext-build.yml
  2. +14 −6 tool/jt.rb
1 change: 1 addition & 0 deletions test/truffle/cexts/nokogiri/.jruby-cext-build.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
src: $GEM_HOME/gems/nokogiri-1.6.8/ext/nokogiri/*.c
cflags: -I$GEM_HOME/gems/nokogiri-1.6.8/ext/nokogiri `xml2-config --cflags`
out: lib/nokogiri/nokogiri.su
20 changes: 14 additions & 6 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -408,7 +408,7 @@ def help
puts ' USE_SYSTEM_CLANG Use the system clang rather than Sulong\'s when compiling C extensions'
puts ' GRAAL_JS_JAR The location of trufflejs.jar'
puts ' SL_JAR The location of truffle-sl.jar'
puts ' OPEN_SSL_HOME The location of OpenSSL (the directory containing include etc)'
puts ' OPENSSL_HOME The location of OpenSSL (the directory containing include etc)'
end

def checkout(branch)
@@ -432,7 +432,7 @@ def build(*options)
cextc "#{JRUBY_DIR}/truffle/src/main/c/cext"

#cextc "#{JRUBY_DIR}/truffle/src/main/c/openssl",
# "-I#{ENV['OPEN_SSL_HOME']}/include",
# "-I#{ENV['OPENSSL_HOME']}/include",
# '-DRUBY_EXTCONF_H="extconf.h"',
# '-Werror=implicit-function-declaration'
when nil
@@ -549,21 +549,27 @@ def cextc(cext_dir, *clang_opts)
end

config = YAML.load_file(config_file)

config_src = config['src']

if config_src.start_with?('$GEM_HOME/')
src = Dir[ENV['GEM_HOME'] + config_src['$GEM_HOME'.size..-1]]
else
src = Dir[File.join(cext_dir, config_src)]
end

config_cflags = config['cflags'] || ''
config_cflags = `echo #{config_cflags}`.strip
config_cflags = config_cflags.split(' ')

out = File.expand_path(config['out'], cext_dir)

lls = []

src.each do |src|
ll = File.join(File.dirname(out), File.basename(src, '.*') + '.ll')

clang_args = ["-I#{SULONG_DIR}/include", '-Ilib/ruby/truffle/cext', '-S', '-emit-llvm', *clang_opts, src, '-o', ll]
clang_args = ["-I#{SULONG_DIR}/include", '-Ilib/ruby/truffle/cext', '-S', '-emit-llvm', *config_cflags, *clang_opts, src, '-o', ll]
opt_args = ['-S', '-mem2reg', ll, '-o', ll]

if ENV['USE_SYSTEM_CLANG']
@@ -678,15 +684,17 @@ def test_cexts(*args)

[
['oily_png', ['chunky_png-1.3.6', 'oily_png-1.2.0'], ['oily_png']],
['psd_native', ['chunky_png-1.3.6', 'oily_png-1.2.0', 'bindata-2.3.1', 'hashie-3.4.4', 'psd-enginedata-1.1.1', 'psd-2.1.2', 'psd_native-1.1.3'], ['oily_png', 'psd_native']]
].each do |gem_name, dependencies, libs|
['psd_native', ['chunky_png-1.3.6', 'oily_png-1.2.0', 'bindata-2.3.1', 'hashie-3.4.4', 'psd-enginedata-1.1.1', 'psd-2.1.2', 'psd_native-1.1.3'], ['oily_png', 'psd_native']],
['nokogiri', [], ['nokogiri']]
].each do |gem_name, dependencies, libs|
next if gem_name == 'nokogiri' # nokogiri totally excluded
config = "#{JRUBY_DIR}/test/truffle/cexts/#{gem_name}"
cextc config, '-Werror=implicit-function-declaration'
arguments = []
run '--graal',
*(dependencies.map { |d| ['-I', "#{ENV['GEM_HOME']}/gems/#{d}/lib"] }.flatten),
*(libs.map { |l| ['-I', "#{JRUBY_DIR}/test/truffle/cexts/#{l}/lib"] }.flatten),
"#{JRUBY_DIR}/test/truffle/cexts/#{gem_name}/test.rb" unless gem_name == 'psd_native' # psd_native is excluded
"#{JRUBY_DIR}/test/truffle/cexts/#{gem_name}/test.rb" unless gem_name == 'psd_native' # psd_native is excluded just for compilation
end
end
private :test_cexts