[libc-commits] [libc] [libc] Fix accidental LIBC_NAMESPACE_syscall definition (PR #69548)

via libc-commits libc-commits at lists.llvm.org
Wed Oct 18 18:36:26 PDT 2023


https://github.com/alfredfo updated https://github.com/llvm/llvm-project/pull/69548

>From 133b12a8d619ec37a613d784fd4e8a0f303b121c Mon Sep 17 00:00:00 2001
From: Alfred Persson Forsberg <cat at catcream.org>
Date: Thu, 19 Oct 2023 03:06:46 +0200
Subject: [PATCH] [libc] Fix accidental LIBC_NAMESPACE_syscall definition

Building helloworld.c currently errors with "undefined symbol:
__llvm_libc_syscall"

See: https://github.com/llvm/llvm-project/pull/67032
---
 libc/src/unistd/linux/syscall.cpp     | 2 +-
 libc/src/unistd/syscall.h             | 2 +-
 libc/test/src/unistd/CMakeLists.txt   | 2 +-
 libc/test/src/unistd/syscall_test.cpp | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libc/src/unistd/linux/syscall.cpp b/libc/src/unistd/linux/syscall.cpp
index e1b13c9c143fa41..e0070fe6d805e3e 100644
--- a/libc/src/unistd/linux/syscall.cpp
+++ b/libc/src/unistd/linux/syscall.cpp
@@ -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,
diff --git a/libc/src/unistd/syscall.h b/libc/src/unistd/syscall.h
index 255459cadb8b714..a3a4b2cb0a7b3b5 100644
--- a/libc/src/unistd/syscall.h
+++ b/libc/src/unistd/syscall.h
@@ -14,7 +14,7 @@
 
 namespace LIBC_NAMESPACE {
 
-long LIBC_NAMESPACE_syscall(long number, long arg1, long arg2, long arg3,
+long __llvm_libc_syscall(long number, long arg1, long arg2, long arg3,
                             long arg4, long arg5, long arg6);
 
 } // namespace LIBC_NAMESPACE
diff --git a/libc/test/src/unistd/CMakeLists.txt b/libc/test/src/unistd/CMakeLists.txt
index f2e2293e026f2ff..2fb11fed92b310f 100644
--- a/libc/test/src/unistd/CMakeLists.txt
+++ b/libc/test/src/unistd/CMakeLists.txt
@@ -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
 )
 
diff --git a/libc/test/src/unistd/syscall_test.cpp b/libc/test/src/unistd/syscall_test.cpp
index 4a53f674b8f3d61..211b27c3188c4d8 100644
--- a/libc/test/src/unistd/syscall_test.cpp
+++ b/libc/test/src/unistd/syscall_test.cpp
@@ -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;
 



More information about the libc-commits mailing list