-
Notifications
You must be signed in to change notification settings - Fork 23
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
include: Fix macros in order to facilitate running apps on AArch64
#21
Conversation
AArch64
AArch64
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.
Hi, @mariasfiraiala , nice work figuring out the issues. See my comments.
6a40566
to
8aaa74d
Compare
Can confirm this fixes the issue for me as well. |
Default size of the data model for AArch64 is 8 (64 bits) for long types, however newlibc ends up defining LONG_MAX as 32 bits. This issue causes extremely optimized functions, such as memchr (which parses DTB for apps like SQLite or redis), to crash when compiled for AArch64. This commit redefines the size for long types as 64 bits on AArch64. Signed-off-by: Maria Sfiraiala <[email protected]>
8aaa74d
to
e8f4d35
Compare
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.
Might be worth adding a Fixes tag here:
Fixes: 58f9f3a3f7b5 ("include/fcntl.h: Replace O_NONBLOCK with new one on arm")
Great suggestion, will do! |
e8f4d35
to
8eb1347
Compare
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.
Reviewed-by: Sergiu Moga [email protected]
Previous fix regarding confusion between O_NONBLOCK and O_DIRECTORY values changed O_NONBLOCK to a different number, therefore it drifted away from FNONBLOCK (for which it was an alias) and caused a blocking socket. This commit simply changes the value of O_DIRECTORY, without being necessary to redefine O_NONBLOCK or FNONBLOCK. Fixes: 58f9f3a ("include/fcntl.h: Replace O_NONBLOCK with new one on arm") Signed-off-by: Maria Sfiraiala <[email protected]>
8eb1347
to
534cea5
Compare
@skuenzer I've found a value for Hope you find it satisfactory as well. |
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.
There don't seem to be any other conflicts, I did not pay that much attention last time - my apologies. I checked with some printf's inside sys_open()
's code and the flag seems to be correctly set and execution does land where I expected it to.
Reviewed-by: Sergiu Moga [email protected]
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.
Thanks a lot for your investigation. The changes look good!
Reviewed-by: Simon Kuenzer [email protected]
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.
Thanks, @mariasfiraiala
Reviewed-by: Razvan Deaconescu [email protected]
Approved-by: Razvan Deaconescu [email protected]
Previous fix regarding confusion between O_NONBLOCK and O_DIRECTORY values changed O_NONBLOCK to a different number, therefore it drifted away from FNONBLOCK (for which it was an alias) and caused a blocking socket. This commit simply changes the value of O_DIRECTORY, without being necessary to redefine O_NONBLOCK or FNONBLOCK. Fixes: 58f9f3a ("include/fcntl.h: Replace O_NONBLOCK with new one on arm") Signed-off-by: Maria Sfiraiala <[email protected]> Reviewed-by: Sergiu Moga <[email protected]> Reviewed-by: Simon Kuenzer <[email protected]> Reviewed-by: Razvan Deaconescu <[email protected]> Approved-by: Razvan Deaconescu <[email protected]> Tested-by: Unikraft CI <[email protected]> GitHub-Closes: #21
This PR fixes multiple issues regarding
newlib
support onAArch64
.Signed-off-by: Maria Sfiraiala [email protected]
Signed-off-by: Eduard Vintilă [email protected]