Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run a newly compiled of demo/hello #34

Open
WattleFoxxo opened this issue May 22, 2023 · 5 comments
Open

Can't run a newly compiled of demo/hello #34

WattleFoxxo opened this issue May 22, 2023 · 5 comments

Comments

@WattleFoxxo
Copy link

WattleFoxxo commented May 22, 2023

When i try to run the newly compiled program i get this error while running:

[ERROR] Error: file depends on following libraries: ["libc.so"]
[ERROR] Unable to load elf64 binary /bin/demo

if i change -pie to -static-pie i get this error while running:

[ERROR] Page Fault (#PF) Exception: ExceptionStackFrame {
    instruction_pointer: 0x20000000077,
    code_segment: 0x2b,
    cpu_flags: 0x1202,
    stack_pointer: 0x20000400000,
    stack_segment: 0x23,
}
[ERROR] virtual_address = 0x23, page fault error = The fault was caused by a non-present page.
The access causing the fault was a read.
The access causing the fault originated when the processor was executing in user mode.
The fault was not caused by reserved bit violation.
The fault was not caused by an instruction fetch.
@stlankes
Copy link
Member

Shared libraries are currently not supported. I used a test program, which based on the MUSL C library. Everything is statically linked.

@WattleFoxxo
Copy link
Author

another question, how would make the hello world user space program in rust and compile it?

@stlankes
Copy link
Member

stlankes commented May 22, 2023

Hm, Rust supports also Musl. The target has the name x86_64-unknown-linux-musl. See also https://doc.rust-lang.org/rustc/platform-support.html Consequently, a C library is still the base of the application.

I think that you are able to build pure Rust application with Redox and RustyHermit.

@WattleFoxxo
Copy link
Author

hi sorry to bother you but im still having trouble getting newly compiled elf binaries to load, is there a specific version of the musl-gcc compiler you use?

@stlankes
Copy link
Member

Hm, I have to take a look in the code. I don't tested with the latest version of musl. I come back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants