From ddf96b7693639e354e95b4d0c6021586968a5a5f Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 20 Aug 2022 18:35:36 -0700 Subject: Drop mswin support of MJIT (#6265) The current MJIT relies on SIGCHLD and fork(2) to be performant, and it's something mswin can't offer. You could run Linux MJIT on WSL instead. [Misc #18968] --- tool/transform_mjit_header.rb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'tool') diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb index 8867c556f0..503e4c3593 100644 --- a/tool/transform_mjit_header.rb +++ b/tool/transform_mjit_header.rb @@ -169,10 +169,6 @@ module MJITHeader RUBY_PLATFORM =~ /mswin|mingw|msys/ end - def self.cl_exe?(cc) - cc =~ /\Acl(\z| |\.exe)/ - end - # If code has macro which only supported compilers predefine, return true. def self.supported_header?(code) SUPPORTED_CC_MACROS.any? { |macro| code =~ /^#\s*define\s+#{Regexp.escape(macro)}\b/ } @@ -220,13 +216,9 @@ end cc = ARGV[0] code = File.binread(ARGV[1]) # Current version of the header file. outfile = ARGV[2] -if MJITHeader.cl_exe?(cc) - cflags = '-DMJIT_HEADER -Zs' -else - cflags = '-S -DMJIT_HEADER -fsyntax-only -Werror=implicit-function-declaration -Werror=implicit-int -Wfatal-errors' -end +cflags = '-S -DMJIT_HEADER -fsyntax-only -Werror=implicit-function-declaration -Werror=implicit-int -Wfatal-errors' -if !MJITHeader.cl_exe?(cc) && !MJITHeader.supported_header?(code) +if !MJITHeader.supported_header?(code) puts "This compiler (#{cc}) looks not supported for MJIT. Giving up to generate MJIT header." MJITHeader.write("#error MJIT does not support '#{cc}' yet", outfile) exit @@ -234,7 +226,7 @@ end MJITHeader.remove_predefined_macros!(code) -if MJITHeader.windows? # transformation is broken with Windows headers for now +if MJITHeader.windows? # transformation is broken on Windows and the platfor is not supported MJITHeader.remove_harmful_macros!(code) MJITHeader.check_code!(code, cc, cflags, 'initial') puts "\nSkipped transforming external functions to static on Windows." -- cgit v1.2.3