All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] Pre-release LTP build
Date: Wed, 13 Apr 2016 09:07:49 -0400 (EDT)	[thread overview]
Message-ID: <166413638.832919.1460552869855.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160412142449.GC2875@rei.suse.cz>



----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Tuesday, 12 April, 2016 4:24:50 PM
> Subject: Re: [LTP] Pre-release LTP build
> 
> Hi!
> > > > +++ b/lib/tst_atomic.c
> > > > @@ -0,0 +1,8 @@
> > > > +#if defined(__i386__)
> > > > +unsigned int __sync_add_and_fetch_4(unsigned int *v, unsigned value)
> > > > +{
> > > > +       register int val = value;
> > > > +       __asm__ __volatile__ ( "lock xadd %1,%0" : "=m" (*v), "=r"
> > > > (val) :
> > > > "1" (val) : "memory");
> > > > +       return val + value;
> > > > +}
> > > > +#endif
> > > > 
> > > > According to gcc docs it should only make external call to above
> > > > function,
> > > > when it's not provided natively, so it works as fallback.
> 
> This does not work with gcc-3.3 where no redirection from
> __sync_add_and_fetch -> __sync_add_and_fetch_4 happens. I would say that
> if we are adding fallback definition it should work with 3.3 as well. So
> I guess we should go with configure check and defining
> sync_add_and_fetch() directly. We can also print nice #error message in
> case that there is no fallback implementation if we decide to go this
> way.

I'll post a series that goes this way shortly. I've based it on kernel
atomic_add_return for architectures that are accessible for me. I tested
it only on RHEL5.6 (gcc 4.1.2), which I think is the oldest active
RHEL release at the moment.

What arches do you care about, that have gcc-3.3?

  reply	other threads:[~2016-04-13 13:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 17:23 [LTP] Pre-release LTP build Cyril Hrubis
2016-04-12  8:29 ` Jan Stancek
2016-04-12  8:40   ` Cyril Hrubis
2016-04-12 11:57     ` Jan Stancek
2016-04-12 12:23       ` Cyril Hrubis
2016-04-12 13:39         ` Jan Stancek
2016-04-12 14:24           ` Cyril Hrubis
2016-04-13 13:07             ` Jan Stancek [this message]
2016-04-13 13:30               ` Cyril Hrubis

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

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

  git send-email \
    --in-reply-to=166413638.832919.1460552869855.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.