• Simon Guo's avatar
    selftests/powerpc: Fix build errors in powerpc ptrace selftests · f36dbfe1
    Simon Guo authored
    GCC 7 will take "r2" in clobber list as an error and it will get
    following build errors for powerpc ptrace selftests even with -fno-pic
    option:
      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__(
        ^~~
    
    Fix the build error by removing "r2" from the clobber list. None of
    these asm blocks actually clobber r2.
    Reported-by: default avatarSeth Forshee <seth.forshee@canonical.com>
    Signed-off-by: default avatarSimon Guo <wei.guo.simon@gmail.com>
    Tested-by: default avatarSeth Forshee <seth.forshee@canonical.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    f36dbfe1
ptrace-tm-spr.c 3.24 KB