Subject: Re: Failure to build librseq on ppc

From: Mathieu Desnoyers <[email-masked]>
Date: Wed, 8 Jul 2020 20:01:23 -0400 (EDT)

----- Segher Boessenkool <[email-masked]> wrote:
> Hi!
> 
> On Wed, Jul 08, 2020 at 10:27:27PM +1000, Michael Ellerman wrote:
> > Segher Boessenkool <[email-masked]> writes:
> > > You'll have to show the actual failing machine code, and with enough
> > > context that we can relate this to the source code.
> > >
> > > -save-temps helps, or use -S instead of -c, etc.
> > 
> > Attached below.
> 
> Thanks!
> 
> > I think that's from:
> > 
> > #define LOAD_WORD       "ld "
> > 
> > #define RSEQ_ASM_OP_CMPEQ(var, expect, label)                                   \
> >                 LOAD_WORD "%%r17, %[" __rseq_str(var) "]\n\t"                   \
> 
> The way this hardcodes r17 *will* break, btw.  The compiler will not
> likely want to use r17 as long as your code (after inlining etc.!) stays
> small, but there is Murphy's law.

r17 is in the clobber list, so it should be ok.

> 
> Anyway...  something in rseq_str is wrong, missing %X<n>.  This may
> have to do with the abuse of inline asm here, making a fix harder :-(

I just committed a fix which enhances the macros.

Thanks for your help!

Mathieu

> Segher

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com