[bug#47182,00/18] Add support for powerpc64le-linux (wip-ppc64le-for-master)

Message ID 20210316062805.2890883-1-cmmarusich@gmail.com
Headers show
Series Add support for powerpc64le-linux (wip-ppc64le-for-master) | expand

Message

Christopher Marusich March 16, 2021, 6:28 a.m. UTC
This patch series comes from the wip-ppc64le-for-master branch.  This
branch contains commits that add support for a new system type,
powerpc64le-linux.  The powerpc64le-linux system can be run on
freedom-friendly hardware like the Talos II and Blackbird family of
POWER9 systems built by Raptor Computing Systems.  These patches add
support for Guix only, not for Guix System; Guix System support will
come later.

These patches are specifically crafted so they do not rebuild the
world for existing architectures.  Therefore, they can be applied
directly to master.  I have verified that, after applying these
patches to master, I am able to build (on a Debian ppc64le GNU/Linux
system) a release binary of Guix for the powerpc64le-linux system
successfully.  Additionally, I am able to install this release binary
and do "guix pull" successfully in a fresh Debian ppc64le GNU/Linux
VM, and I am able to build and run GNU Hello in that VM using the
newly pulled Guix.

I think these patches are ready to apply to master, and I hope they
will be included in the next release.  Many thanks to Léo Le Bouter
and Efraim Flashner for their help in making these changes.  Please
review and let me know if there is anything that can be done better.

Chris Marusich (11):
  gnu: bootstrap: Add support for powerpc64le-linux.
  utils: Add target-powerpc? procedure.
  gnu: gcc-4.7: On powerpc64le, fix /lib64 references.
  gnu: gcc-boot0: Enable 128-bit long double for POWER9.
  gnu: binutils-final: Support more Power architectures.
  Add powerpc64le-linux as a supported Guix architecture.
  syscalls: Fix clone on powerpc64le-linux.
  syscalls: Fix RNDADDTOENTCNT on powerpc64le-linux.
  ci: %cross-targets: Add powerpc64le-linux-gnu.
  utils: Fix target-64bit? on powerpc64le-linux.
  gnu: sed: Make it build on SELinux-enabled kernels.

Efraim Flashner (1):
  gnu: binutils-final: Provide bash for binary on powerpc-linux.

Leo Le Bouter (6):
  gnu: glibc: Fix ldd path on powerpc*.
  gnu: bdb-4.8: Fix configure on powerpc64le-linux.
  gnu: guile-avahi: Fix compilation on powerpc64le-linux.
  gnu: texlive-bin: Fix compilation on powerpc64le*.
  gnu: texlive-latex-base: Fix compilation on powerpc64le*.
  gnu: libelf: Fix compilation for powerpc64le-linux.

 Makefile.am                                  |  4 +-
 etc/guix-install.sh                          |  4 ++
 gnu/ci.scm                                   |  1 +
 gnu/local.mk                                 |  1 +
 gnu/packages/base.scm                        | 32 +++++++++++++++-
 gnu/packages/bootstrap.scm                   | 39 +++++++++++++++++++-
 gnu/packages/commencement.scm                | 28 ++++++++++++--
 gnu/packages/dbm.scm                         |  6 +++
 gnu/packages/elf.scm                         |  5 +++
 gnu/packages/gcc.scm                         | 38 +++++++++++++++----
 gnu/packages/guile-xyz.scm                   |  4 ++
 gnu/packages/patches/glibc-ldd-powerpc.patch | 10 +++++
 gnu/packages/tex.scm                         | 26 ++++++++++---
 guix/build/syscalls.scm                      |  8 +++-
 guix/packages.scm                            |  4 +-
 guix/utils.scm                               |  8 +++-
 m4/guix.m4                                   |  3 +-
 tests/guix-build.sh                          |  6 ++-
 18 files changed, 201 insertions(+), 26 deletions(-)
 create mode 100644 gnu/packages/patches/glibc-ldd-powerpc.patch

Comments

Léo Le Bouter March 16, 2021, 9:33 a.m. UTC | #1
As discussed on IRC, it turns out no world rebuild happens:

$ ./pre-inst-env guix build --system=x86_64-linux -d --no-grafts
texlive-bin texlive-latex-base libelf bdb sed hello gcc-toolchain
/gnu/store/9f3vsmg2c9qa91r1dlffbnpr0kbzpvxy-gcc-toolchain-10.2.0.drv
/gnu/store/sihk9hiiqhqkckjs4dzl2vdk5dfv2923-hello-2.10.drv
/gnu/store/kmpw9qv3pdc31q3b3mnsr8ypqkcd4q95-sed-4.8.drv
/gnu/store/2vq0yvhrn6mk2lr40mabhnx6r0pdrccn-bdb-6.2.32.drv
/gnu/store/mj1q7a8x4hv2c5n1xqnakxhsf5fny609-libelf-0.8.13.drv
/gnu/store/qhnf8nqblgz22id4fzn2bb94mbdzghpk-texlive-latex-base-
51265.drv
/gnu/store/pwhz1k213dd8bsc9sq85vds1cqjwc1by-texlive-bin-20190410.drv

With commit 16cc8f8851ee38dfaa74ef976b0609a837ba682d (current wip-
ppc64le-for-master) which includes those patches AIUI.
Christopher Marusich March 17, 2021, 6:58 a.m. UTC | #2
Léo Le Bouter <lle-bout@zaclys.net> writes:

> As discussed on IRC, it turns out no world rebuild happens:

Yes, and Christopher Baines explained that the outputs matter, not the
derivations themselves.  The outputs of hello and gcc-toolchain are the
same on master as they are on the tip of wip-ppc64le-for-master, so I
think I was just confused: we are good to merge to master, after all.
Christopher Baines March 17, 2021, 8:33 p.m. UTC | #3
Chris Marusich <cmmarusich@gmail.com> writes:

> Léo Le Bouter <lle-bout@zaclys.net> writes:
>
>> As discussed on IRC, it turns out no world rebuild happens:
>
> Yes, and Christopher Baines explained that the outputs matter, not the
> derivations themselves.  The outputs of hello and gcc-toolchain are the
> same on master as they are on the tip of wip-ppc64le-for-master, so I
> think I was just confused: we are good to merge to master, after all.

Thanks for sending these patches, that means they've appeared in
Patchwork [1] and that the Guix Data Service has processed it as a patch
series [2].

1: https://patches.guix-patches.cbaines.net/project/guix-patches/list/?series=7335
2: https://data.guix-patches.cbaines.net/compare?base_commit=341dfe7eda4972af0a027357015ea595314438b0&target_commit=4757434caeac0077f67583701653a7b89a335e61

Looking at that comparison, it seems good to merge! The new
powerpc64le-linux derivations could be computed, and there's a
relatively small number of x86_64-linux derivations affected [3], which
is good, as this can be merged to master then.

3: https://data.guix-patches.cbaines.net/compare/package-derivations?base_commit=341dfe7eda4972af0a027357015ea595314438b0&target_commit=4757434caeac0077f67583701653a7b89a335e61&system=x86_64-linux&target=none&build_change=&after_name=&limit_results=&all_results=on

Chris
Christopher Marusich March 18, 2021, 6:08 a.m. UTC | #4
Christopher Baines <mail@cbaines.net> writes:

> Chris Marusich <cmmarusich@gmail.com> writes:
>
>> Léo Le Bouter <lle-bout@zaclys.net> writes:
>>
>>> As discussed on IRC, it turns out no world rebuild happens:
>>
>> Yes, and Christopher Baines explained that the outputs matter, not the
>> derivations themselves.  The outputs of hello and gcc-toolchain are the
>> same on master as they are on the tip of wip-ppc64le-for-master, so I
>> think I was just confused: we are good to merge to master, after all.
>
> Thanks for sending these patches, that means they've appeared in
> Patchwork [1] and that the Guix Data Service has processed it as a patch
> series [2].
>
> 1: https://patches.guix-patches.cbaines.net/project/guix-patches/list/?series=7335
> 2:
> https://data.guix-patches.cbaines.net/compare?base_commit=341dfe7eda4972af0a027357015ea595314438b0&target_commit=4757434caeac0077f67583701653a7b89a335e61
>
> Looking at that comparison, it seems good to merge! The new
> powerpc64le-linux derivations could be computed, and there's a
> relatively small number of x86_64-linux derivations affected [3], which
> is good, as this can be merged to master then.
>
> 3:
> https://data.guix-patches.cbaines.net/compare/package-derivations?base_commit=341dfe7eda4972af0a027357015ea595314438b0&target_commit=4757434caeac0077f67583701653a7b89a335e61&system=x86_64-linux&target=none&build_change=&after_name=&limit_results=&all_results=on
>
> Chris

Awesome!  Thank you for this additional information.  It's very helpful.

It looks like a few hundred packages, according to that page.  I've
looked at the patches and I'm not sure exactly why they are rebuilt.
One guess is that perhaps changes to build-side code (e.g.,
guix/build/syscalls.scm) are getting included in the output of some
derivations (maybe module-import-compiled derivations?) whose knock-on
effects down the line are not obvious.

In any case, it's "only" a few hundred packages, judging by the page
Chris linked.  I would argue that it is better to merge this for the
release and just rebuild those few hundred packages, rather than to
postpone a change that will make it significantly easier for curious
people to hop in and try out / help out with the powerpc64le-linux port.
I think we've done a pretty good job of limiting the "rebuild" blast
radius, so I think we should go ahead and merge it.
Christopher Marusich March 24, 2021, 6:36 a.m. UTC | #5
Hi,

I have applied this patch series to the master branch and pushed it to
Savannah.  The final commit in the series is
65c46e79e0495fe4d32f6f2725d7233fff10fd70.

Before pushing, I verified again that it still builds both on a Debian
ppc64le machine, as well as on a Fedora amd64 machine.