You are right in that the __morestack function is a requirement from
enabling segmented stacks in LLVM. While we no longer use truly
segmented stacks, we still use the segmented stack prologue in order
to detect stack overflow. This is a crucial piece of infrastructure
for rust code used to ensure
I'm trying to experiment with rust and some embedded code. Currently I have
to do a three-pass compilation:
rustc --target arm-linux-eabi -O --emit bc main.rs -o main.bc
llc -mtriple arm-none-eabi -march=thumb -mcpu=cortex-m0 main.bc -o main.s
arm-none-linux-gnueabi-as main.s -o main.o
First,
Nevermind, I lost -O somewhere in between copying and pasting command line
flags. Optimised version doesn't have any morestack references (which is
strange concept though).
On Sun, Mar 23, 2014 at 5:44 PM, Vladimir Pouzanov farcal...@gmail.comwrote:
Figured out I can use --target
So it doesn't work in the end.
rustc --emit bc with flags set for cortex-m0 provides exact same bc with
only difference in target triple (which makes perfect sense)
However, replacing llc step with rustc --emit asm provides a different
assembler file, which requires __morestack.
Should I expect
No. See https://github.com/mozilla/rust/pull/8955 and
https://github.com/mozilla/rust/issues/11871 for discussion. You can
stub out
morestack but that won't remove the stack size checks. It's sanest to
just compile the IR yourself (the stack checking is a target-specific
machine pass, which is why
Thanks for links to bugs.
Is there anything to read on the whole morestack thing? I thought that it's
connected to segmented stacks that are (are they?) going away.
It seems that I can use #[no_split_stack] before each and every function to
generate a valid freestanding binary. If I just could