Publish cross compilers 3 post

This commit is contained in:
Nathan Fisher 2023-03-14 22:32:53 -04:00
parent 6c655baf2b
commit d15e06f3bc
2 changed files with 13 additions and 3 deletions

View file

@ -1,8 +1,19 @@
Meta(
title: "Cross compilers III: cross compiling Rust",
summary: Some("Using a cross toolchain to link Rust executables"),
published: None,
tags: ["rust", "compilers", "cross-compilation"],
published: Some(Time(
year: 2023,
month: 3,
day: 15,
hour: 2,
minute: 32,
second: 12,
)),
tags: [
"rust",
"compilers",
"cross-compilation",
],
)
---
Since the official Rust compiler, rustc, uses llvm as a code generator, it is technically already capable of cross compilation to any of the architectures that llvm supports. However, we still need a linker for the target. Eventually lld, being a cross linker, might be a suitable drop in for this use. However, I have not really been able to find information on how to set this up or if it is even possible. What definitely is possible is using gcc as a driver for the linker, as this is what rustc does by default already. We're just going to swap out our system gcc for a cross gcc such as that built in part one of this series.

View file

@ -1 +0,0 @@
2299