Skip to content

Commit

Permalink
[libc] Fix accidental LIBC_NAMESPACE_syscall definition (#69548)
Browse files Browse the repository at this point in the history
Building helloworld.c currently errors with "undefined symbol:
__llvm_libc_syscall"

See: #67032
  • Loading branch information
alfredfo authored Oct 19, 2023
1 parent 3517b67 commit d404130
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libc/src/unistd/linux/syscall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace LIBC_NAMESPACE {

LLVM_LIBC_FUNCTION(long, LIBC_NAMESPACE_syscall,
LLVM_LIBC_FUNCTION(long, __llvm_libc_syscall,
(long number, long arg1, long arg2, long arg3, long arg4,
long arg5, long arg6)) {
long ret = LIBC_NAMESPACE::syscall_impl<long>(number, arg1, arg2, arg3, arg4,
Expand Down
4 changes: 2 additions & 2 deletions libc/src/unistd/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

namespace LIBC_NAMESPACE {

long LIBC_NAMESPACE_syscall(long number, long arg1, long arg2, long arg3,
long arg4, long arg5, long arg6);
long __llvm_libc_syscall(long number, long arg1, long arg2, long arg3,
long arg4, long arg5, long arg6);

} // namespace LIBC_NAMESPACE

Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/unistd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ add_libc_unittest(
libc.include.unistd
libc.include.fcntl
libc.include.sys_syscall
libc.src.unistd.LIBC_NAMESPACE_syscall
libc.src.unistd.__llvm_libc_syscall
libc.test.errno_setter_matcher
)

Expand Down
2 changes: 1 addition & 1 deletion libc/test/src/unistd/syscall_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
// There is no function named "syscall" in llvm-libc, we instead use a macro to
// set up the arguments properly. We still need to specify the namespace though
// because the macro generates a call to the actual internal function
// (LIBC_NAMESPACE_syscall) which is inside the namespace.
// (__llvm_libc_syscall) which is inside the namespace.
TEST(LlvmLibcSyscallTest, TrivialCall) {
libc_errno = 0;

Expand Down

0 comments on commit d404130

Please sign in to comment.