ilbers / isar

Integration System for Automated Root filesystem generation
Other
177 stars 72 forks source link

How to add a customized toolchain #87

Open yli147 opened 2 years ago

yli147 commented 2 years ago

Hi,

We are doing some changes to the toolchain, and want to build the riscv64 toolchain by ourselves, Do you know how to integrate our own build toolchain building process to the isar system.

I can see there already one pre-installed crossbuild-essential-riscv64, the question is how to build a new one rather than use the community generated toolchain https://github.com/ilbers/isar/tree/master/meta/recipes-devtools/crossbuild-essential-riscv64

Thanks

jan-kiszka commented 2 years ago

That crossbuild-essential package is just a meta package that compensates the missing one in Debian upstream.

When you are building your own toolchain, you are leaving the common Debian path. You can use Isar to rebuild all packages, at least in theory. But all the benefits of using a standard distro are gone and, thus, no one is doing that in practice. Consequently, there is no convenient way of doing that so far.

If you want your own toolchain quickly, use OE, Yocto or buildroot. If you want to fix / enhance the Debian toolchain, open a bug with upstream or submit a patch there.

ismagulb commented 2 years ago

Hi @yli147,

bootstrapping a new toolchain with Isar should in theory be possible but I expect some complexities on the way. I'm personally interested in that but we are not investing into it at the moment.

A simpler first step could be to have your toolchain in a separate apt repo and get it installed into the sbuild environment -- we did that with Isar's predecessor but not tried with Isar itself.

Just out of curiosity, what is the motivation to use a different compiler? Which versions of Debian and compiler are you targeting for?

yli147 commented 2 years ago

Hi, ->A simpler first step could be to have your toolchain in a separate apt repo and get it installed into the sbuild environment -- we did that with Isar's predecessor but not tried with Isar itself. We probably choose this appoach, will give feedback once any update

->Just out of curiosity, what is the motivation to use a different compiler? Which versions of Debian and compiler are you targeting for? We may want to do some specific optmization to the toolchain, before upstream, we may need maintain our own repo, and use it to build our image

yli147 commented 1 year ago

Forgot to update, we enabled cursomized toolchain compiling by using the following Arch options in BB file, so the cross compile toolchain can also be generated from source code and used in the isar system

HOST_ARCH = "amd64" DPKG_ARCH ?= "amd64" DISTRO_ARCH = "riscv64" PACKAGE_ARCH = "amd64"