-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Docs: useCodeCache: true
for SEA blob preparation leads to 'broken' executables when creating cross platform SEAs.
#52420
Comments
When code cache or snapshot is generated, the executable needs to be run to produce those. Are you running the executable using a simulator to generate the preparation blob? |
I see that the postject issue mentions that it showed up on macOS and from the crash report the executable is translated by Rosetta, during the blob generation V8 probably is not generating code for x64 when run in this mode, or maybe it is but there are some edges not taken care of for cross-compilation as cross-compiling code cache is not really something V8 claims to support anyway. I guess the best we could do for now is probably documenting that snapshot or code cache isn't supported when cross-compiling the SEA. |
Edit: you were to fast, so this is my reply to your first comment. No, my primary development platform is With |
The generated executable was for Edit: I haven't tried if this is only a problem with regard to |
Exactly. Documenting it this way indirectly says that cross platform SEA creation is indeed possible, which, I think, is quite awesome. I was diving deeper into this because I was looking for an alternative to the now deprecated |
I see, in that case it's less likely to work, the documentation explains it as
We should probably make it clearer that if the executable used to generate the blob isn't also the one being injected, there is a chance that it doesn't work. I think so far things other than code cache and snapshot might work but it's not guaranteed. For example with a different endianness it's probably certainly going to break... |
Endianness could also be a problem, yes. So for now it may suffice to document that with For the future, it might be helpful to explain in a separate chapter that cross-platform creation of SEAs is possible (maybe with a short example). In my opinion, this use case is simply too interesting not to be mentioned. Thanks for looking into this issue! |
Marking it as a good first issue - feel free to try cross-platform SEA generation and update the docs with better instructions on how to do it (as mentioned before in this issue #52420 (comment), it should "just work" if you don't use code cache and snapshot options). |
Thanks! Should I create a PR*? *Due to my other activities, I can't start until the end of June, but otherwise I'm happy to do it. |
Yes, unless someone else made it happen before you. |
Currently
useCodeCache
has to be set tofalse
if one wants to create a SEA on platform A for platform B. Otherwise the generated executable will crash on startup.The original problem and the solution are described in more detail here (
postject
project).It might be worth noting this in the documentation for the generation of single executable preparation blobs (sub chapter V8 code cache support) since it isn't obvious. Maybe something similar is also true for
useSnapshot
.The text was updated successfully, but these errors were encountered: