-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
[glibc] p_vaddr p_offset skew unequal w.r.t. host page size #14
Comments
Works OK for me. Your distro must have some kind of strange toolchain configuration. The way to troubleshoot this kind of issue is to use |
Thank you for your reply. Using
The output of
Running readelf on the new, working binary outputs this: https://pastebin.com/8kfiEFSY |
I'm glad that flag fixed things. Since there's a workaround, I'm going to mark this "contributions welcome". My resources are primarily focused on making Blink work great for Cosmopolitan Libc. I see you're using a Glibc development stack and I want to support that really well too (including dynamic executables). What will make that happen fastest is if we get pull requests adding whatever support you need, which I'm happy to review.
These should be added to the burndown list too. Glibc tracks very modern Linux-specific system calls. Expanding our support for modern Linux system calls that Glibc needs, is also very welcome and I'm happy to review / merge. Some of the stuff listed above isn't supported yet, because supporting it is nontrivial. If at all possible, I highly recommend compiling your binaries using Cosmopolitan Libc or Musl Libc, which are less likely to cause friction, since they both use a much more conservative set of easily portable kernel ABIs. |
Thanks! |
Same issue with anything compiled with Zig (both with the Unfortunately, the linker doesn't allow changing |
I did some Googling a few days ago and I think Zig has been having problems in general with Apple M1's page size requirements. This issue probably needs to be solved on our end. I don't yet know for certain if I'm going about loading ELF images in the most proper way. Help is definitely wanted, if anyone here has time to dig into how other ELF loaders do it and can help us do the same. |
Speaking of which, could someone here who encountered this problem please attach to this issue the specific hello world binary that's causing problems? That could be helpful in reproducing the problem and regression testing once it's solved. |
Sure: |
There's indeed an issue with the Zig standard library, that is being tracked here. But that may not be related. The same problem happens when compiling pure C code (just with |
I think I discovered better compiler flags to use, than the ones I recommended before. Could everyone try this?
Using these flags, the linker will generate more sane program headers that look like this:
|
These linker flags are required to build static ELF binaries that can run under the Blink emulator: jart/blink#14
These linker flags are required to build static ELF binaries that can run under the Blink emulator: jart/blink#14
I'm running blink in wasm and I'm getting this error even with the suggested compiler flags. It works when blink is compiled for x86_64 or x86 though (I haven't tested other architectures) (I had a comment already but GitHub wasn't letting me edit it (something's probably wrong with one of my browser extensions) and I realized I hadn't pulled changes, so I deleted it while I pulled and rebuilt.) |
Wasm has a 64kb page size, correct? In that case, the executables you launch inside Blink will most likely need to be compiled using |
Yep, that fixed the error. Now I have more different errors to work on :) |
These linker flags are required to build static ELF binaries that can run under the Blink emulator: jart/blink#14
Hello jart, and thanks for this nice project. I am trying to execute a very simple statically linked linux program using blink on arm (m1) macos. It is reporting this error:
The program is very simple, like this:
Compiled using:
g++ a.cpp -o a -static
.If you would like the compiled binary I can later upload it to google drive.
The text was updated successfully, but these errors were encountered: