Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into 1.8.7
Browse files Browse the repository at this point in the history
Conflicts:
	gems_list.txt
	kernel/bootstrap/array.rb
	kernel/common/array.rb
	kernel/common/enumerable.rb
	kernel/common/enumerator.rb
	kernel/common/env.rb
	kernel/common/hash.rb
	kernel/common/hash_hamt.rb
	kernel/common/kernel.rb
	kernel/common/proc.rb
	kernel/common/range.rb
	kernel/common/string.rb
	kernel/common/struct.rb
	spec/ruby/core/array/bsearch_spec.rb
	spec/ruby/core/array/cycle_spec.rb
	spec/ruby/core/dir/each_spec.rb
	spec/ruby/core/dir/foreach_spec.rb
	spec/ruby/core/enumerable/cycle_spec.rb
	spec/ruby/core/enumerable/drop_while_spec.rb
	spec/ruby/core/enumerable/each_cons_spec.rb
	spec/ruby/core/enumerable/each_slice_spec.rb
	spec/ruby/core/enumerable/each_with_index_spec.rb
	spec/ruby/core/enumerable/each_with_object_spec.rb
	spec/ruby/core/enumerable/find_index_spec.rb
	spec/ruby/core/enumerable/group_by_spec.rb
	spec/ruby/core/enumerable/max_by_spec.rb
	spec/ruby/core/enumerable/min_by_spec.rb
	spec/ruby/core/enumerable/minmax_by_spec.rb
	spec/ruby/core/enumerable/partition_spec.rb
	spec/ruby/core/enumerable/reject_spec.rb
	spec/ruby/core/enumerable/shared/find.rb
	spec/ruby/core/enumerable/shared/find_all.rb
	spec/ruby/core/enumerable/slice_before_spec.rb
	spec/ruby/core/enumerable/sort_by_spec.rb
	spec/ruby/core/enumerable/take_while_spec.rb
	spec/ruby/core/enumerator/each_with_index_spec.rb
	spec/ruby/core/enumerator/with_index_spec.rb
	spec/ruby/core/env/delete_if_spec.rb
	spec/ruby/core/hash/keep_if_spec.rb
	spec/ruby/core/hash/select_spec.rb
	spec/ruby/core/integer/downto_spec.rb
	spec/ruby/core/integer/upto_spec.rb
	spec/ruby/core/io/each_byte_spec.rb
	spec/ruby/core/io/foreach_spec.rb
	spec/ruby/core/io/lines_spec.rb
	spec/ruby/core/io/shared/each.rb
	spec/ruby/core/marshal/shared/load.rb
	spec/ruby/core/proc/curry_spec.rb
	spec/ruby/core/range/bsearch_spec.rb
	spec/ruby/core/range/each_spec.rb
	spec/ruby/core/string/each_byte_spec.rb
	spec/ruby/core/string/upto_spec.rb
	spec/tags/ruby/core/marshal/load_tags.txt
	spec/tags/ruby/core/marshal/restore_tags.txt
brixen committed Mar 20, 2015
2 parents b593ad1 + c776a00 commit 9fd4421
Showing 7 changed files with 49 additions and 65 deletions.
55 changes: 24 additions & 31 deletions configure
Original file line number Diff line number Diff line change
@@ -560,15 +560,6 @@ class Configure
return false
end

if setup_config
check_llvm_flags
return true
end

failure "ABORT: unable to set up LLVM"
end

def setup_config
@log.print " Checking for 'llvm-config': "

config = @llvm_configure
@@ -595,36 +586,38 @@ class Configure
# Ruby 1.9 raises this error
failed = true
end
if failed
@log.write "Executing #{config_cmd.inspect} failed"
return false
end

parts = version.sub(/svn$/, "").split(".").map { |i| i.to_i }
api_version = ("%d%02d" % parts[0..1]).to_i
if api_version < 300 or api_version > 305
@log.write "only LLVM 3.0-3.5 is supported"
else
@log.write "found! (version #{version} - api: #{api_version})"
@llvm = :config
@llvm_configure = config_cmd
@llvm_version = version
@llvm_api_version = api_version

if @llvm_shared
setup_config_shared
end
unless failed
parts = version.sub(/svn$/, "").split(".").map { |i| i.to_i }
api_version = ("%d%02d" % parts[0..1]).to_i
if api_version < 300 or api_version > 305
@log.write "only LLVM 3.0-3.5 is supported"
else
@log.write "found! (version #{version} - api: #{api_version})"
@llvm = :config
@llvm_configure = config_cmd
@llvm_version = version
@llvm_api_version = api_version

return true
check_llvm_flags

if @llvm_shared
setup_llvm_shared
end

return true
end
else
@log.write "executing #{config_cmd.inspect} failed"
end
else
@log.write "not found"
end

false
failure "ABORT: unable to set up LLVM"
end

def setup_config_shared
def setup_llvm_shared
@log.print " Checking for LLVM shared libs: "

src = <<-EOP
@@ -633,7 +626,7 @@ using namespace llvm;
int main() { LLVMContext &Context = getGlobalContext(); }
EOP

common_args = `#{@llvm_configure} --cppflags --ldflags`.strip.split(/\s+/)
common_args = "`#{@llvm_configure} --cppflags` #{@llvm_cxxflags} #{@llvm_ldflags}".strip.split(/\s+/)
shared_configs = {
"libLLVM-#{@llvm_version}" => ["-lLLVM-#{@llvm_version}"],
"#{@llvm_configure} --libs" => `#{@llvm_configure} --libs`.strip.split(/\s+/)
2 changes: 1 addition & 1 deletion kernel/bootstrap/array_mirror.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Rubinius
class Mirror
class Array < Mirror
subject = ::Array
self.subject = ::Array

def self.reflect(object)
m = super(object)
2 changes: 1 addition & 1 deletion kernel/bootstrap/mirror.rb
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ def initialize(obj)
end

class Object < Mirror
subject = ::Object
self.subject = ::Object
end

def inspect
1 change: 0 additions & 1 deletion kernel/common/load_order.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mirror.rbc
string_mirror.rbc
class.rbc
autoload.rbc
30 changes: 0 additions & 30 deletions kernel/common/mirror.rb

This file was deleted.

2 changes: 1 addition & 1 deletion kernel/common/string_mirror.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Rubinius
class Mirror
class String < Mirror
subject = ::String
self.subject = ::String

def character_to_byte_index(idx, start=0)
Rubinius.invoke_primitive :string_character_byte_index, @object, idx, start
22 changes: 22 additions & 0 deletions rakelib/platform.rake
Original file line number Diff line number Diff line change
@@ -26,6 +26,28 @@ file 'runtime/platform.conf' => deps do |task|
s.field :ai_next, :pointer
end.write_config(f)

Rubinius::FFI::Generators::Structures.new 'ifaddrs' do |s|
s.include 'sys/types.h'
s.include 'ifaddrs.h'

s.name 'struct ifaddrs'

s.field :ifa_next, :pointer
s.field :ifa_name, :string
s.field :ifa_flags, :int
s.field :ifa_addr, :pointer
s.field :ifa_netmask, :pointer
end.write_config(f)

Rubinius::FFI::Generators::Structures.new 'sockaddr' do |s|
s.include 'sys/socket.h'

s.name 'struct sockaddr'

s.field :sa_data, :char_array
s.field :sa_family, :sa_family_t
end.write_config(f)

Rubinius::FFI::Generators::Structures.new 'dirent' do |s|
s.include "sys/types.h"
s.include "dirent.h"

0 comments on commit 9fd4421

Please sign in to comment.