raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: raindrops@librelist.org
Subject: Re: Compilation on Solaris/SmartOS
Date: Tue, 27 Aug 2013 19:40:52 +0000
Message-ID: <20130827194052.GA22109@dcvr.yhbt.net> (raw)
In-Reply-To: <CAF5DW8+sGumpq55yamLFZL5h2jRnEEwoDunmQTVhToE=zcBDvw@mail.gmail.com>

Jonathan del Strother <maillist@steelskies.com> 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.


  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-27 11:02 Jonathan del Strother
2013-08-27 19:40 ` Eric Wong [this message]
2013-08-28  9:16   ` Jonathan del Strother
2013-08-28 10:13     ` Eric Wong
2013-08-29  9:58       ` Jonathan del Strother

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/raindrops/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130827194052.GA22109@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=raindrops@librelist.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

raindrops RubyGem user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://bogomips.org/raindrops-public
	git clone --mirror http://ou63pmih66umazou.onion/raindrops-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.raindrops
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.raindrops

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox