Skip to content

Commit 9fd4421

Browse files
committed
Merge remote-tracking branch 'origin' into 1.8.7
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
2 parents b593ad1 + c776a00 commit 9fd4421

File tree

7 files changed

+49
-65
lines changed

7 files changed

+49
-65
lines changed

configure

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -560,15 +560,6 @@ class Configure
560560
return false
561561
end
562562

563-
if setup_config
564-
check_llvm_flags
565-
return true
566-
end
567-
568-
failure "ABORT: unable to set up LLVM"
569-
end
570-
571-
def setup_config
572563
@log.print " Checking for 'llvm-config': "
573564

574565
config = @llvm_configure
@@ -595,36 +586,38 @@ class Configure
595586
# Ruby 1.9 raises this error
596587
failed = true
597588
end
598-
if failed
599-
@log.write "Executing #{config_cmd.inspect} failed"
600-
return false
601-
end
602589

603-
parts = version.sub(/svn$/, "").split(".").map { |i| i.to_i }
604-
api_version = ("%d%02d" % parts[0..1]).to_i
605-
if api_version < 300 or api_version > 305
606-
@log.write "only LLVM 3.0-3.5 is supported"
607-
else
608-
@log.write "found! (version #{version} - api: #{api_version})"
609-
@llvm = :config
610-
@llvm_configure = config_cmd
611-
@llvm_version = version
612-
@llvm_api_version = api_version
613-
614-
if @llvm_shared
615-
setup_config_shared
616-
end
590+
unless failed
591+
parts = version.sub(/svn$/, "").split(".").map { |i| i.to_i }
592+
api_version = ("%d%02d" % parts[0..1]).to_i
593+
if api_version < 300 or api_version > 305
594+
@log.write "only LLVM 3.0-3.5 is supported"
595+
else
596+
@log.write "found! (version #{version} - api: #{api_version})"
597+
@llvm = :config
598+
@llvm_configure = config_cmd
599+
@llvm_version = version
600+
@llvm_api_version = api_version
617601

618-
return true
602+
check_llvm_flags
603+
604+
if @llvm_shared
605+
setup_llvm_shared
606+
end
607+
608+
return true
609+
end
610+
else
611+
@log.write "executing #{config_cmd.inspect} failed"
619612
end
620613
else
621614
@log.write "not found"
622615
end
623616

624-
false
617+
failure "ABORT: unable to set up LLVM"
625618
end
626619

627-
def setup_config_shared
620+
def setup_llvm_shared
628621
@log.print " Checking for LLVM shared libs: "
629622

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

636-
common_args = `#{@llvm_configure} --cppflags --ldflags`.strip.split(/\s+/)
629+
common_args = "`#{@llvm_configure} --cppflags` #{@llvm_cxxflags} #{@llvm_ldflags}".strip.split(/\s+/)
637630
shared_configs = {
638631
"libLLVM-#{@llvm_version}" => ["-lLLVM-#{@llvm_version}"],
639632
"#{@llvm_configure} --libs" => `#{@llvm_configure} --libs`.strip.split(/\s+/)

kernel/bootstrap/array_mirror.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Rubinius
22
class Mirror
33
class Array < Mirror
4-
subject = ::Array
4+
self.subject = ::Array
55

66
def self.reflect(object)
77
m = super(object)

kernel/bootstrap/mirror.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def initialize(obj)
2020
end
2121

2222
class Object < Mirror
23-
subject = ::Object
23+
self.subject = ::Object
2424
end
2525

2626
def inspect

kernel/common/load_order.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
mirror.rbc
21
string_mirror.rbc
32
class.rbc
43
autoload.rbc

kernel/common/mirror.rb

Lines changed: 0 additions & 30 deletions
This file was deleted.

kernel/common/string_mirror.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Rubinius
22
class Mirror
33
class String < Mirror
4-
subject = ::String
4+
self.subject = ::String
55

66
def character_to_byte_index(idx, start=0)
77
Rubinius.invoke_primitive :string_character_byte_index, @object, idx, start

rakelib/platform.rake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@ file 'runtime/platform.conf' => deps do |task|
2626
s.field :ai_next, :pointer
2727
end.write_config(f)
2828

29+
Rubinius::FFI::Generators::Structures.new 'ifaddrs' do |s|
30+
s.include 'sys/types.h'
31+
s.include 'ifaddrs.h'
32+
33+
s.name 'struct ifaddrs'
34+
35+
s.field :ifa_next, :pointer
36+
s.field :ifa_name, :string
37+
s.field :ifa_flags, :int
38+
s.field :ifa_addr, :pointer
39+
s.field :ifa_netmask, :pointer
40+
end.write_config(f)
41+
42+
Rubinius::FFI::Generators::Structures.new 'sockaddr' do |s|
43+
s.include 'sys/socket.h'
44+
45+
s.name 'struct sockaddr'
46+
47+
s.field :sa_data, :char_array
48+
s.field :sa_family, :sa_family_t
49+
end.write_config(f)
50+
2951
Rubinius::FFI::Generators::Structures.new 'dirent' do |s|
3052
s.include "sys/types.h"
3153
s.include "dirent.h"

0 commit comments

Comments
 (0)