-
Notifications
You must be signed in to change notification settings - Fork 733
aarch64 AOT module fails to load on android #3681
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
aarch64 AOT module fails to load on android #3681
Conversation
1c6eec2 to
e721df6
Compare
|
nuttx build always fail with error |
this error is not the reason of failure. |
|
I add a function merge_data_and_text only for BUILD_TARGET_AARCH64 now, but it may fix other platform need data an text sections merged together. |
…| MMAP_PROT_WRITE and bit MMAP_PROT_EXEC for .text section only
|
@wenyongh needs help about test error in |
I didn't have nuttx environment to test the spec cases either, not sure whether it is caused by this sentence |
|
@bianchui Thanks for addressing the the comments. I tested the PR in my local repo, it seems that the nuttx CI failures were caused by partly os_mmap the merged data and aot with extra MMAP_PROT_EXEC flag: runtime os_mmap I think we need to discuss how to figure out it, maybe os_mmap with extra MMAP_PROT_EXEC flag for some devices. Or check the return value of os_mprotect. |
Thanks, that's solve my confusing. |
|
another question is they dose not support change protection of sub section of one mmaped memory? |
|
according to man of macos mprotect |
Yes, and some platforms' os_mprotect just returns 0, like nuttx and esp-idf, they may assume their os_mmap has correctly set the protection flags and won't change again. My suggestion is (1) Could you help check it? If it is good, could you please update your PR and maybe we can merge the PR for more test? |
done with cherry-pick that commit. |
I am not sure, this means that the data sections in the |
for nuttx, depending on the configuration, os_mmap with MMAP_PROT_EXEC allocates memory from a separate region, which might be scarce and even might involve special access restrictions. unless you are very interested in working on these exotic platforms, i guess it's safer to avoid merging text and data for nuttx. although i have no idea about esp-idf, i guess it's similar. (as it runs on the same esp32 chips) |
@yamt so disable merge .text and .data for nuttx and esp32 is better? |
|
On resource-constrained embedded platforms, we indeed cannot guarantee that functions like os_mmap, typically implemented with an MMU, will behave consistently with complex Unix-based platforms. Therefore, it's best to assume that such functionalities are disabled by default. |
wenyongh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
And enable merged os_mmap for aot data and text sections except on platform nuttx and esp-idf. Fix issue that aarch64 AOT module fails to load on android: bytecodealliance#2274
Fixes: #2274