Open
Description
We need to create a process_mrelease
wrapper for linux targets, see https://lwn.net/Articles/865341/. This is already inside glibc.
This requires:
- add syscall number into
libc/include/sys/syscall.h.def
- implement the entrypoint header similar to
libc/src/sys/mman/mmap.h
- modify
libc/src/sys/mman/CMakeLists.txt
accordingly
- modify
- implement the entrypoint similar to
libc/src/sys/mman/linux/mmap.cpp
- modify
libc/src/sys/mman/linux/CMakeLists.txt
accordingly
- modify
- add the header spec
- modify
functions
section inlibc/newhdrgen/yaml/sys/mman.yaml
- modify
SysMMan
section inlibc/spec/linux.td
- modify
- add test
- similar to
libc/test/src/sys/mman/linux/mmap_test.cpp
- modify
libc/test/src/sys/mman/linux/CMakeLists.txt
accordingly
- similar to
Misc:
- How to build libc for dev: https://libc.llvm.org/full_host_build.html
- Code style and dev guide: https://libc.llvm.org/dev/index.html
If you use vscode, sample settings are as the following (optional settings are useful in speeding up the compilation):
{
"cmake.sourceDirectory": "${workspaceFolder}/runtimes",
"cmake.configureSettings": {
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
"LLVM_ENABLE_RUNTIMES": [
"libc",
"compiler-rt"
],
"LLVM_LIBC_FULL_BUILD": true,
"LLVM_USE_LINKER": "lld", // optional: requires installing lld
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache", // optional: requires installing sccache first
"CMAKE_C_COMPILER_LAUNCHER": "sccache", // optional: requires installing sccache first
"CMAKE_CXX_COMPILER": "/usr/bin/clang++",
"CMAKE_C_COMPILER": "/usr/bin/clang",
"LLVM_LIBC_INCLUDE_SCUDO": true,
"COMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC": true,
"COMPILER_RT_BUILD_GWP_ASAN": false,
"COMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED": false,
"LIBC_USE_NEW_HEADER_GEN": true
},
"cmake.generator": "Ninja", // optional: requires installing Ninja
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"clangd.arguments": [
"--header-insertion=never"
]
}