← Back to team overview

openjdk team mailing list archive

Bug#870403: openjdk-9: Please include patch to fix atomic_copy64 on powerpc

 

Source: openjdk-9
Version: 9~b179-2
Severity: normal
Tags: patch
User: debian-powerpc@xxxxxxxxxxxxxxxx
Usertags: powerpc

Hi!

As discussed in #868255 [1], the Zero build on powerpc fails
because of a bug in atomic_copy64(). This was discovered by
Andrew Haley who has also provided a patch to fix the issue.

I have added the patch to the current package and successfully
built openjdk-9 with debug-level set to "release".

When including the patch, please make sure it is applied after
the patch "hotspot-powerpcspe.diff" as both patches modify
code in the same region.

Please continue to keep #868255 open as the build on m68k still
requires the debug-level to be set at "slowdebug".

Thanks,
Adrian

> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868255

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@xxxxxxxxxx
`. `'   Freie Universitaet Berlin - glaubitz@xxxxxxxxxxxxxxxxxxx
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
--- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	2017-08-01 17:40:06.039530227 +0300
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	2017-08-01 17:41:51.269236959 +0300
@@ -38,10 +38,10 @@
   static void atomic_copy64(volatile void *src, volatile void *dst) {
 #if defined(PPC32) && !defined(__NO_FPRS__)
     double tmp;
-    asm volatile ("lfd  %0, 0(%1)\n"
-                  "stfd %0, 0(%2)\n"
-                  : "=f"(tmp)
-                  : "b"(src), "b"(dst));
+    asm volatile ("lfd  %0, %2\n"
+                  "stfd %0, %1\n"
+                  : "=&f"(tmp), "=Q"(*(volatile double*)dst)
+                  : "Q"(*(volatile double*)src));
 #elif defined(S390) && !defined(_LP64)
     double tmp;
     asm volatile ("ld  %0, 0(%1)\n"