From: "luislavena (Luis Lavena)" <luislavena@...>
Date: 2012-12-02T18:19:34+09:00
Subject: [ruby-core:50477] [ruby-trunk - Bug #7485] ruby cannot build on mingw32 due to missing __sync_val_compare_and_swap


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


Hello,

I just tested several native compilers on Windows 7 (without your patch) here are the results for those that define HAVE_GCC_ATOMIC_BUILTINS:

C:\Users\Luis\Code\ruby\ruby\build>gcc --version
gcc (tdm-1) 4.5.2

C:\Users\Luis\Code\ruby\ruby\build>cat .ext/include/i386-mingw32/ruby/config.h | grep ATOMIC
#define HAVE_GCC_ATOMIC_BUILTINS 1

C:\Users\Luis\Code\ruby\ruby\build>gcc --version
gcc (tdm-1) 4.6.1

C:\Users\Luis\Code\ruby\ruby\build>cat .ext/include/i386-mingw32/ruby/config.h | grep ATOMIC
#define HAVE_GCC_ATOMIC_BUILTINS 1

C:\Users\Luis\Code\ruby\ruby\build>gcc --version
gcc (rubenvb-4.7.2-release) 4.7.2

C:\Users\Luis\Code\ruby\ruby\build>cat .ext/include/i386-mingw32/ruby/config.h | grep ATOMIC
#define HAVE_GCC_ATOMIC_BUILTINS 1

In all scenarios it found the atomic builtins

On Windows XP (32bits), ATOMIC do get defined:

C:\Code\ruby\ruby\build>ver

Microsoft Windows XP [Version 5.1.2600]

C:\Code\ruby\ruby\build>gcc --version
gcc (rubenvb-4.7.2-release) 4.7.2

C:\Code\ruby\ruby\build>cat .ext\include\i386-mingw32\ruby\config.h | grep ATOMIC
#define HAVE_GCC_ATOMIC_BUILTINS 1

I was also able to compile Ruby without issues with "make all test"

I don't get the problem reported on this ticket on neither my systems.

I'm missing something?

Thank you.
----------------------------------------
Bug #7485: ruby cannot build on mingw32 due to missing __sync_val_compare_and_swap
https://bugs.ruby-lang.org/issues/7485#change-34310

Author: drbrain (Eric Hodel)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: build
Target version: 2.0.0
ruby -v: trunk


mingw32 GCC has the other atomic builtins but not this one.  The attached patch checks for the GCC builtins used in ruby_atomic.h but not checked for by configure.


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