Skip to content
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

[libc][arm] syscalls doesn't build under -mthumb #93738

Closed
nickdesaulniers opened this issue May 29, 2024 · 1 comment · Fixed by #96558
Closed

[libc][arm] syscalls doesn't build under -mthumb #93738

nickdesaulniers opened this issue May 29, 2024 · 1 comment · Fixed by #96558

Comments

@nickdesaulniers
Copy link
Member

In file included from external/llvm-libc/test/UnitTest/TestLogger.cpp:4:
In file included from external/llvm-libc/src/__support/OSUtil/io.h:19:
In file included from external/llvm-libc/src/__support/OSUtil/linux/io.h:13:
In file included from external/llvm-libc/src/__support/OSUtil/linux/syscall.h:21:
external/llvm-libc/src/__support/OSUtil/linux/arm/syscall.h:15:2: error: "The arm syscall implementation does not yet support thumb flavor."
   15 | #error "The arm syscall implementation does not yet support thumb flavor."
      |  ^

There's a TODO in the sources without a corresponding bug on file.

@llvmbot
Copy link

llvmbot commented May 29, 2024

@llvm/issue-subscribers-libc

Author: Nick Desaulniers (paternity leave) (nickdesaulniers)

``` In file included from external/llvm-libc/test/UnitTest/TestLogger.cpp:4: In file included from external/llvm-libc/src/__support/OSUtil/io.h:19: In file included from external/llvm-libc/src/__support/OSUtil/linux/io.h:13: In file included from external/llvm-libc/src/__support/OSUtil/linux/syscall.h:21: external/llvm-libc/src/__support/OSUtil/linux/arm/syscall.h:15:2: error: "The arm syscall implementation does not yet support thumb flavor." 15 | #error "The arm syscall implementation does not yet support thumb flavor." | ^ ``` There's a TODO in the sources without a corresponding bug on file.

nickdesaulniers added a commit that referenced this issue Jun 25, 2024
r7 is reserved in thumb2 (typically for the frame pointer, as opposed to r11 in
ARM mode), so assigning to a variable with explicit register storage in r7 will
produce an error.

But r7 is where the Linux kernel expects the syscall number to be placed. We
can use a temporary to get the register allocator to pick a temporary, which we
save+restore the previous value of r7 in.

Fixes: #93738
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this issue Jul 9, 2024
r7 is reserved in thumb2 (typically for the frame pointer, as opposed to r11 in
ARM mode), so assigning to a variable with explicit register storage in r7 will
produce an error.

But r7 is where the Linux kernel expects the syscall number to be placed. We
can use a temporary to get the register allocator to pick a temporary, which we
save+restore the previous value of r7 in.

Fixes: llvm#93738
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants