[all-commits] [llvm/llvm-project] e226b9: [libc] Restrict sysconf/confstr to full-build mode...
Alexey Samsonov via All-commits
all-commits at lists.llvm.org
Mon Sep 14 10:47:57 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e226b9ea3e4c2e87ab36209f3c1dd83faa98e429
https://github.com/llvm/llvm-project/commit/e226b9ea3e4c2e87ab36209f3c1dd83faa98e429
Author: Alexey Samsonov <vonosmas at gmail.com>
Date: 2026-09-14 (Mon, 14 Sep 2026)
Changed paths:
M libc/config/linux/aarch64/entrypoints.txt
M libc/config/linux/arm/entrypoints.txt
M libc/config/linux/riscv/entrypoints.txt
M libc/config/linux/x86_64/entrypoints.txt
M libc/src/unistd/linux/sysconf.cpp
M libc/test/src/sys/mman/linux/CMakeLists.txt
M libc/test/src/sys/mman/linux/mincore_test.cpp
M libc/test/src/sys/mman/linux/mlock_test.cpp
M libc/test/src/sys/mman/linux/msync_test.cpp
M libc/test/src/sys/mman/linux/remap_file_pages_test.cpp
M utils/bazel/llvm-project-overlay/libc/BUILD.bazel
M utils/bazel/llvm-project-overlay/libc/test/src/sys/mman/BUILD.bazel
Log Message:
-----------
[libc] Restrict sysconf/confstr to full-build mode. (#223103)
`sysconf` (and its sibling `confstr`) from `<unistd.h>` return some
values specific to the kernel/environment,
and some values specific to the system library (e.g. features available
in system library's pthread implementation).
Using LLVM-libc sysconf in overlay mode is inherently problematic - we
don't know what features host libc has,
and trying to reverse-engineer it would be brittle. Since we include
host libc's `<unistd.h>`, we can't even know in
advance what `_SC_` values or what macros would be available there, so
the portable implementation of `sysconf`
will be convoluted, and there's little benefits to it anyway.
Conversely, making sure that our `sysconf` implementation only compiles
against LLVM-libc's own headers will allow
us to precisely handle macro / features that we know are available /
supported.
Migrate four tests from sys/mman.h to use `getpagesize()` function
instead of generic `sysconf` to ensure those
tests won't be auto-excluded in overlay mode.
Remove the workarounds for overlay-mode added to sysconf(), since those
are no longer needed.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list