Description
This is unable to truly provide safety since nearly all Rust code makes calls into native libraries. These libraries do not have the segmented stack preludes. The libraries may have been built with GCC using -fcheck-stack
.
At the moment, Rust is unable to build a binary without the dependency on segmented stacks. Rust installs neither llc
or clang
, so it provides no way to compile a freestanding binary at all. Using llc
is not ideal since it uses a weird optimization stack, and clang
isn't built at all (clang 3.3 or 3.4 are not defined to work on the bytecode from trunk).
#10781 covers provide full stack safety via a guard page with the assumption that libraries are compiled with -fcheck-stack
or do not have large uninitialized stack frames. However, there really needs to be a way to disable this now as it prevents using rustc
to compile any freestanding/runtimeless code.