Project

General

Profile

Actions

Feature #16650

closed

Ruby 2.6.* and 2.7* no longer compile on latest Mingw64

Feature #16650: Ruby 2.6.* and 2.7* no longer compile on latest Mingw64

Added by cfis (Charlie Savage) over 5 years ago. Updated about 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:97247]

Description

Using the latest version of mingw64 and msys2, neither ruby 2.6.5 nor 2.7.0 compile.

The issue is with miniruby.exe - it gets built but does not work. For example:

$ ./miniruby.exe -v

Returns nothing (I assume it is crashing but its not triggering windows just in time debugger so hard to tell). Because of this, the various build rules that miniruby.exe execute do not work. For example, generating encdb.h from a template. The error is non-obvious:

./miniruby.exe -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
make: *** [uncommon.mk:1070: encdb.h] Error 4198400

After experimentation, the problem is the inclusion of -pie in the link command to make miniruby.exe. This can be worked around by:

./configure --prefix=/ CPPFLAGS=-I/mingw64/include LDFLAGS=-L/mingw64/lib --enable-shared=yes --disable-pie

Note the inclusion of "--disable-pie".


$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-9.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --enable-plugin --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 9.2.0 (Rev2, Built by MSYS2 project)

Updated by cfis (Charlie Savage) over 5 years ago Actions #1

  • Subject changed from Mingw64 Won't Compile to Ruby 2.6.* and 2.7* no longer compile on latest Mingw64

Updated by cfis (Charlie Savage) over 5 years ago Actions #2

  • ruby -v set to ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]

Updated by cfis (Charlie Savage) over 5 years ago Actions #3

  • Description updated (diff)

Updated by cfis (Charlie Savage) over 5 years ago Actions #4

  • Description updated (diff)

Updated by cfis (Charlie Savage) over 5 years ago Actions #5

  • Description updated (diff)

Updated by cfis (Charlie Savage) over 5 years ago Actions #6

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) over 5 years ago Actions #7 [ruby-core:97267]

Mingw has meant "mingw on cygwin", and msys has not been a supported platform.

Updated by nobu (Nobuyoshi Nakada) over 5 years ago Actions #8

  • Tracker changed from Bug to Feature
  • ruby -v deleted (ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32])
  • Backport deleted (2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN)

Updated by cfis (Charlie Savage) over 5 years ago Actions #9 [ruby-core:97657]

I find that answer quite surprising. The RubyInstaller for windows is based on msys and mingw64 (and has been for many years):

https://rubyinstaller.org/add-ons/devkit.html

Updated by nobu (Nobuyoshi Nakada) over 5 years ago Actions #10 [ruby-core:98497]

  • Status changed from Open to Closed

It seems working now, by compiling with gcc 10.1.0.

Updated by cfis (Charlie Savage) about 5 years ago Actions #11 [ruby-core:99914]

Ruby 2.6.5 on gcc 10.2.0 is still broken.

Actions

Also available in: PDF Atom