Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cannot compile Eventmachine under Ruby 2.0.0-p0 on Windows using gcc 4.7.2 (x64) #406

Closed
sroller opened this Issue · 15 comments

5 participants

@sroller

Today I installed the newest Ruby Installer (rubyinstaller.org) and the new DEVKIT (based on gcc 4.7.2) from the same source.
Unfortunately I couldn't compile because some compiler parameters were not recognized by the new gcc.

my environment:

Windows 7 SP1

Ruby version

ruby -v
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

Gem version

gem -v
2.0.0

Compiler version

gcc -v
C:\Windows\system32>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/devkit/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.2/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: /home/ruben/mingw-w64/src/gcc/configure --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu --target=x86_64-w64-ming
w32 --with-sysroot=/home/ruben/mingw-w64/mingw64mingw64/mingw64 --prefix=/home/ruben/mingw-w64/mingw64mingw64/mingw64 --with-gmp=/ho
me/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-mpfr=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-mpc=
/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-ppl=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-cl
oog=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --disable-ppl-version-check --disable-cloog-version-check --enable-cloog
-backend=isl --with-host-libstdcxx='-static -lstdc++ -lm' --enable-shared --enable-static --enable-threads=win32 --enable-plugins --
disable-multilib --enable-languages=c,lto,c++,objc,obj-c++,fortran,java --enable-libgomp --enable-fully-dynamic-string --enable-libs
tdcxx-time --disable-nls --disable-werror --enable-checking=release --with-gnu-as --with-gnu-ld --disable-win32-registry --disable-r
path --disable-werror --with-libiconv-prefix=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-pkgversion=rubenvb-4.7.2
-release --with-bugurl=mingw-w64-public@lists.sourceforge.net CC= CFLAGS='-O2 -march=nocona -mtune=core2 -fomit-frame-pointer -momit
-leaf-frame-pointer' LDFLAGS=
Thread model: win32
gcc version 4.7.2 (rubenvb-4.7.2-release)

output of

gem install eventmachine --platform=ruby
C:\Windows\system32>gem install eventmachine --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing eventmachine:
        ERROR: Failed to build gem native extension.

    C:/ruby/bin/ruby.exe extconf.rb
checking for main() in -lssl... no
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
creating Makefile

make
generating rubyeventmachine-x64-mingw32.def
compiling binder.cpp
x86_64-w64-mingw32-g++.exe: error: unrecognized command line option '-EHs'
x86_64-w64-mingw32-g++.exe: error: unrecognized command line option '-GR'
make: *** [binder.o] Error 1


Gem files will remain installed in C:/ruby/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.0 for inspection.
Results logged to C:/ruby/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.0/ext/gem_make.out
@MartinodF

Confirmed, I'm having the same problem with ruby 2.0.0-p0 x64 and the latest devkit.
Everything works as expected with the 32bit versions of ruby and devkit though.

@IbnSaeed

I have having the same issue with ruby 2.0.0-p0 x64 and the latest devkit

havent tried 32bit version as i need to use 64bit

Is there a fix yet ?

@tmm1
Owner

What is the value of RUBY_PLATFORM?

@sroller

x64-mingw32

@tmm1
Owner

Strange. This should work. I don't have a win32 to machine to test this on, but if someone provides a patch I will gladly merge.

The code path in question is https://github.com/eventmachine/eventmachine/blob/master/ext/extconf.rb#L108-L113. GNU_CHAIN should equal true by the time you get here, but is not getting set for some reason.

@sroller

Amand, it's Windows 7 x64 with the Ruby 2.0.0 in the 64-bit version from Rubyinstaller.org. I'm using MinGW 4.7.2 also 64-bit (obviously :-).

@tmm1
Owner

This should print true:

if RUBY_PLATFORM =~ /(mswin|mingw|bccwin)/
  p $1 == 'mingw'
end
@sroller

It does.

But for strange reasons GNU_CHAIN is nil.

@sroller

I changed the line

GNU_CHAIN = ENV['CROSS_COMPILING'] or $1 == 'mingw'

to

GNU_CHAIN = (ENV['CROSS_COMPILING'] or $1 == 'mingw')

at least now the constant equals true

@tmm1
Owner
GNU_CHAIN = (ENV['CROSS_COMPILING'] or $1 == 'mingw')

should be the same as

GNU_CHAIN = ENV['CROSS_COMPILING'] || $1 == 'mingw'
@tmm1
Owner

Ah. This is already fixed on master. See #371

@tmm1 tmm1 closed this
@tmm1
Owner

I just released a 1.0.1 gem.

@sroller

Thanks.
It still doesn't compile because in
project.h:90
there is a redefinition of pid_t which is incompatible with the former one.
please see #408

@sroller
@pavel-anisimov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.