pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48672: devel/ruby-atomic build fails on NetBSD/m68k and other !x86 ports



>Number:         48672
>Category:       pkg
>Synopsis:       devel/ruby-atomic build fails on NetBSD/m68k and !x86 other 
>ports
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 21 09:40:00 +0000 2014
>Originator:     Izumi Tsutsui
>Release:        NetBSD 6.1.3
>Organization:
>Environment:
System: NetBSD 6.1.3 (GENERIC)
Architecture: m68k
Machine: luna68k, and x68, probably also all !x86 ports
>Description:
devel/ruby-atomic depends on the gcc specific __sync_bool_compare_and_swap()
atomic function but it doesn't available on NetBSD/m68k (and probably
NetBSD/arm), as PR pkg/48608 of textproc/icu.
>How-To-Repeat:
build devel/ruby-atomic on NetBSD/m68k 6.1.3.
It will fail by:
>> #error No CAS operation available for this platform
in atomic-1.1.14/ext/atomic_reference.c.
>Fix:
The following patch make the atomic gem use NetBSD's atomic_cas_ptr(9).
(though upstream is now 1.1.15 and it has more OS specific ifdefs)

Index: devel/ruby-atomic/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/ruby-atomic/distinfo,v
retrieving revision 1.1
diff -u -p -d -r1.1 distinfo
--- devel/ruby-atomic/distinfo  13 Sep 2013 12:59:41 -0000      1.1
+++ devel/ruby-atomic/distinfo  18 Mar 2014 12:51:36 -0000
@@ -3,3 +3,4 @@ $NetBSD: distinfo,v 1.1 2013/09/13 12:59
 SHA1 (atomic-1.1.14.gem) = 255bad8a4310719d62684c6ee8cf470c2322b7e2
 RMD160 (atomic-1.1.14.gem) = 59cfaa3281a9ac35e9f61e45a8a4c3102efe96e5
 Size (atomic-1.1.14.gem) = 16896 bytes
+SHA1 (patch-ext_atomic__reference.c) = 34bf845a42ed784c0b1923d3c5fdb50d0214f1d8
--- /dev/null   2014-03-18 12:39:42.000000000 +0000
+++ devel/ruby-atomic/patches/patch-ext_atomic__reference.c     2014-03-16 
15:46:14.000000000 +0000
@@ -0,0 +1,25 @@
+$NetBSD$
+
+--- ext/atomic_reference.c.orig        2014-03-16 15:45:20.000000000 +0000
++++ ext/atomic_reference.c
+@@ -14,6 +14,9 @@
+ #if defined(__sun)
+ #include <atomic.h>
+ #endif
++#if defined(__NetBSD__)
++#include <sys/atomic.h>
++#endif
+ 
+ static void ir_mark(void *value) {
+     rb_gc_mark_maybe((VALUE) value);
+@@ -67,6 +70,10 @@ static VALUE ir_compare_and_set(volatile
+         return Qtrue;
+     }
+ #endif
++#elif defined(__NetBSD__)
++    if (atomic_cas_ptr((volatile void *) &DATA_PTR(self), expect_value, 
new_value)) {
++        return Qtrue;
++    }
+ #elif HAVE_GCC_CAS
+     if (__sync_bool_compare_and_swap(&DATA_PTR(self), expect_value, 
new_value)) {
+       return Qtrue;



Home | Main Index | Thread Index | Old Index