You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a program without std and without libc. Based on this page: http://doc.rust-lang.org/guide-unsafe.html (and elsewhere). I still cannot get a minimal program to work. It compiles, but the binary segmentation faults (on x86_64 linux).
This is likely not a rust-specific problem but rather how you're compiling and driving the linker. Most linux distributions need libc to be linked in to have the necessary startup routines, and one may likely be missing from the binary.
For example, if you compile a similar C program you get an odd error:
Even if the main symbol is switched to _start, this still segfaults. In general a bare bones binary such as this is not meant to run on the host system as it's missing necessary library support.
I don't think this is related to rust, however, so I'm going to close this for now.
I'm trying to create a program without std and without libc. Based on this page: http://doc.rust-lang.org/guide-unsafe.html (and elsewhere). I still cannot get a minimal program to work. It compiles, but the binary segmentation faults (on x86_64 linux).
Compiled with:
rustc --crate-type=bin -C link-args="-nostdlib" -C relocation-model=static start.rs
Program is:
The text was updated successfully, but these errors were encountered: