Stream: platform development

Topic: Why is host.c necessary?


view this post on Zulip Isaac Van Doren (Feb 22 2024 at 02:09):

In the Rust platform switching example, a host.c file is used. Why is this necessary here?

view this post on Zulip Brendan Hansknecht (Feb 22 2024 at 02:56):

Mostly cause we link to a static library then later finish building the executable when using the legacy linker

view this post on Zulip Brendan Hansknecht (Feb 22 2024 at 02:56):

Rust doesn't like emiting a static library with main in it. Or at least we had trouble making it do so

view this post on Zulip Brendan Hansknecht (Feb 22 2024 at 02:57):

As such we had to add main and supporting infra via c

view this post on Zulip Isaac Van Doren (Feb 22 2024 at 03:29):

Ah interesting, I wonder why rust doesn’t like to do that

view this post on Zulip Brendan Hansknecht (Feb 22 2024 at 05:41):

It's pretty nonstandard, so I'm not too surprised.


Last updated: Jul 06 2025 at 12:14 UTC