Skip to content

Commit b1acd6d

Browse files
authored
[libc] Remove faccessat entrypoint if faccessat2 syscall is not available (#164936)
[#163091](#163091) Remove unistd.faccessat entrypoint for x86 linux if faccessat2 syscall is not available. Tested with non existent symbol and exclusion works.
1 parent eec44c0 commit b1acd6d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

libc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ elseif(LLVM_LIBC_FULL_BUILD)
363363
message(FATAL_ERROR "${LIBC_CONFIG_PATH}/headers.txt file not found and fullbuild requested.")
364364
endif()
365365

366-
# Check exclude.txt that appends to LIBC_EXCLUDE_ENTRYPOINTS list
366+
# Check exclude.txt that appends to TARGET_LLVMLIBC_REMOVED_ENTRYPOINTS list
367367
if(EXISTS "${LIBC_CONFIG_PATH}/exclude.txt")
368368
include("${LIBC_CONFIG_PATH}/exclude.txt")
369369
endif()

libc/config/linux/x86_64/exclude.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ if(NOT has_sys_random)
1919
)
2020
endif()
2121
endif()
22+
23+
include(CheckSymbolExists)
24+
check_symbol_exists(SYS_faccessat2 "sys/syscall.h" HAVE_SYS_FACCESSAT2)
25+
if(NOT HAVE_SYS_FACCESSAT2)
26+
list(APPEND TARGET_LLVMLIBC_REMOVED_ENTRYPOINTS
27+
libc.src.unistd.faccessat
28+
)
29+
endif()

0 commit comments

Comments
 (0)