Cross compilation idea.
Rel
relmail at rambler.ru
Sat Aug 1 10:26:12 UTC 2020
Lately I've been looking at Zig programming language. Besides
other interesting features like error handling and automatically
importing C headers, one feature made me really excited. Zig
includes a minified version of musl's, glibc's and mingw's CRT,
so it can cross compile stuff very easy. And for whatever reason
it includes a C cross compiler as well (I guess they already had
libclang bundled for importing C headers, so it was kinda easy to
use it to compile C).
As far as I understand there are few things that forbids LDC from
cross compiling as easy as Zig:
1) Cross linker. Zig uses LLVM's linker which is called LLD. Can
LDC use LLD to target all suppored operating systems?
2) Cross libc. Zig bundles minified version of musl, glibc and
mingw (I didn't quite understood if it can cross compile to
macosx). Do you think LDC could do the same or reuse the work
done by the Zig team?
3) Cross druntime and phobos. I guess LDC could distribute
prebuilt versions of druntime and phobos for most used operating
system. Or just build and cache it the first time the user tries
to cross compile to new target the first time. What do you think?
More information about the digitalmars-d-ldc
mailing list