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

via libc-commits libc-commits at lists.llvm.org
Thu Oct 19 02:22:20 PDT 2023


Author: alfredfo
Date: 2023-10-19T11:22:16+02:00
New Revision: d4041301342523047a9fd9faf78ea9ec67ac5d32

URL: https://github.com/llvm/llvm-project/commit/d4041301342523047a9fd9faf78ea9ec67ac5d32
DIFF: https://github.com/llvm/llvm-project/commit/d4041301342523047a9fd9faf78ea9ec67ac5d32.diff

LOG: [libc] Fix accidental LIBC_NAMESPACE_syscall definition (#69548)

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

See: https://github.com/llvm/llvm-project/pull/67032

Added: 
    

Modified: 
    libc/src/unistd/linux/syscall.cpp
    libc/src/unistd/syscall.h
    libc/test/src/unistd/CMakeLists.txt
    libc/test/src/unistd/syscall_test.cpp

Removed: 
    


################################################################################
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..a41d9778e055909 100644
--- a/libc/src/unistd/syscall.h
+++ b/libc/src/unistd/syscall.h
@@ -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
 

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