[libc-commits] [libc] [libc] Remove faccessat entrypoint if faccessat2 syscall is not available (PR #164936)

via libc-commits libc-commits at lists.llvm.org
Fri Oct 24 00:23:26 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Marcell Leleszi (mleleszi)

<details>
<summary>Changes</summary>

[#<!-- -->163091](https://github.com/llvm/llvm-project/issues/163091)

---
Full diff: https://github.com/llvm/llvm-project/pull/164936.diff


2 Files Affected:

- (modified) libc/CMakeLists.txt (+1-1) 
- (modified) libc/config/linux/x86_64/exclude.txt (+8) 


``````````diff
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 14718e2090bde..ae555a256ba66 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -363,7 +363,7 @@ elseif(LLVM_LIBC_FULL_BUILD)
   message(FATAL_ERROR "${LIBC_CONFIG_PATH}/headers.txt file not found and fullbuild requested.")
 endif()
 
-# Check exclude.txt that appends to LIBC_EXCLUDE_ENTRYPOINTS list
+# Check exclude.txt that appends to TARGET_LLVMLIBC_REMOVED_ENTRYPOINTS list
 if(EXISTS "${LIBC_CONFIG_PATH}/exclude.txt")
     include("${LIBC_CONFIG_PATH}/exclude.txt")
 endif()
diff --git a/libc/config/linux/x86_64/exclude.txt b/libc/config/linux/x86_64/exclude.txt
index 2c218b753b176..a0686310d21ac 100644
--- a/libc/config/linux/x86_64/exclude.txt
+++ b/libc/config/linux/x86_64/exclude.txt
@@ -19,3 +19,11 @@ if(NOT has_sys_random)
     )
   endif()
 endif()
+
+include(CheckSymbolExists)
+check_symbol_exists(SYS_faccessat2 "sys/syscall.h" HAVE_SYS_FACCESSAT2)
+if(NOT HAVE_SYS_FACCESSAT2)
+  list(APPEND TARGET_LLVMLIBC_REMOVED_ENTRYPOINTS
+    libc.src.unistd.faccessat
+  )
+endif()

``````````

</details>


https://github.com/llvm/llvm-project/pull/164936


More information about the libc-commits mailing list