Easier cross-compilation in scope? #55
Replies: 2 comments 3 replies
-
The macOS linker doesn't support creating ELF binaries as required to run on Linux. Lld does support it though. Do you depend on any system libraries other than libc? What does Rustc should already be able to easily cross-compile to linux+musl from other platforms when you use lld as linker and don't use any system libraries other than libc. The musl target ships with a full copy of musl to statically link to. Just do |
Beta Was this translation helpful? Give feedback.
-
Assuming there's an answer for the linker part of the question, then yes, in theory this should work. All the code for mustang is on crates.io. It doesn't use any system libraries. |
Beta Was this translation helpful? Give feedback.
-
We have a use case for
mustang
. We currently have aclient
that needs to build an embedded binary (theshim
) for all supportedserver
platforms. So for example we might have a configuration like this (using the new artifact dependencies RFC):client
(aarch64-apple-darwin
) depends onshim
(x86_64-unknown-linux-musl
)We'd like to be able to build this on macOS. But this, of course, depends on having a
musl
, as well as a whole linux toolchain to link against. So it isn't really trivially possible now.But I'm wondering if
mustang
could help us. For example, if we did:client
(aarch64-apple-darwin
) depends onshim
(x86_64-mustang-linux-gnu
)... in theory this would mean that we don't need to link against any system libraries. So as long as Rust can emit x86_64 ELF, it should be able to build this frankenbinary on macOS.
Is this in scope for
mustang
?Beta Was this translation helpful? Give feedback.
All reactions