mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-04 00:20:14 +00:00

Summary: Mark Android as supported in the cmake configuration for Scudo. Scudo is not added yet in the Android build bots, but code builds and tests pass locally. It is for a later CL. I also checked that Scudo builds as part of the Android toolchain. A few modifications had to be made: - Android defaults to `abort_on_error=1`, which doesn't work well with the current tests. So change the default way to pass `SCUDO_OPTIONS` to the tests to account for this, setting it to 0 by default; - Disable the `valloc.cpp` & `random_shuffle.cpp` tests on Android; - There is a bit of gymnatic to be done with the `SCUDO_TEST_TARGET_ARCH` string, due to android using the `-android` suffix, and `i686` instead of `i386`; - Android doesn't need `-lrt`. Reviewers: alekseyshl, eugenis Reviewed By: alekseyshl Subscribers: srhines, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D37907 llvm-svn: 313538
42 lines
1.3 KiB
CMake
42 lines
1.3 KiB
CMake
set(SCUDO_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
set(SCUDO_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
set(SCUDO_TESTSUITES)
|
|
|
|
set(SCUDO_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
|
|
if(NOT COMPILER_RT_STANDALONE_BUILD)
|
|
list(APPEND SCUDO_TEST_DEPS scudo)
|
|
endif()
|
|
|
|
configure_lit_site_cfg(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
)
|
|
|
|
set(SCUDO_TEST_ARCH ${SCUDO_SUPPORTED_ARCH})
|
|
foreach(arch ${SCUDO_TEST_ARCH})
|
|
if(ANDROID)
|
|
if (${arch} STREQUAL "i386")
|
|
set(SCUDO_TEST_TARGET_ARCH i686-android)
|
|
else()
|
|
set(SCUDO_TEST_TARGET_ARCH ${arch}-android)
|
|
endif()
|
|
else()
|
|
set(SCUDO_TEST_TARGET_ARCH ${arch})
|
|
endif()
|
|
string(TOLOWER "-${arch}" SCUDO_TEST_CONFIG_SUFFIX)
|
|
get_test_cc_for_arch(${arch} SCUDO_TEST_TARGET_CC SCUDO_TEST_TARGET_CFLAGS)
|
|
string(TOUPPER ${arch} ARCH_UPPER_CASE)
|
|
set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
|
|
|
|
configure_lit_site_cfg(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg)
|
|
list(APPEND SCUDO_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
|
|
endforeach()
|
|
|
|
add_lit_testsuite(check-scudo "Running the Scudo Hardened Allocator tests"
|
|
${SCUDO_TESTSUITES}
|
|
DEPENDS ${SCUDO_TEST_DEPS})
|
|
set_target_properties(check-scudo PROPERTIES FOLDER "Compiler-RT Misc")
|