[libc-commits] [libc] [libc] Remove common_libc_tuners.cmake and move options into config.json. (PR #66226)
Guillaume Chatelet via libc-commits
libc-commits at lists.llvm.org
Fri Nov 10 05:19:39 PST 2023
gchatelet wrote:
I was investigating why the `-DLIBC_COPT_MEMSET_X86_USE_SOFTWARE_PREFETCHING` flag wasn't set when turning on the json flag after 3153aa4c959a65ac8e7f911ffa04b7ccb4641bb5. And I figured out that the following lines in `libc/src/string/CMakeLists.txt` were without effect.
```
if(string_config_options)
list(PREPEND string_config_options "COMPILE_OPTIONS")
endif()
```
I would be in favor of simply turning on the preprocessor flag globally with something like
```
if(LIBC_CONF_STRING_UNSAFE_WIDE_READ)
add_compile_definitions("-DLIBC_COPT_STRING_UNSAFE_WIDE_READ")
endif()
if(LIBC_CONF_MEMSET_X86_USE_SOFTWARE_PREFETCHING)
add_compile_definitions("-DLIBC_COPT_MEMSET_X86_USE_SOFTWARE_PREFETCHING")
endif()
```
WDYT @michaelrj-google ?
https://github.com/llvm/llvm-project/pull/66226
More information about the libc-commits
mailing list