From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS47066 71.19.144.0/20 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.raindrops.general Subject: Re: Compilation on Solaris/SmartOS Date: Tue, 27 Aug 2013 19:40:52 +0000 Message-ID: <20130827194052.GA22109@dcvr.yhbt.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1377632473 11547 80.91.229.3 (27 Aug 2013 19:41:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Aug 2013 19:41:13 +0000 (UTC) To: raindrops@librelist.org Original-X-From: raindrops@librelist.org Tue Aug 27 21:41:17 2013 Return-path: Envelope-to: gclrrg-raindrops@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: raindrops@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.raindrops.general:115 Archived-At: Received: from zedshaw2.xen.prgmr.com ([71.19.156.177]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VEP8e-0000io-ES for gclrrg-raindrops@m.gmane.org; Tue, 27 Aug 2013 21:41:16 +0200 Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id C530374E5E for ; Tue, 27 Aug 2013 19:49:39 +0000 (UTC) Jonathan del Strother wrote: > Hi, > I was having trouble using Raindrops on our i386 SmartOS servers. The gem > would compile fine, but bomb out at runtime : > > ruby -rraindrops -e "Raindrops.new(1).incr(0)" > ld.so.1: ruby: fatal: relocation error: file > /..../gems/raindrops-0.10.0/lib/raindrops_ext.so: symbol > __sync_add_and_fetch_4: referenced symbol not found > > I was able to fix this with march=native - I added something like this to > extconf.rb - > > if CONFIG["arch"]=~/solaris/ > $CPPFLAGS += " -march=native" > end $CPPFLAGS is an odd choice, $CFLAGS is more correct from a pedantic standpoint even though normal builds do both preprocessing and compilation in the same invokation. So perhaps the following (can you test?): if CONFIG["arch"]=~/solaris/ $CFLAGS += " -march=native" end > I'm not familiar enough with building the atomic libs to say whether it's > definitely the correct fix, but it seems to work, and the ruby-atomic gem > needed something similar : > https://github.com/headius/ruby-atomic/blob/master/ext/extconf.rb. Any > thoughts? How does Ruby 2.0.0 / trunk build? That also uses __sync_* and I can't find -march=native anywhere.