Issue #7921 has been updated by luislavena (Luis Lavena).


mame (Yusuke Endoh) wrote:
> Then, is it a bug of the old mingw-w64?
> If so, I don't think this is a urgent task; let's address it after p0.
> 

If you read my original report: release of p0 with this issue will result in developers unable to provide binaries of some gems for Windows users.

Lot of Ruby developers cross-compile gems for Windows from OSX/Linux.

The definition of "old" do not apply here. We are talking about specific GCC 4.5.4 release, which lot of Ruby developers have installed to cross-compile binaries for Windows users.

Newer versions have solved this, yet none of the developers have upgraded to those versions.

Releasing p0 with this issue will break cross-compilation and will cause more damage.

----------------------------------------
Bug #7921: Cross-compiling ruby_2_0_0 to Windows is failing (rb_w32_pow)
https://bugs.ruby-lang.org/issues/7921#change-36891

Author: luislavena (Luis Lavena)
Status: Assigned
Priority: Urgent
Assignee: nobu (Nobuyoshi Nakada)
Category: build
Target version: 2.0.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1]


=begin
Hello,

Cross-compilation of Ruby targeting Windows (using MinGW) is an important tool for Linux/OSX developers to provide pre-compiled binary gems for Windows users. Having cross-compilation failing for Ruby 2.0 will complicate the installation of gems for the new version, as developers will not be able to provide these binaries for suers.

The error that is being triggered is coming from undefined elements:

 compiling ../dln.c
 In file included from ../include/ruby/defines.h:153:0,
                  from ../include/ruby/ruby.h:70,
                  from ../dln.c:13:
 ../include/ruby/win32.h: In function ???rb_w32_pow???:
 ../include/ruby/win32.h:787:5: error: implicit declaration of function ???_controlfp???
 ../include/ruby/win32.h:788:16: error: ???_PC_64??? undeclared (first use in this function)
 ../include/ruby/win32.h:788:16: note: each undeclared identifier is reported only once for each function it appears in
 ../include/ruby/win32.h:788:24: error: ???_MCW_PC??? undeclared (first use in this function)
 make: *** [dln.o] Error 1

This is easily fixed by including MinGW private header _mingw_float.h:

 diff --git a/include/ruby/win32.h b/include/ruby/win32.h
 index a2eec0c..494b522 100644
 --- a/include/ruby/win32.h
 +++ b/include/ruby/win32.h
 @@ -776,6 +776,7 @@ rb_w32_pow(double x, double y)
      return powl(x, y);
  }
  #elif defined(__MINGW64_VERSION_MAJOR)
 +#include <_mingw_float.h>
  /*
   * Set floating point precision for pow() of mingw-w64 x86.
   * With default precision the result is not proper on WinXP.

I want to test this further with other cross-compiler and native compiler combinations before commit, but wanted to open this up before official 2.0 release.

Thank you.
=end



-- 
http://bugs.ruby-lang.org/