@@ -9,6 +9,10 @@ module JITSupport
99 %r[\A .*/bin/intel64/icc\b ] ,
1010 %r[\A /opt/developerstudio\d +\. \d +/bin/cc\z ] ,
1111 ]
12+ UNSUPPORTED_ARCHITECTURES = [
13+ 's390x' ,
14+ 'sparc' ,
15+ ]
1216 # debian-riscv64: "gcc: internal compiler error: Segmentation fault signal terminated program cc1" https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian-riscv64/ruby-master/log/20200420T083601Z.fail.html.gz
1317 # freebsd12: cc1 internal failure https://rubyci.org/logs/rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20200306T103003Z.fail.html.gz
1418 # rhel8: one or more PCH files were found, but they were invalid https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20200306T153003Z.fail.html.gz
@@ -55,30 +59,20 @@ def eval_with_jit_without_retry(env = nil, script, verbose: 0, min_calls: 5, sav
5559 )
5660 end
5761
62+ # For MJIT
5863 def supported?
5964 return @supported if defined? ( @supported )
60- @supported = RbConfig ::CONFIG [ "MJIT_SUPPORT" ] != 'no' && UNSUPPORTED_COMPILERS . all? do |regexp |
61- !regexp . match? ( RbConfig ::CONFIG [ 'MJIT_CC' ] )
62- end && !appveyor_pdb_corrupted? && !PENDING_RUBYCI_NICKNAMES . include? ( ENV [ 'RUBYCI_NICKNAME' ] )
65+ @supported = RbConfig ::CONFIG [ "MJIT_SUPPORT" ] != 'no' &&
66+ UNSUPPORTED_COMPILERS . all? { |regexp | !regexp . match? ( RbConfig ::CONFIG [ 'MJIT_CC' ] ) } &&
67+ !PENDING_RUBYCI_NICKNAMES . include? ( ENV [ 'RUBYCI_NICKNAME' ] ) &&
68+ !UNSUPPORTED_ARCHITECTURES . include? ( RUBY_PLATFORM . split ( '-' , 2 ) . first )
6369 end
6470
6571 def yjit_supported?
6672 # e.g. x86_64-linux, x64-mswin64_140, x64-mingw32, x64-mingw-ucrt
6773 RUBY_PLATFORM . match? ( /^(x86_64|x64|arm64|aarch64)-/ )
6874 end
6975
70- # AppVeyor's Visual Studio 2013 / 2015 are known to spuriously generate broken pch / pdb, like:
71- # error C2859: c:\projects\ruby\x64-mswin_120\include\ruby-2.8.0\x64-mswin64_120\rb_mjit_header-2.8.0.pdb
72- # is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.
73- # https://ci.appveyor.com/project/ruby/ruby/builds/32159878/job/l2p38snw8yxxpp8h
74- #
75- # Until we figure out why, this allows us to skip testing JIT when it happens.
76- def appveyor_pdb_corrupted?
77- return false unless ENV . key? ( 'APPVEYOR' )
78- stdout , _stderr , _status = eval_with_jit_without_retry ( 'proc {}.call' , verbose : 2 , min_calls : 1 )
79- stdout . include? ( '.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.' )
80- end
81-
8276 def remove_mjit_logs ( stderr )
8377 if defined? ( RubyVM ::MJIT ) && RubyVM ::MJIT . enabled? # utility for -DFORCE_MJIT_ENABLE
8478 stderr . gsub ( /^MJIT warning: Skipped to compile unsupported instruction: \w +\n /m , '' )
0 commit comments