| Issue |
110122
|
| Summary |
[libc] add linux mman extension `remap_file_pages`
|
| Labels |
good first issue,
libc
|
| Assignees |
|
| Reporter |
SchrodingerZhu
|
We need to create a `remap_file_pages` wrapper for linux targets, see https://www.man7.org/linux/man-pages/man2/remap_file_pages.2.html.
This requires:
- implement the entrypoint header similar to `libc/src/sys/mman/mmap.h`
- modify `libc/src/sys/mman/CMakeLists.txt` accordingly
- implement the entrypoint similar to `libc/src/sys/mman/linux/mmap.cpp`
- modify `libc/src/sys/mman/linux/CMakeLists.txt` accordingly
- add in the header spec
- modify `functions` section in `libc/newhdrgen/yaml/sys/mman.yaml`
- modify `SysMMan` section in `libc/spec/linux.td`
- add in test
- similar to `libc/test/src/sys/mman/linux/mmap_test.cpp`
- modify `libc/test/src/sys/mman/linux/CMakeLists.txt` accordingly
-----------------------------------------------------
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](https://code.visualstudio.com/docs/getstarted/settings#_settings-json-file) 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"
]
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs