From 1c67c46efbfd07e35e6e02fdade5a368f1a5a026 Mon Sep 17 00:00:00 2001 From: ngoto Date: Fri, 11 May 2018 16:47:38 +0000 Subject: transform_mjit_header.rb: workaround for Solaris 10 with old GCC * tool/transform_mjit_header.rb (MJITHeader.conflicting_types?): Add workaround for Solaris 10 with old GCC (4.6.2), that is essentially the same as for AIX (commit r62326), but probably due to different GCC versions, different error message is shown. [Bug #14751] [ruby-dev:50541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/transform_mjit_header.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tool/transform_mjit_header.rb') diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb index f53f1252cb..74d4e06232 100644 --- a/tool/transform_mjit_header.rb +++ b/tool/transform_mjit_header.rb @@ -160,13 +160,17 @@ module MJITHeader SUPPORTED_CC_MACROS.any? { |macro| code =~ /^#\s*define\s+#{Regexp.escape(macro)}\b/ } end - # This checks if syntax check outputs "error: conflicting types for 'restrict'". - # If it's true, this script regards platform as AIX and add -std=c99 as workaround. + # This checks if syntax check outputs one of the following messages. + # "error: conflicting types for 'restrict'" + # "error: redefinition of parameter 'restrict'" + # If it's true, this script regards platform as AIX or Solaris and adds -std=c99 as workaround. def self.conflicting_types?(code, cc, cflags) with_code(code) do |path| cmd = "#{cc} #{cflags} #{path}" out = IO.popen(cmd, err: [:child, :out], &:read) - !$?.success? && out.match?(/error: conflicting types for '[^']+'/) + !$?.success? && + (out.match?(/error: conflicting types for '[^']+'/) || + out.match?(/error: redefinition of parameter '[^']+'/)) end end -- cgit v1.2.3