Skip to content

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

@kassane

Description

@kassane

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:

if (options.runtime) {
const flang_dep = buildFortranRuntime(b, .{
.target = options.target,
.optimize = options.optimize,
});
flang_exec.addArtifactArg(flang_dep.artifact("FortranRuntime"));
flang_exec.addArtifactArg(flang_dep.artifact("FortranDecimal"));
flang_exec.addArtifactArg(flang_dep.artifact("Fortran_main"));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions