"-C", "link-arg=-lstdc++",
"-C", "link-arg=-lsupc++",
"-C", "link-arg=-lgcc_s"
Now, that's just funny. But hey, you're using -Os to keep that binary size low ๐
And what's with the global allocator being initialized in a module? (didn't/don't know if that even works)
If you want to do things really minimally, check out the rustix crate which wraps syscalls directly.
Otherwise, and if loading huge shared libraries is fine, then you might as well not go nostd at all, since you can just pass -C prefer-dynamic for that elusive magically-small std-using binary ๐