linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Seth Forshee <seth.forshee@canonical.com>
To: Simon Guo <wei.guo.simon@gmail.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: Build failures in powerpc ptrace selftests
Date: Thu, 31 Aug 2017 07:27:59 -0500	[thread overview]
Message-ID: <20170831122759.6uspj5v727gyclbe@ubuntu-xps13> (raw)
In-Reply-To: <20170830174147.GA7040@simonLocalRHEL7.x64>

On Thu, Aug 31, 2017 at 01:41:47AM +0800, Simon Guo wrote:
> Hi Seth,
> On Wed, Aug 30, 2017 at 08:05:25AM -0500, Seth Forshee wrote:
> > With gcc 7 from Ubuntu 17.10 I'm getting the follwing error building the
> > ptrace selftests for powerpc:
> > 
> >   ptrace-tm-vsx.c: In function ‘tm_vsx’:
> >   ptrace-tm-vsx.c:42:2: error: PIC register clobbered by ‘r2’ in ‘asm’
> >     asm __volatile__(
> >     ^~~
> >   make[1]: *** [ptrace-tm-vsx] Error 1
> >   ptrace-tm-spd-vsx.c: In function ‘tm_spd_vsx’:
> >   ptrace-tm-spd-vsx.c:55:2: error: PIC register clobbered by ‘r2’ in ‘asm’
> >     asm __volatile__(
> >     ^~~
> >   make[1]: *** [ptrace-tm-spd-vsx] Error 1
> >   ptrace-tm-spr.c: In function ‘tm_spr’:
> >   ptrace-tm-spr.c:46:2: error: PIC register clobbered by ‘r2’ in ‘asm’
> >     asm __volatile__(
> >     ^~~
> > 
> > Best I can tell gcc now considers any inline asm which clobbers r2 an
> > error, and I get it even with -fno-pic. I'm not familiar with powerpc
> > asm, but it's not obvious to me why r2 is in the clobber list for any of
> > these.
> Thanks for reporting this issue.
> 
> In PPC ABI, r2 is used as TOC pointer and it might be changed by inter-module 
> function calls. I believe that is the reason why it was put into clobber list 
> originally.
> 
> In our case, dual entry is used to save TOC pointer (r2) update for function
> calls within one module. There is no r2 change and I think r2 can be moved out 
> of clobber list.
> 
> I don't have a GCC-7 environment. If possible, could you help to try following 
> patch?

Your patch fixes the build errors for me. Thanks!

Seth

      reply	other threads:[~2017-08-31 12:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 13:05 Build failures in powerpc ptrace selftests Seth Forshee
2017-08-30 17:41 ` Simon Guo
2017-08-31 12:27   ` Seth Forshee [this message]

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=20170831122759.6uspj5v727gyclbe@ubuntu-xps13 \
    --to=seth.forshee@canonical.com \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=wei.guo.simon@gmail.com \
    /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 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 NNTP newsgroup(s).