unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Sergei Trofimovich <slyfox@inbox.ru>
To: "Ludovic Courtès" <ludo@gnu.org>, "Kei Kebreau" <kei@openmailbox.org>
Cc: 25799@debbugs.gnu.org
Subject: bug#25799: [PATCH] gnu: add basic support for "alpha-linux" system
Date: Wed, 12 Apr 2017 21:59:44 +0100	[thread overview]
Message-ID: <20170412215944.3fa356d1@sf> (raw)
In-Reply-To: <87shmnn9ct.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 990 bytes --]

On Wed, 08 Mar 2017 15:14:58 +0100
ludo@gnu.org (Ludovic Courtès) wrote:

> Kei Kebreau <kei@openmailbox.org> skribis:
> 
> > Sergei Trofimovich <slyfox@inbox.ru> writes:  
> 
> [...]
> 
> >> This is how we tweak libffi in gentoo (guix-friendly patch):
> >>     http://code.haskell.org/~slyfox/0001-gnu-libffi-apply-alpha-build-fix.patch.txt
> >>
> >> Upstream fixed libffi in a more invasive way a few years ago:
> >>     
> >> git master passes build/test on alpha but didn't cut a release yet.  
> >
> > Great! That's good to know. Libffi for alpha builds fine for me with
> > this patch,  
> 
> Excellent.  That’s another patch to schedule for the next
> ‘core-updates’.

I've heard core-updates were merged to master. Congratulations!

Fixed minor collision against today's master in both patches. Attached
updated patches as:
  0001-gnu-add-basic-support-for-alpha-linux-system.patch
  0001-gnu-libffi-apply-alpha-build-fix.patch

-- 

  Sergei

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-add-basic-support-for-alpha-linux-system.patch --]
[-- Type: text/x-patch, Size: 1850 bytes --]

From fb53ef5d023624dc06de013d4a135bcec979a4cf Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@inbox.ru>
Date: Sun, 19 Feb 2017 19:21:06 +0000
Subject: [PATCH] gnu: add basic support for "alpha-linux" system

This change allows cross-building packages
by just using --target=alpha-unknown-linux-gnu re2c:

$ ./pre-inst-env guix build --target=alpha-unknown-linux-gnu re2c
$ file /gnu/store/p1z9iszzb4ng0vzc535sc2ha33ax24l6-re2c-0.16/bin/re2c
/gnu/store/p1z9iszzb4ng0vzc535sc2ha33ax24l6-re2c-0.16/bin/re2c: \
    ELF 64-bit LSB executable, Alpha (unofficial), version 1 (SYSV), dynamically linked, \
    interpreter /gnu/store/0z5d6z3hh41w7z5g2g82zlnwgpbj0i1a-glibc-cross-alpha-unknown-linux-gnu-2.24/lib/ld-linux.so.2, \
    for GNU/Linux 3.2.0, not stripped

gcc for alpha uses 'GLIBC_DYNAMIC_LINKER<TAB>"/lib/ld-linux.so.2"'

* gnu/packages/gcc.scm (gcc-4.7): fix GLIBC_DYNAMIC_LINKER substitution when delimiter is a tab

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
---
 gnu/packages/gcc.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 00e2fa7d6..0fdb5ca9b 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -213,7 +213,7 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                 ;; Fix the dynamic linker's file name.
                 (substitute* (find-files "gcc/config"
                                          "^(linux|gnu|sysv4)(64|-elf|-eabi)?\\.h$")
-                  (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ ]*).*$"
+                  (("#define (GLIBC|GNU_USER)_DYNAMIC_LINKER([^ \t]*).*$"
                     _ gnu-user suffix)
                    (format #f "#define ~a_DYNAMIC_LINKER~a \"~a\"~%"
                            gnu-user suffix
-- 
2.12.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0001-gnu-libffi-apply-alpha-build-fix.patch --]
[-- Type: text/x-patch, Size: 3295 bytes --]

From 5d31bb14ce6aaecfaf022616e538470036916cef Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@inbox.ru>
Date: Mon, 6 Mar 2017 22:21:43 +0000
Subject: [PATCH] gnu: libffi: apply alpha build fix

* gnu/packages/patches/libffi-3.2.1-complex_alpha.patch: new file
* gnu/local.mk (dist_patch_DATA): add patch
* gnu/packages/libffi.scm (libffi): apply Gentoo patch to fix alpha build
---
 gnu/local.mk                                       |  1 +
 gnu/packages/libffi.scm                            |  3 ++-
 .../patches/libffi-3.2.1-complex_alpha.patch       | 27 ++++++++++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/libffi-3.2.1-complex_alpha.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 0f3b4bd7a..83761b6d0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -695,6 +695,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/libevent-2.1-skip-failing-test.patch	\
   %D%/packages/patches/libextractor-ffmpeg-3.patch		\
   %D%/packages/patches/libgit2-use-after-free.patch		\
+  %D%/packages/patches/libffi-3.2.1-complex_alpha.patch		\
   %D%/packages/patches/libjxr-fix-function-signature.patch	\
   %D%/packages/patches/libjxr-fix-typos.patch			\
   %D%/packages/patches/liboop-mips64-deplibs-fix.patch		\
diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm
index 13938f7ee..14edc6d4d 100644
--- a/gnu/packages/libffi.scm
+++ b/gnu/packages/libffi.scm
@@ -42,7 +42,8 @@
                              name "-" version ".tar.gz"))
              (sha256
               (base32
-               "0dya49bnhianl0r65m65xndz6ls2jn1xngyn72gd28ls3n7bnvnh"))))
+               "0dya49bnhianl0r65m65xndz6ls2jn1xngyn72gd28ls3n7bnvnh"))
+             (patches (search-patches "libffi-3.2.1-complex_alpha.patch"))))
     (build-system gnu-build-system)
     (arguments `(#:phases (alist-cons-after 'install 'post-install
                                             ,post-install-phase
diff --git a/gnu/packages/patches/libffi-3.2.1-complex_alpha.patch b/gnu/packages/patches/libffi-3.2.1-complex_alpha.patch
new file mode 100644
index 000000000..5b7095bfd
--- /dev/null
+++ b/gnu/packages/patches/libffi-3.2.1-complex_alpha.patch
@@ -0,0 +1,27 @@
+The patch fixes build failure of form:
+     ../src/alpha/osf.S:298:2: error: #error "osf.S out of sync with ffi.h"
+Upstream fixed the bug in a more invasive way
+but didn't have releases since 3.2.1.
+
+The patch is taken from Gentoo:
+https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/libffi/files/libffi-3.2.1-complex_alpha.patch
+--- libffi-3.2.1/src/alpha/osf.S.orig	2015-01-16 10:46:15.000000000 +0100
++++ libffi-3.2.1/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
+ 
-- 
2.12.2


[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

       reply	other threads:[~2017-04-12 21:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170219193158.4060-1-slyfox@inbox.ru>
     [not found] ` <878tojiqpm.fsf@openmailbox.org>
     [not found]   ` <20170307223814.0cb630e3@sf>
     [not found]     ` <87d1dsbo6u.fsf@openmailbox.org>
     [not found]       ` <87shmnn9ct.fsf@gnu.org>
2017-04-12 20:59         ` Sergei Trofimovich [this message]
2017-04-13 12:50           ` bug#25799: [PATCH] gnu: add basic support for "alpha-linux" system Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170412215944.3fa356d1@sf \
    --to=slyfox@inbox.ru \
    --cc=25799@debbugs.gnu.org \
    --cc=kei@openmailbox.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).