From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] Pre-release LTP build
Date: Tue, 12 Apr 2016 09:39:37 -0400 (EDT) [thread overview]
Message-ID: <1314010537.480730.1460468377766.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160412122307.GA2562@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 2:23:07 PM
> Subject: Re: [LTP] Pre-release LTP build
>
> Hi!
> > As for RHEL5.6 it's only i386. I was able to compile x86_64, ia64,
> > ppc/ppc64
> > and s390/s390x with no changes.
> >
> > Any of these two allow it to compile on x86:
> > 1. -march=i486 (or higher)
> > 2.
> > diff --git a/lib/tst_atomic.c b/lib/tst_atomic.c
> > new file mode 100644
> > index 0000000..601fd6c
> > --- /dev/null
> > +++ 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.
>
> Accordingly to:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34115
>
> It does not work with gcc 4.1 when the builtin is returned directly at
> the end of the function.
>
> So storing the return value to a variable may fix that as well.
It made no difference for me:
../../lib/libltp.a(tst_test.o): In function `tst_atomic_inc':
/root/ltp/lib/../include/tst_atomic.h:23: undefined reference to `__sync_add_and_fetch_4'
/root/ltp/lib/../include/tst_atomic.h:23: undefined reference to `__sync_add_and_fetch_4'
/root/ltp/lib/../include/tst_atomic.h:23: undefined reference to `__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
make[1]: *** [test01] Error 1
make[1]: Leaving directory `/root/ltp/lib/newlib_tests'
make: *** [all] Error 2
> But I would prefer having fallback definition over working around
> compiler bugs.
Agreed.
next prev parent reply other threads:[~2016-04-12 13:39 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 [this message]
2016-04-12 14:24 ` Cyril Hrubis
2016-04-13 13:07 ` Jan Stancek
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=1314010537.480730.1460468377766.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.