guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25799: [PATCH] gnu: add basic support for "alpha-linux" system


From: Kei Kebreau
Subject: bug#25799: [PATCH] gnu: add basic support for "alpha-linux" system
Date: Tue, 07 Mar 2017 19:35:21 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Sergei Trofimovich <address@hidden> writes:

> On Sun, 05 Mar 2017 12:22:13 -0500
> Kei Kebreau <address@hidden> wrote:
>
>> Sergei Trofimovich <address@hidden> writes:
>> 
>> > 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
>> >
>> > The only slighty nontrivial change is GLIBC_DYNAMIC_LINKER change:
>> > glibc for alpha uses 'GLIBC_DYNAMIC_LINKER<TAB>"/lib/ld-linux.so.2"'
>> >
>> > * gnu/packages/bootstrap.scm (glibc-dynamic-linker): add 
>> > "/lib/ld-linux.so.2" as "alpha-linux" ld.so
>> > * gnu/packages/gcc.scm (gcc-4.7): fix GLIBC_DYNAMIC_LINKER substitution 
>> > when delimiter is a tab
>> > * gnu/packages/linux.scm (system->linux-architecture): add "alpha" arch
>> >
>> > Signed-off-by: Sergei Trofimovich <address@hidden>
>> > ---
>> >  gnu/packages/bootstrap.scm | 1 +
>> >  gnu/packages/gcc.scm       | 2 +-
>> >  gnu/packages/linux.scm     | 1 +
>> >  3 files changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
>> > index c8d94c830..b4847094b 100644
>> > --- a/gnu/packages/bootstrap.scm
>> > +++ b/gnu/packages/bootstrap.scm
>> > @@ -167,6 +167,7 @@ successful, or false to signal an error."
>> >          ((string=? system "i586-gnu") "/lib/ld.so.1")
>> >          ((string=? system "i686-gnu") "/lib/ld.so.1")
>> >          ((string=? system "aarch64-linux") "/lib/ld-linux-aarch64.so.1")
>> > +        ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
>> >  
>> >          ;; XXX: This one is used bare-bones, without a libc, so add a case
>> >          ;; here just so we can keep going.
>> > diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
>> > index cfd33f85a..7522f1c7f 100644
>> > --- a/gnu/packages/gcc.scm
>> > +++ b/gnu/packages/gcc.scm
>> > @@ -212,7 +212,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)(64|-elf|-eabi)?\\.h$")
>> > -                  (("#define GLIBC_DYNAMIC_LINKER([^ ]*).*$" _ suffix)
>> > +                  (("#define GLIBC_DYNAMIC_LINKER([^ \t]*).*$" _ suffix)
>> >                     (format #f "#define GLIBC_DYNAMIC_LINKER~a \"~a\"~%"
>> >                             suffix
>> >                             (string-append libc ,(glibc-dynamic-linker)))))
>> > diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
>> > index 9212b40a1..7d59faf4a 100644
>> > --- a/gnu/packages/linux.scm
>> > +++ b/gnu/packages/linux.scm
>> > @@ -106,6 +106,7 @@
>> >            ((string-prefix? "mips" arch) "mips")
>> >            ((string-prefix? "arm" arch) "arm")
>> >            ((string-prefix? "aarch64" arch) "arm64")
>> > +          ((string-prefix? "alpha" arch) "alpha")
>> >            (else arch))))
>> >  
>> >  (define (linux-libre-urls version)  
>> 
>> Hi Sergei,
>> 
>> I'm not sure what the requirements for accepting another architecture
>> into the codebase are, but I did try to build the bootstrap tarballs
>> with this patch applied. I got a failure when building libffi:
>> 
>> ../src/alpha/osf.S:298:2: error: #error "osf.S out of sync with ffi.h"
>
> [ Apologies to Kei who likely received this patch at least twice,
>   I have no idea or logs why git send-email does not hit guix-patches.
>   duplicating patch link here for debbugs ]
>

Not a problem. :-)

> 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, so I've been building the bootstrap tarballs continuously
for at least seven hours now. Once the build succeeds I'll see about
committing this.

Thanks!

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]