[Pkg-erlang-commits] r1748 - in erlang/trunk/debian: . patches
sgolovan at alioth.debian.org
sgolovan at alioth.debian.org
Sun Dec 27 09:43:47 UTC 2015
Author: sgolovan
Date: 2015-12-27 09:43:47 +0000 (Sun, 27 Dec 2015)
New Revision: 1748
Added:
erlang/trunk/debian/patches/x32.patch
Modified:
erlang/trunk/debian/changelog
erlang/trunk/debian/patches/series
Log:
[erlang]
* Fixed FTBFS for X32 architecture due to incorrectly used inline assembly.
Modified: erlang/trunk/debian/changelog
===================================================================
--- erlang/trunk/debian/changelog 2015-12-27 05:08:00 UTC (rev 1747)
+++ erlang/trunk/debian/changelog 2015-12-27 09:43:47 UTC (rev 1748)
@@ -2,8 +2,9 @@
* Fixed FTBFS for GNU/kFreeBSD and GNU/Hurd due to incorrectly checked
presence of gethostname_r() function.
+ * Fixed FTBFS for X32 architecture due to incorrectly used inline assembly.
- -- Sergei Golovan <sgolovan at debian.org> Sun, 27 Dec 2015 08:06:54 +0300
+ -- Sergei Golovan <sgolovan at debian.org> Sun, 27 Dec 2015 12:40:53 +0300
erlang (1:18.2-dfsg-1) unstable; urgency=medium
Modified: erlang/trunk/debian/patches/series
===================================================================
--- erlang/trunk/debian/patches/series 2015-12-27 05:08:00 UTC (rev 1747)
+++ erlang/trunk/debian/patches/series 2015-12-27 09:43:47 UTC (rev 1748)
@@ -11,3 +11,4 @@
beamload.patch
reproducible-build.patch
gethostbyname.patch
+x32.patch
Added: erlang/trunk/debian/patches/x32.patch
===================================================================
--- erlang/trunk/debian/patches/x32.patch (rev 0)
+++ erlang/trunk/debian/patches/x32.patch 2015-12-27 09:43:47 UTC (rev 1748)
@@ -0,0 +1,54 @@
+Author: Sergei Golovan
+Description: This (not yet thoroughly tested) patch fixes FTBFS for x86_x32
+ architecture (x86_64 with 32-bit integers, longs and pointers).
+Last-Modified: Sun, 27 Dec 2015 12:39:07 +0300
+
+--- a/erts/lib_src/pthread/ethread.c
++++ b/erts/lib_src/pthread/ethread.c
+@@ -195,13 +195,25 @@
+ * we have the cpuid instruction.
+ */
+ __asm__ ("pushf\n\t"
++#if __x86_64__ || (__x86_64__ && __ILP32__)
++ "popq %%rax\n\t"
++#else /* i386 */
+ "popl %%eax\n\t"
++#endif
+ "movl %%eax, %%ecx\n\t"
+ "xorl $0x200000, %%eax\n\t"
++#if __x86_64__ || (__x86_64__ && __ILP32__)
++ "pushq %%rax\n\t"
++#else /* i386 */
+ "pushl %%eax\n\t"
++#endif
+ "popf\n\t"
+ "pushf\n\t"
++#if __x86_64__ || (__x86_64__ && __ILP32__)
++ "popq %%rax\n\t"
++#else /* i386 */
+ "popl %%eax\n\t"
++#endif
+ "movl $0x0, %0\n\t"
+ "xorl %%ecx, %%eax\n\t"
+ "jz no_cpuid\n\t"
+@@ -223,10 +235,19 @@
+ * B register explicitly (for some reason gcc doesn't provide this
+ * service to us).
+ */
+- __asm__ ("pushl %%ebx\n\t"
++ __asm__ (
++#if __x86_64__ || (__x86_64__ && __ILP32__)
++ "pushq %%rbx\n\t"
++#else /* i386 */
++ "pushl %%ebx\n\t"
++#endif
+ "cpuid\n\t"
+ "movl %%ebx, %1\n\t"
++#if __x86_64__ || (__x86_64__ && __ILP32__)
++ "popq %%rbx\n\t"
++#else /* i386 */
+ "popl %%ebx\n\t"
++#endif
+ : "=a"(*eax), "=r"(*ebx), "=c"(*ecx), "=d"(*edx)
+ : "0"(*eax)
+ : "cc");
More information about the Pkg-erlang-commits
mailing list