From 9895f694603154679ff55b224607f45996dc3458 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Mon, 5 Feb 2018 12:19:38 +0000 Subject: transform_mjit_header.rb: check initial code separating the macros. Applying the kept macros to code which is already affected by the macros may cause errors in initial code. This is hopefully the final fix for icc build failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/transform_mjit_header.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb index 23f64a8576..c5ddae93c9 100644 --- a/tool/transform_mjit_header.rb +++ b/tool/transform_mjit_header.rb @@ -133,17 +133,19 @@ if MJITHeader.windows? end MJITHeader.remove_predefined_macros!(code) -# Check initial file correctness -MJITHeader.check_code!(code, cc, cflags, 'initial') - if MJITHeader.windows? # transformation is broken with Windows headers for now + MJITHeader.check_code!(code, cc, cflags, 'initial') puts "\nSkipped transforming external functions to static on Windows." MJITHeader.write(code, outfile) exit +else + macro, code = MJITHeader.separate_macro_and_code(code) # note: this does not work on MinGW + + # Check initial file correctness in the manner of final output. + MJITHeader.check_code!("#{code}#{macro}", cc, cflags, 'initial') end puts "\nTransforming external functions to static:" -macro, code = MJITHeader.separate_macro_and_code(code) # note: this does not work on MinGW stop_pos = -1 extern_names = [] -- cgit v1.2.3