This is necessary to allow for explicit handling of '.S' files as distinct from '.c', which is necessary to allow different compilation options, which will eventually allow silencing some "-pedantic" warnings when compiling the assembly code of compiler-rt with gcc.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
169 ↗ | (On Diff #28393) | This looks like it adds assembler flags without checking if the assembler supports them. What flags need to come through here? -mcpu? I think the list of flags that we need to pass to the assembler is probably shorter than the list of flags we pass to the compiler, and we might want to special case things in that direction. |
cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
169 ↗ | (On Diff #28393) | That point is in general valid - some flag might be an error for the assembler. But in practice, the only flag ever passed to add_flag_or_print_warning is '-fPIC' (in the same file, about 20 lines down). In terms of deciding whether a flag is acceptable to the assembler, this is difficult. There is also the question of whether other flags need to go into CMAKE_ASM_FLAGS that are not added specifically in add_flag_or_print_warning. Visual inspection suggests not. Pretty much all of the flags that are added into CMAKE_C_FLAGS and CMAKE_CXX_FLAGS are '-f' and '-W' options, which have no relevance to assembly source. |
lgtm
cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
169 ↗ | (On Diff #28393) | Nice. Let's do it then. |