[LTP] Pre-release LTP build

Cyril Hrubis chrubis@suse.cz
Tue Apr 12 16:24:50 CEST 2016


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.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list