kassane / anotherBuildStep

zig build add-on (add more toolchains [LLVM-based] support)
Mozilla Public License 2.0
6 stars 0 forks source link

D lang: cross-compile with Druntime + Phobos2 #6

Open kassane opened 5 months ago

kassane commented 5 months ago

Currently, the available example, it can be seen that non-native build only -betterC mode is supported. (This is not on purpose - I'm not anti-GC).

Based on an experiment using meson (by @denizzzka). I ported to zig-build (with ABS), however the version used did not yet support cross-compilation in D, which had already been corrected previously.

To guarantee this possibility, you would need to obtain access to the source code of Druntime and Phobos2, both standalone. In the case of fortran-runtime (current release already available) is builded using zig c++ and included on: https://github.com/kassane/anotherBuildStep/blob/a1f40f90f17fa6d2681f9d46cf8dbc37d4f1ea89/toolchains/flang.zig#L176-L184

kassane commented 5 months ago

PoC: https://github.com/kassane/druntime-zigbuild