[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:13:39 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: None (alfredfo)
<details>
<summary>Changes</summary>
Building helloworld.c currently errors with "undefined symbol: __llvm_libc_syscall"
See: https://github.com/llvm/llvm-project/pull/67032
@<!-- -->gchatelet
---
Full diff: https://github.com/llvm/llvm-project/pull/69548.diff
4 Files Affected:
- (modified) libc/src/unistd/linux/syscall.cpp (+1-1)
- (modified) libc/src/unistd/syscall.h (+1-1)
- (modified) libc/test/src/unistd/CMakeLists.txt (+1-1)
- (modified) libc/test/src/unistd/syscall_test.cpp (+1-1)
``````````diff
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;
``````````
</details>
https://github.com/llvm/llvm-project/pull/69548
More information about the libc-commits
mailing list