dotnet / source-build

A repository to track efforts to produce a source tarball of the .NET Core SDK and all its components
MIT License
261 stars 128 forks source link

[Discussion] Better support for OpenEmbedded / Yocto #655

Open Tragetaschen opened 6 years ago

Tragetaschen commented 6 years ago

Yocto is a meta-distribution that you customize for your own (usually embedded) platform using layers containing recipes for libraries and tools. It's build-tool is called bitbake. Im running on the "sumo" release.

During the last two days, I've updated my OpenEmbedded layer to use this source-build repository when building the .NET Core 2.1 runtime. Currently these efforts are limited to Linux/ARM, because the cross-compilation infrastructure assumes quite a lot that isn't true in the bitbake environment, and bending the source-build build tools is quite architecture specific.

Within the bitbake build environment, I have a fully and correctly set up cross-compilation environment with

The ad-hoc patches to source-build and the submodules scatter parts of that into the necessary places so the result is a working executable on the target platform.

In particular:

Interestingly, I was able to successfully use a lot more recent tools and libraries. For instance, clang 6.0.1 or Glibc 2.27 nearly out of the box (https://github.com/dotnet/coreclr/18983)

I had looked into skipping the build scripts and instead distill what they do into my recipe, but found the amount of setup before the actual calls to cmake too infeasible. Also, this wouldn't scale to any future build changes.

In the end, I would love to see broader support for cross-compilation beyond the explicit and hard-coded platforms currently available through the build script.

Thoughts?

dleeapho commented 6 years ago

/cc @leecow @richlander

deinok commented 5 years ago

@Tragetaschen I'm very interested in this but in a i586x embedded device. (For now i'm using mono) I'm working on setting up dotnet in x86 but the final target will be a yocto based device.