[前][次][番号順一覧][スレッド一覧]

ruby-changes:51193

From: ngoto <ko1@a...>
Date: Sat, 12 May 2018 01:47:44 +0900 (JST)
Subject: [ruby-changes:51193] ngoto:r63400 (trunk): transform_mjit_header.rb: workaround for Solaris 10 with old GCC

ngoto	2018-05-12 01:47:38 +0900 (Sat, 12 May 2018)

  New Revision: 63400

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63400

  Log:
    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]

  Modified files:
    trunk/tool/transform_mjit_header.rb
Index: tool/transform_mjit_header.rb
===================================================================
--- tool/transform_mjit_header.rb	(revision 63399)
+++ tool/transform_mjit_header.rb	(revision 63400)
@@ -160,13 +160,17 @@ module MJITHeader https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L160
     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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]