It looks like that wild_bctr on powerpc/fixes is still not compiling

Subsystems: kernel selftest framework, the rest

3 messages, 2 authors, 2018-11-15 · open the first message on its own page

It looks like that wild_bctr on powerpc/fixes is still not compiling

From: Gustavo Romero <hidden>
Date: 2018-11-13 21:58:15

Hi mpe,

Even after the latest fix for the wild_bctr selftest I'm still getting the
following compilation (actually, an assembling error) because UL is not
understood by the assembler:

BUILD_TARGET=/home/gromero/git/linux/tools/testing/selftests/powerpc/mm; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C mm all
make[1]: Entering directory '/home/gromero/git/linux/tools/testing/selftests/powerpc/mm'
gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"v4.20-rc1-8-g2c7645b"' -I/home/gromero/git/linux/tools/testing/selftests/powerpc/include  -m64    wild_bctr.c ../harness.c  -o /home/gromero/git/linux/tools/testing/selftests/powerpc/mm/wild_bctr
/tmp/cctUajlx.s: Assembler messages:
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
../../lib.mk:152: recipe for target '/home/gromero/git/linux/tools/testing/selftests/powerpc/mm/wild_bctr' failed
make[1]: *** [/home/gromero/git/linux/tools/testing/selftests/powerpc/mm/wild_bctr] Error 1
make[1]: Target 'all' not remade because of errors.
make[1]: Leaving directory '/home/gromero/git/linux/tools/testing/selftests/powerpc/mm'
Makefile:39: recipe for target 'mm' failed
make: *** [mm] Error 2

For:
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git (powerpc/fixes)
$ git describe
v4.20-rc1-8-g2c7645b

This is gcc:
$ gcc --version
gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

but it should not make a difference, so  I'm wondering if anybody else is
getting the same error too...

The following trivial workaround can solve it by forcing a type promotion on
the compiler side whilst leaving the macro taken into the asm code without
the UL string:
diff --git a/tools/testing/selftests/powerpc/mm/wild_bctr.c b/tools/testing/selftests/powerpc/mm/wild_bctr.c
index 90469a9..d2772f4 100644
--- a/tools/testing/selftests/powerpc/mm/wild_bctr.c
+++ b/tools/testing/selftests/powerpc/mm/wild_bctr.c
@@ -47,8 +47,9 @@ static int ok(void)
         return 0;
  }
  
-#define REG_POISON     0x5a5aUL
-#define POISONED_REG(n)        ((REG_POISON << 48) | ((n) << 32) | (REG_POISON << 16) | (n))
+#define REG_POISON     0x5a5a
+#define POISONED_REG(n)        (((REG_POISON+0UL) << 48) | ((n) << 32) | ((REG_POISON+0UL) << 16) | (n))
  
  static inline void poison_regs(void)
  {

Should I contribute such a fix?

Thank you.


Best regards,
Gustavo

Re: It looks like that wild_bctr on powerpc/fixes is still not compiling

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-11-14 01:00:46

Hi Gromero ;)

Gustavo Romero [off-list ref] writes:
Hi mpe,

Even after the latest fix for the wild_bctr selftest I'm still getting the
following compilation (actually, an assembling error) because UL is not
understood by the assembler:

