-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[libunwind] Fix build error because of wrong register size #167743
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
[libunwind] Fix build error because of wrong register size #167743
Conversation
|
@llvm/pr-subscribers-libunwind Author: Med Ismail Bennani (medismailben) ChangesThis patch should fix an libunwind build failure that happens on Chromium's Android bots: The issue is that we're using the Full diff: https://github.com/llvm/llvm-project/pull/167743.diff 1 Files Affected:
diff --git a/libunwind/src/UnwindLevel1.c b/libunwind/src/UnwindLevel1.c
index 79398bac8b531..f1794ef2bb49e 100644
--- a/libunwind/src/UnwindLevel1.c
+++ b/libunwind/src/UnwindLevel1.c
@@ -82,7 +82,7 @@
void *shstkRegContext = __libunwind_shstk_get_registers((cursor)); \
void *shstkJumpAddress = __libunwind_shstk_get_jump_target(); \
__asm__ volatile("mov x0, %0\n\t" \
- "mov x1, wzr\n\t" \
+ "mov x1, xzr\n\t" \
"br %1\n\t" \
: \
: "r"(shstkRegContext), "r"(shstkJumpAddress) \
|
dtellenbach
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 with the nit of using an immediate instead.
2c92459 to
c08b793
Compare
This patch should fix an libunwind build failure that happens on Chromium's Android bots: llvm#165066 (comment) The issue is that we're using the `wzr` register to move the value 0 in x1, but this is the 32-bit register. To prevent this issue, we use an immediate instead of the zero registers. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
c08b793 to
5af9358
Compare
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions c -- libunwind/src/UnwindLevel1.c --diff_from_common_commit
View the diff from clang-format here.diff --git a/libunwind/src/UnwindLevel1.c b/libunwind/src/UnwindLevel1.c
index 73a27928e..714f0b7d3 100644
--- a/libunwind/src/UnwindLevel1.c
+++ b/libunwind/src/UnwindLevel1.c
@@ -82,7 +82,7 @@
void *shstkRegContext = __libunwind_shstk_get_registers((cursor)); \
void *shstkJumpAddress = __libunwind_shstk_get_jump_target(); \
__asm__ volatile("mov x0, %0\n\t" \
- "mov x1, #0\n\t" \
+ "mov x1, #0\n\t" \
"br %1\n\t" \
: \
: "r"(shstkRegContext), "r"(shstkJumpAddress) \
|
This patch should fix an libunwind build failure that happens on Chromium's Android bots:
#165066 (comment)
The issue is that we're using the
wzrregister to move the value 0 in x1, but this is the 32-bit register.To prevent this issue, we use an immediate instead of the zero registers.