Issue #7485 has been updated by drbrain (Eric Hodel).


=begin
I'm also experiencing this on FreeBSD 8 with gcc 4.2.1:

  $ gcc -v
  Using built-in specs.
  Target: i386-undermydesk-freebsd
  Configured with: FreeBSD/i386 system compiler
  Thread model: posix
  gcc version 4.2.1 20070719  [FreeBSD]
  $ make
  linking miniruby
  thread.o(.text+0x3f20): In function `rb_threadptr_execute_interrupts':
  /data/home/drbrain/Work/svn/ruby/thread.c:1807: undefined reference to `__sync_val_compare_and_swap_4'
  *** Error code 1

  Stop in /data/home/drbrain/Work/svn/ruby.

So it seems to be an old GCC issue, not a mingw-specific issue.

Is ruby 2.0 abandoning gcc 4.2.x?

=end

----------------------------------------
Bug #7485: ruby cannot build on mingw32 or FreeBSD 8 due to missing __sync_val_compare_and_swap
https://bugs.ruby-lang.org/issues/7485#change-34645

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/