commit:     7e002c40c695e591f8d9ceadaee4c5013e6df256
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 29 12:54:14 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Jan 29 12:54:28 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e002c40

dev-lang/ghc: apply gentoo dev-libs/libffi patch for alpha

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch | 57 +++++++++++++++++++++++++
 dev-lang/ghc/ghc-8.0.2.ebuild                   |  1 +
 2 files changed, 58 insertions(+)

diff --git a/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch 
b/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch
new file mode 100644
index 00000000..166f7fe
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-8.0.2-libffi-alpha.patch
@@ -0,0 +1,57 @@
+commit 2c220c4b053c8efb2098ee20910084a42a0b2dcd
+Author: Sergei Trofimovich <[email protected]>
+Date:   Sun Jan 29 11:59:36 2017 +0000
+
+    libffi: fix build COMPLEX build failure on alpha
+    
+    libtool: compile:  alpha-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. 
-I. -I../include -Iinclude \
+        -I../src -I. -I../include -Iinclude -I../src -Wall -w -mieee 
-D_REENTRANT -fno-stack-protector \
+        -w -MT src/alpha/osf.lo -MMD -MP -MF src/alpha/.deps/osf.Tpo \
+        -c ../src/alpha/osf.S  -fPIC -DPIC -o src/alpha/.libs/osf.o
+    
+      ../src/alpha/osf.S:298:2: error: #error "osf.S out of sync with ffi.h"
+       #error "osf.S out of sync with ffi.h"
+        ^
+    
+    Signed-off-by: Sergei Trofimovich <[email protected]>
+
+diff --git a/libffi/ghc.mk b/libffi/ghc.mk
+index 7c5bc9e1b3..4297ed449e 100644
+--- a/libffi/ghc.mk
++++ b/libffi/ghc.mk
+@@ -63,6 +63,9 @@ $(libffi_STAMP_CONFIGURE): $(TOUCH_DEP)
+ # will use cygwin symbolic links which cannot be read by mingw gcc.
+       chmod +x libffi/ln
+ 
++      # fix libffi build failure on alpha
++      ( cd libffi/build && "$(PATCH_CMD)" -p0 < 
../libffi.3.2.1-complex_alpha.diff; )
++
+       # We need to use -MMD rather than -MD, as otherwise we get paths
+       # like c:/... in the dependency files on Windows, and the extra
+       # colons break make
+diff --git a/libffi/libffi.3.2.1-complex_alpha.diff 
b/libffi/libffi.3.2.1-complex_alpha.diff
+new file mode 100644
+index 0000000000..0d6e0bc290
+--- /dev/null
++++ b/libffi/libffi.3.2.1-complex_alpha.diff
+@@ -0,0 +1,20 @@
++--- src/alpha/osf.S.orig      2015-01-16 10:46:15.000000000 +0100
+++++ src/alpha/osf.S   2015-01-16 10:46:24.000000000 +0100
++@@ -279,6 +279,7 @@
++      .gprel32 $load_64       # FFI_TYPE_SINT64
++      .gprel32 $load_none     # FFI_TYPE_STRUCT
++      .gprel32 $load_64       # FFI_TYPE_POINTER
+++     .gprel32 $load_none     # FFI_TYPE_COMPLEX
++ 
++ /* Assert that the table above is in sync with ffi.h.  */
++ 
++@@ -294,7 +295,8 @@
++      || FFI_TYPE_SINT64 != 12        \
++      || FFI_TYPE_STRUCT != 13        \
++      || FFI_TYPE_POINTER != 14       \
++-     || FFI_TYPE_LAST != 14
+++     || FFI_TYPE_COMPLEX != 15       \
+++     || FFI_TYPE_LAST != 15
++ #error "osf.S out of sync with ffi.h"
++ #endif
++ 

diff --git a/dev-lang/ghc/ghc-8.0.2.ebuild b/dev-lang/ghc/ghc-8.0.2.ebuild
index 53d6413..e6dc320 100644
--- a/dev-lang/ghc/ghc-8.0.2.ebuild
+++ b/dev-lang/ghc/ghc-8.0.2.ebuild
@@ -452,6 +452,7 @@ src_prepare() {
                epatch "${FILESDIR}"/${PN}-8.0.1-ww-args-limit.patch
                epatch "${FILESDIR}"/${PN}-8.0.1-par-g0-on-A32.patch
                epatch "${FILESDIR}"/${PN}-8.0.2_rc2-old-sphinx.patch
+               epatch "${FILESDIR}"/${PN}-8.0.2-libffi-alpha.patch
 
                if use prefix; then
                        # Make configure find docbook-xsl-stylesheets from 
Prefix

Reply via email to