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
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 us
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
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
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 wrote:
> Figured out I can use --target thumbv6m-linux-eabi, which impli
Figured out I can use --target thumbv6m-linux-eabi, which implies -mthumb.
Now the problem is that if I use
rustc --target thumbv6m-linux-eabi -O --emit obj main.rs -o main.o
instead of three-step process I mentioned before, I get a valid object file
for cortex-m0, but functions have big prologue
You should be able to assemble standalone objects for any triple
through rustc itself, you'll likely have to specify a different linker
or assembler though:
rustc foo.rs --target arm-non-linux-gnueabi \
-C linker=arm-non-linux-gnueabi-ld \
-C ar=arm-non-linux-gnueabi-ar
As you
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, I'm