Skip to content

[compiler-rt][cmake] Test COMPILER_RT_HAS_AARCH64_SME with arm64 #10724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
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