Subject: [bug#73277] [PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant.

From: Jean-Pierre De Jesus Diaz <[email-masked]>
Date: Mon, 16 Sep 2024 12:00:17 +0000

Hello,

Just letting you know that using `cross-gcc-toolchain` is preferred
and since the usage
is to provide a PS1 SDK I think you can add this to the list of bare
metal targets in Guix.

See `guix build --list-targets', for example it contains avr,
xtensa-ath9k-elf and or1k-elf.

This can be done by adding a variable to:

- `guix/platforms/mips.scm'

So, this should allow to add this target as an argument to your
`psn00bsdk' package:

For example:

(arguments
  (list #:target "mipsel-none-elf"
        ...))

And the build system will:

1. Automayically add the cross-gcc compiler.
2. Will also cross-compile inputs (excluding native-inputs, of course).

So that will allow you to unbundle the dependencies as you could just build
each one independently for that target (or for all ones, if the
library supports it).

With this though you'll probably need to create a separate package for
the tools and
one for the code that runs on the PS1 itself.

You can take inspiration from the existing bare-metal targets and
packages compiled
like this (which are few), there is firmware on
`gnu/packages/firmware.scm' that does
this.  Also the QMK firmware for keyboards use the Guix
cross-compilation mechanism
too.

Additionally, you can provide the toolchain as a package on the
`gnu/package/cross-toolchain.scm` module.