mbox series

[bug#50091,00/21] Add riscv64 support

Message ID cover.1629193993.git.efraim@flashner.co.il
Headers show
Series Add riscv64 support | expand

Message

Efraim Flashner Aug. 17, 2021, 10:10 a.m. UTC
This is the current tree for wip-riscv, which I rebase regularly on top
of core-updates-frozen. I'm not in love with raw-build-guile3 in
gnu/packages/bootstrap but I wasn't able to find another way to make it
work. I'll add some comments in response to the patches.

Everything was built using a SiFive HiFive Unmatched board¹. As a
comparison, my pine64 passed the build phase in mesa in 89 minutes, and
this board built it in 66 minutes.

¹ https://www.sifive.com/boards/hifive-unmatched

Efraim Flashner (21):
  utils: Define 'target-riscv?' predicate.
  gnu: bootstrap: Add support for riscv64-linux.
  gnu: gcc-boot0: Use libstdc++-boot0-gcc7 on riscv64-linux.
  gnu: %boot3-inputs: Add missing input.
  gnu: guile: Fix building on riscv64-linux.
  gnu: %final-inputs: Add implied gcc:lib input.
  gnu: bdb: Fix building on riscv64-linux.
  gnu: elfutils: Fix building on riscv64-linux.
  gnu: pcre: Fix building on riscv64-linux.
  gnu: openssl: Fix build on riscv64-linux.
  gnu: libtool: Fix building on riscv64-linux.
  gnu: openblas: Fix building on riscv64-linux.
  gnu: mesa: Add support for riscv64-linux.
  gnu: pcre2: Fix building on riscv64-linux.
  gnu: icu4c: Skip tests on riscv64-linux.
  gnu: openblas-ilp64: Add riscv64-linux as a supported architecture.
  gnu: openlibm: Remove riscv64-linux from supported systems.
  gnu: texlive-bin: Fix building on riscv64-linux.
  gnu: texlive-updmap.cfg: Update hash.
  gnu: lz4: Build on riscv64-linux without valgrind.
  gnu: lapack: Fix building on riscv64-linux.

 gnu/packages/bootstrap.scm                    | 112 +++++++++++++++++-
 gnu/packages/commencement.scm                 |  58 ++++++++-
 gnu/packages/compression.scm                  |   4 +-
 gnu/packages/dbm.scm                          |  23 ++--
 gnu/packages/elf.scm                          |  11 +-
 gnu/packages/gl.scm                           |  26 ++--
 gnu/packages/guile.scm                        |  22 ++--
 gnu/packages/icu4c.scm                        |   8 ++
 gnu/packages/maths.scm                        |  10 +-
 .../patches/libtool-skip-tests2.patch         |   8 +-
 gnu/packages/pcre.scm                         |  13 +-
 gnu/packages/tex.scm                          |  20 ++--
 gnu/packages/tls.scm                          |  11 +-
 guix/packages.scm                             |   4 +-
 guix/utils.scm                                |   9 +-
 m4/guix.m4                                    |   4 +-
 16 files changed, 283 insertions(+), 60 deletions(-)

Comments

Sarah Morgensen Aug. 17, 2021, 7:33 p.m. UTC | #1
Hi Efraim,

Efraim Flashner <efraim@flashner.co.il> writes:

> * gnu/packages/tls.scm (openssl)[arguments]: Add phase for riscv64-linux
> to skip failing test.
> (target->openssl-target): Add case for riscv64-linux.
> ---
>  gnu/packages/tls.scm | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
> index 4b8df04f17..f6cdeac363 100644
> --- a/gnu/packages/tls.scm
> +++ b/gnu/packages/tls.scm
> @@ -337,7 +337,10 @@ OpenSSL for TARGET."
>          ((string-prefix? "powerpc64" target)
>           "linux-ppc64")
>          ((string-prefix? "powerpc" target)
> -         "linux-ppc")))
> +         "linux-ppc")
> +        ((string-prefix? "riscv64" target)
> +         ;; linux64-riscv64 isn't recognized until 3.0.0.
> +         "linux-generic64")))
>  
>  (define-public openssl
>    (package
> @@ -380,6 +383,12 @@ OpenSSL for TARGET."
>                                 #$(target->openssl-target
>                                    (%current-target-system))))))
>                  #~())
> +         ;; Unclear why this test is failing.
> +         #$@(if (target-riscv?)
> +              #~((add-after 'unpack 'skip-failing-test
> +                   (lambda _
> +                     (delete-file "test/recipes/30-test_afalg.t"))))
> +              #~())
>           (replace 'configure
>             (lambda* (#:key configure-flags #:allow-other-keys)
>               (let* ((out #$output)

This test is also failing on aarch64 [0] and has been reported upstream
for some time [1] with no action.

Looks like it can also be disabled with

  make TESTS=-test_afalg test

if that's more desirable.

[0] https://ci.guix.gnu.org/build/29270/details
[1] https://github.com/openssl/openssl/issues/12242

--
Sarah
Efraim Flashner Aug. 18, 2021, 7:09 a.m. UTC | #2
On Tue, Aug 17, 2021 at 12:33:45PM -0700, Sarah Morgensen wrote:
> Hi Efraim,
> 
> Efraim Flashner <efraim@flashner.co.il> writes:
> 
> > * gnu/packages/tls.scm (openssl)[arguments]: Add phase for riscv64-linux
> > to skip failing test.
> > (target->openssl-target): Add case for riscv64-linux.
> > ---
> >  gnu/packages/tls.scm | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
> > index 4b8df04f17..f6cdeac363 100644
> > --- a/gnu/packages/tls.scm
> > +++ b/gnu/packages/tls.scm
> > @@ -337,7 +337,10 @@ OpenSSL for TARGET."
> >          ((string-prefix? "powerpc64" target)
> >           "linux-ppc64")
> >          ((string-prefix? "powerpc" target)
> > -         "linux-ppc")))
> > +         "linux-ppc")
> > +        ((string-prefix? "riscv64" target)
> > +         ;; linux64-riscv64 isn't recognized until 3.0.0.
> > +         "linux-generic64")))
> >  
> >  (define-public openssl
> >    (package
> > @@ -380,6 +383,12 @@ OpenSSL for TARGET."
> >                                 #$(target->openssl-target
> >                                    (%current-target-system))))))
> >                  #~())
> > +         ;; Unclear why this test is failing.
> > +         #$@(if (target-riscv?)
> > +              #~((add-after 'unpack 'skip-failing-test
> > +                   (lambda _
> > +                     (delete-file "test/recipes/30-test_afalg.t"))))
> > +              #~())
> >           (replace 'configure
> >             (lambda* (#:key configure-flags #:allow-other-keys)
> >               (let* ((out #$output)
> 
> This test is also failing on aarch64 [0] and has been reported upstream
> for some time [1] with no action.

I was able to build openssl without any problems on my pine64, I'll run
it again and see what I come up with.

Looking at the bug report, it looks like it also might be kernel
dependant and/or related to cross compiling. I'm pretty sure the aarch64
builders are running Guix System, and my pine64 is running Armbian.

I'll go ahead and disable it for all the arm* architectures.

> Looks like it can also be disabled with
> 
>   make TESTS=-test_afalg test
> 
> if that's more desirable.

I do like that better.

> [0] https://ci.guix.gnu.org/build/29270/details
> [1] https://github.com/openssl/openssl/issues/12242
> 
> --
> Sarah
Efraim Flashner Aug. 18, 2021, 10:44 a.m. UTC | #3
On Wed, Aug 18, 2021 at 10:09:39AM +0300, Efraim Flashner wrote:
> On Tue, Aug 17, 2021 at 12:33:45PM -0700, Sarah Morgensen wrote:
> > Hi Efraim,
> > 
> > Efraim Flashner <efraim@flashner.co.il> writes:
> > 
> > > * gnu/packages/tls.scm (openssl)[arguments]: Add phase for riscv64-linux
> > > to skip failing test.
> > > (target->openssl-target): Add case for riscv64-linux.
> > > ---
> > >  gnu/packages/tls.scm | 11 ++++++++++-
> > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
> > > index 4b8df04f17..f6cdeac363 100644
> > > --- a/gnu/packages/tls.scm
> > > +++ b/gnu/packages/tls.scm
> > > @@ -337,7 +337,10 @@ OpenSSL for TARGET."
> > >          ((string-prefix? "powerpc64" target)
> > >           "linux-ppc64")
> > >          ((string-prefix? "powerpc" target)
> > > -         "linux-ppc")))
> > > +         "linux-ppc")
> > > +        ((string-prefix? "riscv64" target)
> > > +         ;; linux64-riscv64 isn't recognized until 3.0.0.
> > > +         "linux-generic64")))
> > >  
> > >  (define-public openssl
> > >    (package
> > > @@ -380,6 +383,12 @@ OpenSSL for TARGET."
> > >                                 #$(target->openssl-target
> > >                                    (%current-target-system))))))
> > >                  #~())
> > > +         ;; Unclear why this test is failing.
> > > +         #$@(if (target-riscv?)
> > > +              #~((add-after 'unpack 'skip-failing-test
> > > +                   (lambda _
> > > +                     (delete-file "test/recipes/30-test_afalg.t"))))
> > > +              #~())
> > >           (replace 'configure
> > >             (lambda* (#:key configure-flags #:allow-other-keys)
> > >               (let* ((out #$output)
> > 
> > This test is also failing on aarch64 [0] and has been reported upstream
> > for some time [1] with no action.
> 
> I was able to build openssl without any problems on my pine64, I'll run
> it again and see what I come up with.
> 
> Looking at the bug report, it looks like it also might be kernel
> dependant and/or related to cross compiling. I'm pretty sure the aarch64
> builders are running Guix System, and my pine64 is running Armbian.
> 
> I'll go ahead and disable it for all the arm* architectures.
> 
> > Looks like it can also be disabled with
> > 
> >   make TESTS=-test_afalg test
> > 
> > if that's more desirable.
> 
> I do like that better.
> 
> > [0] https://ci.guix.gnu.org/build/29270/details
> > [1] https://github.com/openssl/openssl/issues/12242
> > 

I've pushed the arm* version to core-updates