guix-patches
[Top][All Lists]
Advanced

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

[bug#49880] [PATCH 1/2] gnu: gmp-boot: Fix build on powerpc64le-linux


From: Ludovic Courtès
Subject: [bug#49880] [PATCH 1/2] gnu: gmp-boot: Fix build on powerpc64le-linux
Date: Wed, 11 Aug 2021 23:29:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi!

Thiago Jung Bauermann <bauermann@kolabnow.com> skribis:

> Linux on powerpc64 used to run in big-endian mode only.  When support for
> little-endian mode was added around 2014, they took the opportunity to
> update the ELF ABI.  The new ABI is known as ELF ABI v2, and the old one
> retroactively called ELF ABI v1.
>
> GMP 4.3.2 was released in 2010, so its hand-optimized assembly code for
> powerpc64 only support ELF ABI v1.  This causes a build failure on
> powerpc64le-linux, which can be fixed by passing a host triplet with the
> “none” CPU type.  This tells the configure script to use generic C code for
> the build.
>
> * gnu/packages/commencement.scm (gmp-boot)[arguments]{#:configure-flags}: Add
> “--host=none-unknown-linux-gnu” for powerpc64le targets.

[...]

> +     (substitute-keyword-arguments (package-arguments gmp)
> +       ((#:configure-flags gmp-configure-flags)
> +        `(cons* ,@(if (string-prefix? "powerpc64le-" (or 
> (%current-target-system)
> +                                                         (%current-system)))
> +                      ;; The powerpc64 assembly code in this version of GMP
> +                      ;; only supports the ELF ABI v1 but powerpc64le uses 
> ELF
> +                      ;; ABI v2, so use the generic C code instead.  This is
> +                      ;; done by specifying the CPU type as “none”.
> +                      ;;
> +                      ;; According to the manual, “this will run quite 
> slowly,
> +                      ;; but it should be portable and should at least make 
> it
> +                      ;; possible to get something running if all else 
> fails.”
> +                      '("--host=none-unknown-linux-gnu")
> +                      '())
> +                ,gmp-configure-flags))))))

The patch LGTM.  However, could you tweak it so we can apply it on
‘core-updates-frozen’ while not triggering a rebuild on other arches?
Something like:

  (if (string-prefix? …)
      `(cons … ,gmp-configure-flags)
      gmp-configure-flags)

TIA!

Ludo’.





reply via email to

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