| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[libc] Refactor AUXV handling with new auxv.h header library (#162326) Closes https://github.com/llvm/llvm-project/issues/153666 This patch introduces a new centralized AUXV (auxiliary vector) handling mechanism for LLVM libc on Linux, replacing the previous scattered implementation across multiple files. ## Key Changes: ### New Files: - **libc/src/__support/OSUtil/linux/auxv.h**: New header library providing a clean interface for AUXV access with: - auxv::Entry struct for AUXV entries (type and value) - auxv::Vector class with iterator support for traversing AUXV - auxv::get() function for retrieving specific AUXV values - Thread-safe initialization with fallback mechanisms (prctl and /proc/self/auxv) ### Modified Files: 1. **libc/src/__support/OSUtil/linux/CMakeLists.txt**: - Added auxv header library declaration with proper dependencies: - libc.hdr.fcntl_macros - libc.src.__support.OSUtil.osutil - libc.src.__support.common - libc.src.__support.CPP.optional - libc.src.__support.threads.callonce 2. **libc/config/linux/app.h**: - Removed AuxEntry struct (moved to auxv.h as auxv::Entry) - Removed auxv_ptr from AppProperties struct - Simplified application properties structure 3. **libc/src/sys/auxv/linux/getauxval.cpp**: - Completely refactored to use new auxv.h interface - Removed ~200 lines of complex initialization code - Simplified to just call auxv::get() function - Removed dependencies to external symbols (mman, prctl, fcntl, read, close, open) 4. **libc/src/sys/auxv/linux/CMakeLists.txt**: - Updated dependencies to use new auxv header library - Removed dependencies to external symbols (prctl, mman, fcntl, unistd, etc.) 5. **libc/startup/linux/do_start.cpp**: - Updated to use new auxv::Vector interface - Changed from pointer-based to iterator-based AUXV traversal - Updated field names (aux_entry->id → aux_entry.type, aux_entry->value → aux_entry.val) - Added call to auxv::Vector::initialize_unsafe() for early AUXV setup 6. **libc/startup/linux/CMakeLists.txt**: - Added dependency on libc.src.__support.OSUtil.linux.auxv | 9 个月前 | |
[libc] Fix epoll_create behavior when only epoll_create1 is available (#149713) In PR #99785, I disabled a test for epoll_create that was intended to fail on systems where only epoll_create1 is available. This is because epoll_create1 cannot fail in the same way that epoll_create does. Specifically, calling epoll_create(0) should result in an EINVAL error. So, when only epoll_create1 is available, we should simply check if the argument is zero and return the error accordingly. | 1 年前 | |
[libc] Fix ioctl errno inclusion (#143928) Since errno was moved in https://github.com/llvm/llvm-project/pull/143187 the code including it in https://github.com/llvm/llvm-project/pull/141393 was rendered incorrect. This patch fixes the include and the cmake depends. | 1 年前 | |
[libc] Implement pkey_alloc/free/get/set/mprotect for x86_64 linux (#162362) This patch provides definitions for pkey_* functions for linux x86_64. pkey_alloc, pkey_free, and pkey_mprotect are simple syscall wrappers. pkey_set and pkey_get modify architecture-specific registers. The logic for these live in architecture specific directories: * libc/src/sys/mman/linux/x86_64/pkey_common.h has a real implementation * libc/src/sys/mman/linux/generic/pkey_common.h contains stubs that just return ENOSYS. | 8 个月前 | |
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450 | 1 年前 | |
[libc] Internal getrandom implementation (#144427) Implemented an internal getrandom to avoid calls to the public one in table.h --------- Co-authored-by: Sriya Pratipati <sriyap@google.com> | 1 年前 | |
[libc] Clean up sys/resource (#161749) Needed to support sys/resource in bazel | 9 个月前 | |
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450 | 1 年前 | |
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450 | 1 年前 | |
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450 | 1 年前 | |
[libc][NFC] Add stdint.h proxy header to fix dependency issue with <stdint.h> includes. (#150303) https://github.com/llvm/llvm-project/issues/149993 | 1 年前 | |
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450 | 1 年前 | |
[libc][NFC] Clean up utimes and setsid (#155495) Simplify utims a bit and add proper error handling to setsid as described in the standard | 11 个月前 | |
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450 | 1 年前 | |
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450 | 1 年前 | |
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187) This is the first step in preparation for: https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450 | 1 年前 | |
| 1 年前 |