summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-11 16:47:38 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-11 16:47:38 +0000
commit1c67c46efbfd07e35e6e02fdade5a368f1a5a026 (patch)
tree7036eab59f1d5dd5f83aeaec2d9e0c44d28e073d /tool
parent94cb4cef59fe35768f7c4a4cc71003b306ea67f9 (diff)
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
Diffstat (limited to 'tool')
-rw-r--r--tool/transform_mjit_header.rb10
1 files changed, 7 insertions, 3 deletions
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