Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions compiler-rt/cmake/Modules/BuiltinTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,16 @@ function(builtin_check_c_compiler_source output source)
endif()
endif()
endfunction()

function(builtin_check_c_compiler_source_with_flags output source flags)
if(NOT DEFINED ${output})
message(STATUS "Performing Test ${output}")
try_compile_only(result SOURCE ${source} FLAGS ${flags})
set(${output} ${result} CACHE INTERNAL "Compiler supports ${output} with ${flags}")
if(${result})
message(STATUS "Performing Test ${output} - Success")
else()
message(STATUS "Performing Test ${output} - Failed")
endif()
endif()
endfunction()
4 changes: 2 additions & 2 deletions compiler-rt/cmake/builtin-config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ asm(\".arch armv8-a+lse\");
asm(\"cas w0, w1, [x2]\");
")

builtin_check_c_compiler_source(COMPILER_RT_HAS_AARCH64_SME
builtin_check_c_compiler_source_with_flags(COMPILER_RT_HAS_AARCH64_SME
"
void foo(void) __arm_streaming_compatible {
asm(\".arch armv9-a+sme2\\n\"
\"smstart\\n\"
\"ldr zt0, [sp]\");
}
")
" "-target ${LLVM_TARGET_TRIPLE} -arch arm64")

check_include_files("sys/auxv.h" COMPILER_RT_HAS_AUXV)

Expand Down