Skip to content

Commit d404130

Browse files
authored
[libc] Fix accidental LIBC_NAMESPACE_syscall definition (llvm#69548)
Building helloworld.c currently errors with "undefined symbol: __llvm_libc_syscall" See: llvm#67032
1 parent 3517b67 commit d404130

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

libc/src/unistd/linux/syscall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace LIBC_NAMESPACE {
1818

19-
LLVM_LIBC_FUNCTION(long, LIBC_NAMESPACE_syscall,
19+
LLVM_LIBC_FUNCTION(long, __llvm_libc_syscall,
2020
(long number, long arg1, long arg2, long arg3, long arg4,
2121
long arg5, long arg6)) {
2222
long ret = LIBC_NAMESPACE::syscall_impl<long>(number, arg1, arg2, arg3, arg4,

libc/src/unistd/syscall.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
namespace LIBC_NAMESPACE {
1616

17-
long LIBC_NAMESPACE_syscall(long number, long arg1, long arg2, long arg3,
18-
long arg4, long arg5, long arg6);
17+
long __llvm_libc_syscall(long number, long arg1, long arg2, long arg3,
18+
long arg4, long arg5, long arg6);
1919

2020
} // namespace LIBC_NAMESPACE
2121

libc/test/src/unistd/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ add_libc_unittest(
414414
libc.include.unistd
415415
libc.include.fcntl
416416
libc.include.sys_syscall
417-
libc.src.unistd.LIBC_NAMESPACE_syscall
417+
libc.src.unistd.__llvm_libc_syscall
418418
libc.test.errno_setter_matcher
419419
)
420420

libc/test/src/unistd/syscall_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
2424
// There is no function named "syscall" in llvm-libc, we instead use a macro to
2525
// set up the arguments properly. We still need to specify the namespace though
2626
// because the macro generates a call to the actual internal function
27-
// (LIBC_NAMESPACE_syscall) which is inside the namespace.
27+
// (__llvm_libc_syscall) which is inside the namespace.
2828
TEST(LlvmLibcSyscallTest, TrivialCall) {
2929
libc_errno = 0;
3030

0 commit comments

Comments
 (0)