Hi Gabriel,

Gabriel Wicki <gabr...@erlikon.ch> writes:

> Interesting!  Do I understand correctly that these are like manifests,
> but work for cross-compilation contexts?

Yes. You can choose what packages are native inputs (same as
packages->manifest), what ones are target (those are runnable on the
build system, but are meant for the target, example is the cross-glib
and cross-gcc, or in what you mentioned the
make-arm-none-eabi-toolchain-12.3.rel1),
what are inputs (those are runnable on the target, so they will be cross
compiled on your system, and you can link the built sw against those
libraries, like guix build would)

> So that `gcc` would be linked
> to a gcc-arm-none-eabi, and the needed libraries also ready to use/link
> against for the specified architecture?
>
> So, kind of like a `guix shell -D u-boot --target=riscv64-linux-gnu`, so
> I can manually build some kernel, bootloader or other software with the
> same tooling a `guix build --target=foo u-boot` would?

Exactly, you should get the same (or very similar) environment as you
get in guix build --target.

>
> I currently used manifests like so:
>
> --8<---------------cut here---------------start------------->8---
> (define arm-toolchain (make-arm-none-eabi-toolchain-12.3.rel1))
> --8<---------------cut here---------------end--------------->8---
> but only to a rather limited degree.

Yes, this is the current solution, and sometimes something like this is
even warranted. This makes a toolchain mostly very similar to the
official one from ARM, but building everything from source rather than
relying on their pre-built one.

>
>
> How can I use/try your code?

There are multiple ways, in my last e-mail I shared the repository, so
the fastest way is to just clone it and add it to the load path. I have
./env file in the repo that does just that, so when you `./env guix
shell`, you can use it. Alternatively you can add the repo as a channel
and time-machine/pull from it.

I shared a simple example last time to compile bash, I don't know what
your use case is so I cannot really say anything more about that other
than to try it with other packages / projects that you are interested in.

After you make the package with make-cross-profile-package it's just a
matter of making a shell out of this, like with `guix shell -f` if
returned from a file.

Rutherther

Reply via email to