Package: src:mpich Version: 3.1-4 Severity: normal Tags: patch User: debian-...@lists.debian.org Usertags: port-x32 ftbfs-x32
A year and half ago, Daniel Schepler submitted a fix of mpich misdetecting x32 as i386 and using improper assembly, as #699629. Here's a version of his patch ported to mpich 3. -- System Information: Debian Release: jessie/sid APT prefers unstable APT policy: (600, 'unstable'), (500, 'experimental') Architecture: x32 (x86_64) Kernel: Linux 3.15.0-x32 (SMP w/6 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
diff -urd mpich-3.1.orig/configure.ac mpich-3.1/configure.ac --- mpich-3.1.orig/configure.ac 2014-02-20 07:21:27.000000000 +0100 +++ mpich-3.1/configure.ac 2014-06-24 04:42:11.030647892 +0200 @@ -4434,7 +4434,7 @@ long int newval = 20; char ret; long int readval; -__asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0" +__asm__ __volatile__ ("push %%ecx; pop %%ecx; lock; cmpxchgl %3, %1; sete %0" : "=q" (ret), "=m" (*p), "=a" (readval) : "r" (newval), "m" (*p), "a" (oldval) : "memory"); return (compval == 20) ? 0 : -1; @@ -4454,12 +4454,12 @@ AC_TRY_RUN([ int main(int argc, char *argv[]) { -long int compval = 10; -volatile long int *p = &compval; -long int oldval = 10; -long int newval = 20; +long long int compval = 10; +volatile long long int *p = &compval; +long long int oldval = 10; +long long int newval = 20; char ret; -long int readval; +long long int readval; __asm__ __volatile__ ("lock; cmpxchgq %3, %1; sete %0" : "=q" (ret), "=m" (*p), "=a" (readval) : "r" (newval), "m" (*p), "a" (oldval) : "memory");