Source: glibc
Version: 2.24-9
Severity: normal
Tags: patch
User: debian-...@lists.debian.org
Usertags: m68k

Hi!

glibc upstream recently merged a patch by Andreas Schwab to fix
64-bit atomics on m68k [1]. We have had multiple issues with
atomics on m68k in the past with packages like openjdk-8 and
firebird3.0 which I was able to resolve by downgrading glibc.

I therefore highly suspect that we need this patch to get these
aforementioned packages build properly on m68k again. I'm attaching
the cherry-picked patch for inclusion in the glibc package.

Thanks,
Adrian

> [1] 
> https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=64ae9fe45662c8994b0e56ab469b01967408a154

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: Fix 64-bit atomics on m68k
Author: Andreas Schwab <sch...@linux-m68k.org>
Last-Update: 2017-02-20

--- glibc-2.24.orig/sysdeps/m68k/m680x0/m68020/atomic-machine.h
+++ glibc-2.24/sysdeps/m68k/m680x0/m68020/atomic-machine.h
@@ -73,7 +73,7 @@ typedef uintmax_t uatomic_max_t;
      __typeof (mem) __memp = (mem);                                          \
      __asm __volatile ("cas2%.l %0:%R0,%1:%R1,(%2):(%3)"                     \
                       : "=d" (__ret)                                         \
-                      : "d" (newval), "r" (__memp),                          \
+                      : "d" ((__typeof (*(mem))) (newval)), "r" (__memp),    \
                         "r" ((char *) __memp + 4), "0" (oldval)              \
                       : "memory");                                           \
      __ret; })
@@ -101,8 +101,9 @@ typedef uintmax_t uatomic_max_t;
         __asm __volatile ("1: cas2%.l %0:%R0,%1:%R1,(%2):(%3);"              \
                           "   jbne 1b"                                       \
                           : "=d" (__result)                                  \
-                          : "d" (newvalue), "r" (__memp),                    \
-                            "r" ((char *) __memp + 4), "0" (__result)        \
+                          : "d" ((__typeof (*(mem))) (newvalue)),            \
+                            "r" (__memp), "r" ((char *) __memp + 4),         \
+                            "0" (__result)                                   \
                           : "memory");                                       \
        }                                                                     \
      __result; })
@@ -144,7 +145,7 @@ typedef uintmax_t uatomic_max_t;
                           "   cas2%.l %0:%R0,%1:%R1,(%3):(%4);"              \
                           "   jbne 1b"                                       \
                           : "=d" (__result), "=&d" (__temp)                  \
-                          : "d" (value), "r" (__memp),                       \
+                          : "d" ((__typeof (*(mem))) (value)), "r" (__memp), \
                             "r" ((char *) __memp + 4), "0" (__result)        \
                           : "memory");                                       \
        }                                                                     \
@@ -175,8 +176,9 @@ typedef uintmax_t uatomic_max_t;
                                  "   cas2%.l %0:%R0,%1:%R1,(%3):(%4);"       \
                                  "   jbne 1b"                                \
                                  : "=d" (__oldval), "=&d" (__temp)           \
-                                 : "d" (value), "r" (__memp),                \
-                                   "r" ((char *) __memp + 4), "0" (__oldval) \
+                                 : "d" ((__typeof (*(mem))) (value)),        \
+                                   "r" (__memp), "r" ((char *) __memp + 4),  \
+                                   "0" (__oldval)                            \
                                  : "memory");                                \
              }                                                               \
            })

Reply via email to