Skip to content
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

[rtsan] Re-enable rtsan tests #98219

Merged
merged 6 commits into from
Jul 9, 2024
Merged
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
6 changes: 3 additions & 3 deletions compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
${LOONGARCH64})
set(ALL_ASAN_ABI_SUPPORTED_ARCH ${X86_64} ${ARM64} ${ARM64_32})
set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${LOONGARCH64})
#set(ALL_RTSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
# ${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON}
# ${LOONGARCH64})
set(ALL_RTSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON}
${LOONGARCH64})

if(ANDROID)
set(OS_NAME "Android")
Expand Down
3 changes: 2 additions & 1 deletion compiler-rt/cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,8 @@ else()
set(COMPILER_RT_HAS_ASAN FALSE)
endif()

if (COMPILER_RT_HAS_SANITIZER_COMMON AND RTSAN_SUPPORTED_ARCH)
if (COMPILER_RT_HAS_SANITIZER_COMMON AND RTSAN_SUPPORTED_ARCH AND
OS_NAME MATCHES "Android|Darwin|Linux")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cjappl how about this and let motivated folks with access to those OSes to test and enable when needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

I believe we need to add the conditional check for COMPILER_RT_HAS_RTSAN in compiler-rt/lib/rtsan/CMakeLists.txt. We missed that in the first PR.

With that change, this should be good! I'm going to approve, assuming that you add that conditional in there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually rather limit to whatever you are willing to work in near future.
What is your platforms of interest?

Copy link
Contributor

@cjappl cjappl Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux and Darwin are the platforms that we have easiest development access to in ubuntu and MacOS. I think starting there and building up would be just fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we need to add the conditional check for COMPILER_RT_HAS_RTSAN in compiler-rt/lib/rtsan/CMakeLists.txt. We missed that in the first PR.

COMPILER_RT_HAS_${} checked by root lib/ and test/ CMakeLists

set(COMPILER_RT_HAS_RTSAN TRUE)
else()
set(COMPILER_RT_HAS_RTSAN FALSE)
Expand Down
3 changes: 1 addition & 2 deletions compiler-rt/lib/rtsan/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ foreach(arch ${RTSAN_TEST_ARCH})
# RtsanUnitTests "Rtsan-${arch}-Test" ${arch}
# COMPILE_DEPS ${RTSAN_UNITTEST_HEADERS}
# SOURCES ${RTSAN_INST_TEST_SOURCES} ${COMPILER_RT_GOOGLETEST_SOURCES}
# DEPS llvm_gtest rtsan
# DEPS rtsan
# CFLAGS ${RTSAN_UNITTEST_CFLAGS} -fsanitize=realtime
# LINK_FLAGS ${RTSAN_UNITTEST_LINK_FLAGS} -fsanitize=realtime)

Expand Down Expand Up @@ -94,7 +94,6 @@ foreach(arch ${RTSAN_TEST_ARCH})
COMPILE_DEPS ${RTSAN_UNITTEST_HEADERS}
SOURCES ${RTSAN_NOINST_TEST_SOURCES}
${COMPILER_RT_GOOGLETEST_SOURCES}
vitalybuka marked this conversation as resolved.
Show resolved Hide resolved
DEPS llvm_gtest
CFLAGS ${RTSAN_UNITTEST_CFLAGS}
LINK_FLAGS ${RTSAN_UNITTEST_LINK_FLAGS}
RUNTIME ${RTSAN_TEST_RUNTIME})
Expand Down
Loading