Compiling on windows #8

Closed
stakach opened this Issue Oct 27, 2011 · 4 comments

Projects

None yet

4 participants

@stakach
stakach commented Oct 27, 2011

Using dev kit (gcc 4.5) it spits out

C:\Ruby\lib\ruby\gems\1.9.1\gems\atomic-0.0.6\ext/atomic_reference.c:38: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make: *** [atomic_reference.so] Error 1

This is probably due to the target processor being too low. Should probably be GXX_FLAGS=-march=i686

@zimbatm
Collaborator
zimbatm commented Oct 27, 2011

I don't have a windows box available at the moment. Can you try to modify the Makefile generated by extconf.rb to add the "-march=i686" option to the CFLAGS ?

@stakach
stakach commented Oct 30, 2011

Works perfectly with that flag added to the CFLAGS :)

@stakach
stakach commented Oct 30, 2011

Adding

case CONFIG["arch"]
when /mswin32|mingw/
    $CFLAGS += " -march=i686"
end

To extconf.rb should do the trick.

@headius headius closed this in aa4d547 Dec 3, 2011
@MartinodF

I am currently unable to install atomic under ruby 2.0.0 64bit on Windows 8 Pro x64, using DevKit-mingw64-64-4.7.2-20130224-1432.

"CPU you selected does not support x86-64 instruction set"

However, after removing those four lines from extconf.rb, the gem builds and installs just fine.
Are they still needed for older ruby versions on windows, or can they be removed altogether?

@headius headius added this to the atomic-1.1.14 and earlier milestone Feb 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment