unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: mongrel-unicorn@rubyforge.org
Subject: [raindrops] testers on 32-bit FreeBSD wanted
Date: Thu, 10 May 2012 18:12:17 -0700	[thread overview]
Message-ID: <20120511011217.GB24952@dcvr.yhbt.net> (raw)

Since unicorn users are raindrops users, I'd appreciate it if
32-bit FreeBSD users can give this a try.  Thanks!

ref: http://mid.gmane.org/20120510215457.GA11961@dcvr.yhbt.net

Eric Wong <normalperson@yhbt.net> wrote:
> I've just pushed this out to master on git://bogomips.org/raindrops
> 
> The original check for "i386" arch was causing builds on SmartOS
> to fail.
> 
> Also available as a prerelease gem (0.8.0.5.g71f8):
> 
>   gem install --pre raindrops
> 
> >From 71f80afdbcb45245a01ee2c278ebda692587e92a Mon Sep 17 00:00:00 2001
> From: Eric Wong <normalperson@yhbt.net>
> Date: Thu, 10 May 2012 14:49:39 -0700
> Subject: [PATCH] extconf: better check for GCC atomic builtins
> 
> Attempting to test for CMPXCHG on x86 should allow this check to
> fail on i386 systems.  We also won't need try_run as a result,
> enabling cross-compilation.  The configure.in check in Ruby
> 1.9.3 does something similar and that's far more widely used
> than raindrops is.
> ---
>  ext/raindrops/extconf.rb |   15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/ext/raindrops/extconf.rb b/ext/raindrops/extconf.rb
> index 9f5de95..447a90a 100644
> --- a/ext/raindrops/extconf.rb
> +++ b/ext/raindrops/extconf.rb
> @@ -13,23 +13,20 @@ have_func('rb_thread_blocking_region')
>  have_func('rb_thread_io_blocking_region')
>  
>  checking_for "GCC 4+ atomic builtins" do
> +  # we test CMPXCHG anyways even though we don't need it to filter out
> +  # ancient i386-only targets without CMPXCHG
>    src = <<SRC
>  int main(int argc, char * const argv[]) {
> -        volatile unsigned long i = 0;
> +        unsigned long i = 0;
> +        __sync_lock_test_and_set(&i, 0);
> +        __sync_lock_test_and_set(&i, 1);
>          __sync_add_and_fetch(&i, argc);
>          __sync_sub_and_fetch(&i, argc);
>          return 0;
>  }
>  SRC
>  
> -  if try_run(src)
> -    # some systems target GCC for i386 and don't get the atomic builtins
> -    # when building shared objects
> -    arch = `#{CONFIG['CC']} -dumpmachine`.split(/-/)[0]
> -    if arch == "i386" && $CFLAGS !~ /\b-march=/
> -      $CFLAGS += " -march=i486 "
> -    end
> -
> +  if try_link(src)
>      $defs.push(format("-DHAVE_GCC_ATOMIC_BUILTINS"))
>      true
>    else
> -- 
> Eric Wong
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

             reply	other threads:[~2012-05-11  1:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11  1:12 Eric Wong [this message]
2012-05-12  6:05 ` [raindrops] testers on 32-bit FreeBSD wanted Eric Wong

Reply instructions:

You may reply publicly 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://yhbt.net/unicorn/

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

  git send-email \
    --in-reply-to=20120511011217.GB24952@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).