NetBSD-Bugs archive

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

Re: toolchain/49074 (lang/ruby21-base fails to link due to undefined reference to `__atomic_compare_exchange_4')

The following reply was made to PR toolchain/49074; it has been noted by GNATS.

From: Nobuyoshi SATO <>
Subject: Re: toolchain/49074 (lang/ruby21-base fails to link due to
 undefined reference to `__atomic_compare_exchange_4')
Date: Thu, 28 Aug 2014 18:19:36 +0900 (JST)

 On Tue,  5 Aug 2014 12:09:15 +0000 (UTC), wrote:
 > Synopsis: lang/ruby21-base fails to link due to undefined reference to 
 > `__atomic_compare_exchange_4'
 > Responsible-Changed-From-To: port-sparc-maintainer->toolchain-manager
 > Responsible-Changed-By:
 > Responsible-Changed-When: Tue, 05 Aug 2014 12:09:15 +0000
 > Responsible-Changed-Why:
 > This is a more broad issue, we need to add support for all the
 > __sync* builtins for the C++ memory model
 > listed in /usr/src/external/gpl3/gcc/dist/gcc/sync-builtins.def
 > and treat them like we did with the __sync_* stuff (including a test
 > case and fixing all build breakage)
 > .
 Based on infomation from @obache via twitter, I added checks
 __atomic_compare_exchange_n into ruby's configure script as
 --- configure.orig-pkgsrc-patched      2014-08-28 17:16:21.000000000 +0900
 +++ configure  2014-08-28 17:28:28.000000000 +0900
 @@ -13115,6 +13115,7 @@
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  /* end confdefs.h.  */
  unsigned char atomic_var;
 +unsigned char atomic_var2;
  main ()
 @@ -13123,6 +13124,8 @@
                        __atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST);
                        __atomic_fetch_add(&atomic_var, 1, __ATOMIC_SEQ_CST);
                        __atomic_fetch_sub(&atomic_var, 1, __ATOMIC_SEQ_CST);
 +                      __atomic_compare_exchange_n(&atomic_var, &atomic_var2, 
 +                      __atomic_compare_exchange_n(&atomic_var, &atomic_var2, 
    return 0;
 This let result of "checking for __atomic builtins..." be no,
 and use of these builtin function is avoided. Tested on 
 netbsd-7 branch, synchronized end of last week.
 Note: __atomic_exchange_n, __atomic_fetch_add and __atomic_fetch_sub
 exist for sparc port, so the result of check for these builtin 
 functions is yes regularly.
 This seem to be not a good way to solve the problem, however, 
 this evades the problem that lang/ruby212 cannot be built in
 sparc port.
 I cannot judge this problem is NetBSD's toolchain problem
 or ruby's configfure script is irresponsible. 
 Anyway, I report the newest trying result.
 Lecturer / Faculty of Software & Info. Sci., Iwate Prefectural Univ.
 Nobuyoshi Sato, Ph.D / / +81-19-694-2612

Home | Main Index | Thread Index | Old Index