Skip to content

Commit

Permalink
Showing 6 changed files with 2,746 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/ruby/truffle/cext/include/ruby.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../ruby.h"
1 change: 1 addition & 0 deletions lib/ruby/truffle/cext/ruby/encoding.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../ruby.h"
1 change: 1 addition & 0 deletions lib/ruby/truffle/cext/ruby/oniguruma.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../ruby.h"
2,730 changes: 2,729 additions & 1 deletion lib/ruby/truffle/mri/mkmf.rb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions truffle/src/main/c/openssl/deprecation.rb
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ def self.deprecated_warning_flag
if with_config("broken-apple-openssl")
flag = "-Wno-deprecated-declarations"
end
$warnflags ||= [] # MODIFED deprecation, was nil
$warnflags << " #{flag}"
else
flag = ""
18 changes: 13 additions & 5 deletions truffle/src/main/ruby/core/rbconfig.rb
Original file line number Diff line number Diff line change
@@ -61,7 +61,8 @@ module RbConfig
'rubyhdrdir' => "#{jruby_home}/lib/ruby/truffle/cext",
'topdir' => "#{jruby_home}/lib/ruby/stdlib",
"rubyarchhdrdir"=>"#{jruby_home}/lib/ruby/truffle/cext",
'includedir' => ''
'includedir' => '',
'bindir' => "#{jruby_home}/bin"

This comment has been minimized.

Copy link
@eregon

eregon Nov 11, 2016

Member

@bjfish Careful, you overrode my carefully defined bindir above ;)

This comment has been minimized.

Copy link
@bjfish

bjfish Nov 11, 2016

Contributor

@eregon Oops, sorry

}

MAKEFILE_CONFIG = {
@@ -86,14 +87,21 @@ module RbConfig
'ruby_install_name' => 'jruby-truffle',
'RUBY_SO_NAME' => '$(RUBY_BASE_NAME)',
'hdrdir' => "#{jruby_home}/lib/ruby/truffle/cext",
'COMPILE_C' => '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$< -o $@'
'COMPILE_C' => '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$< -o $@',
'bindir' => "#{jruby_home}/bin"
}

if Truffle::Safe.memory_safe? && Truffle::Safe.processes_safe?
MAKEFILE_CONFIG.merge!({
'CC' => "mx -p #{ENV['SULONG_HOME']} su-clang -I#{ENV['SULONG_HOME']}/include",
'CFLAGS' => " -S -emit-llvm -I#{ENV['OPENSSL_HOME']}/include -DRUBY_EXTCONF_H=\"extconf.h\" -DHAVE_OPENSSL_110_THREADING_API -DHAVE_HMAC_CTX_COPY -DHAVE_EVP_CIPHER_CTX_COPY -DHAVE_BN_RAND_RANGE -DHAVE_BN_PSEUDO_RAND_RANGE -DHAVE_X509V3_EXT_NCONF_NID -Wall -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-unused-variable -Wno-uninitialized -Wno-unused-function -Werror ",
'LINK_SO' => "mx -p #{ENV['SULONG_HOME']} su-link -o $@ $(OBJS)"
'CC' => "mx -p #{ENV['SULONG_HOME']} su-clang -I#{ENV['SULONG_HOME']}/include -S",
'CFLAGS' => " -emit-llvm -I#{ENV['OPENSSL_HOME']}/include -DHAVE_OPENSSL_110_THREADING_API -DHAVE_HMAC_CTX_COPY -DHAVE_EVP_CIPHER_CTX_COPY -DHAVE_BN_RAND_RANGE -DHAVE_BN_PSEUDO_RAND_RANGE -DHAVE_X509V3_EXT_NCONF_NID -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens ",
'LINK_SO' => "mx -v -p #{ENV['SULONG_HOME']} su-link -o $@ $(OBJS)",
'TRY_LINK' => "mx -p #{ENV['SULONG_HOME']} su-clang $(src) $(INCFLAGS) $(CFLAGS) -I#{ENV['SULONG_HOME']}/include $(LIBS)",
'CPP' => "mx -p #{ENV['SULONG_HOME']} su-clang -I#{ENV['SULONG_HOME']}/include -S"
})
CONFIG.merge!({
'CC' => "mx -p #{ENV['SULONG_HOME']} su-clang -I#{ENV['SULONG_HOME']}/include -S",
'CPP' => "mx -p #{ENV['SULONG_HOME']} su-clang -I#{ENV['SULONG_HOME']}/include -S"
})
end

3 comments on commit e814214

@bjfish
Copy link
Contributor

@bjfish bjfish commented on e814214 Nov 8, 2016

Choose a reason for hiding this comment

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

@chrisseaton Could you give this a try? I've been running with:

cd ~/Documents/jruby/truffle/src/main/c/openssl/
OPENSSL_HOME=/usr/local/opt/openssl SULONG_HOME=/Users/brandonfish/Documents/suparent/sulong ../../../../../bin/jruby -X+T extconf.rb
make

Copy the openssl.su to jruby/lib/ruby/truffle/openssl.
Then give require "openssl" a try. I see an error upon requiring.

I've added our own version of the mkmf file with # MODIFIED tags where changes are made because the original mkmf appears to hard code assumptions about the ruby project directory structure.

@eregon
Copy link
Member

@eregon eregon commented on e814214 Nov 9, 2016

Choose a reason for hiding this comment

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

@bjfish When you edit an existing file like that, first commit the original, and then your modifications. That would allow to easily port the modifications to a newer version and see what got modified.

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

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

@bjfish with running su-opt, this now seems to do what we want.

Please sign in to comment.