BUILD_TARGET=/home/gromero/git/linux/tools/testing/selftests/powerpc/mm; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C mm all
make[1]: Entering directory '/home/gromero/git/linux/tools/testing/selftests/powerpc/mm'
gcc -std=gnu99 -O2 -Wall -Werror -DGIT_VERSION='"v4.20-rc1-8-g2c7645b"' -I/home/gromero/git/linux/tools/testing/selftests/powerpc/include  -m64    wild_bctr.c ../harness.c  -o /home/gromero/git/linux/tools/testing/selftests/powerpc/mm/wild_bctr
/tmp/cctUajlx.s: Assembler messages:
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
...
/tmp/cctUajlx.s:270: Error: syntax error; found `U', expected `,'
/tmp/cctUajlx.s:270: Error: junk at end of line: `UL'
../../lib.mk:152: recipe for target '/home/gromero/git/linux/tools/testing/selftests/powerpc/mm/wild_bctr' failed
make[1]: *** [/home/gromero/git/linux/tools/testing/selftests/powerpc/mm/wild_bctr] Error 1
make[1]: Target 'all' not remade because of errors.
make[1]: Leaving directory '/home/gromero/git/linux/tools/testing/selftests/powerpc/mm'
Makefile:39: recipe for target 'mm' failed
make: *** [mm] Error 2

For:
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git (powerpc/fixes)
$ git describe
v4.20-rc1-8-g2c7645b

This is gcc:
$ gcc --version
gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

but it should not make a difference, so  I'm wondering if anybody else is
getting the same error too...
It seems to make a difference :)

I've been building with Ubuntu 7.3.0-27ubuntu1~18.04 and it builds just fine.

It looks like binutils 2.27 doesn't accept ULL but binutils 2.28 does.
 
Ah yep, here:

  https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=86b80085c889cd388fa677a5ae9053fd4be3776c
quoted hunk
The following trivial workaround can solve it by forcing a type promotion on
the compiler side whilst leaving the macro taken into the asm code without
the UL string:
diff --git a/tools/testing/selftests/powerpc/mm/wild_bctr.c b/tools/testing/selftests/powerpc/mm/wild_bctr.c
index 90469a9..d2772f4 100644
--- a/tools/testing/selftests/powerpc/mm/wild_bctr.c
+++ b/tools/testing/selftests/powerpc/mm/wild_bctr.c
@@ -47,8 +47,9 @@ static int ok(void)
         return 0;
  }
  
-#define REG_POISON     0x5a5aUL
-#define POISONED_REG(n)        ((REG_POISON << 48) | ((n) << 32) | (REG_POISON << 16) | (n))
+#define REG_POISON     0x5a5a
+#define POISONED_REG(n)        (((REG_POISON+0UL) << 48) | ((n) << 32) | ((REG_POISON+0UL) << 16) | (n))
  
  static inline void poison_regs(void)
  {

Should I contribute such a fix?
Yes thanks.

cheers

Re: It looks like that wild_bctr on powerpc/fixes is still not compiling

From: Gustavo Romero <hidden>
Date: 2018-11-15 02:46:15

Hi Michael,

On 11/13/2018 10:58 PM, Michael Ellerman wrote:
It looks like binutils 2.27 doesn't accept ULL but binutils 2.28 does.

Ah yep, here:

   https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=86b80085c889cd388fa677a5ae9053fd4be3776c
quoted
The following trivial workaround can solve it by forcing a type promotion on
the compiler side whilst leaving the macro taken into the asm code without
the UL string:
diff --git a/tools/testing/selftests/powerpc/mm/wild_bctr.c b/tools/testing/selftests/powerpc/mm/wild_bctr.c
index 90469a9..d2772f4 100644
--- a/tools/testing/selftests/powerpc/mm/wild_bctr.c
+++ b/tools/testing/selftests/powerpc/mm/wild_bctr.c
@@ -47,8 +47,9 @@ static int ok(void)
          return 0;
   }
   
-#define REG_POISON     0x5a5aUL
-#define POISONED_REG(n)        ((REG_POISON << 48) | ((n) << 32) | (REG_POISON << 16) | (n))
+#define REG_POISON     0x5a5a
+#define POISONED_REG(n)        (((REG_POISON+0UL) << 48) | ((n) << 32) | ((REG_POISON+0UL) << 16) | (n))
   
   static inline void poison_regs(void)
   {

Should I contribute such a fix?
Yes thanks.
Segher kindly suggested to use explicitly "unsigned long" (thanks!), so I sent
a v2 to:

https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-November/181434.html


Best regards,
Gustavo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help