Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LLVM project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Panda
LLVM project
Commits
91bfccf8
Commit
91bfccf8
authored
3 years ago
by
ZijunZhao
Browse files
Options
Downloads
Patches
Plain Diff
add tsan shared library
parent
5c3568d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
compiler-rt/cmake/config-ix.cmake
+6
-0
6 additions, 0 deletions
compiler-rt/cmake/config-ix.cmake
compiler-rt/lib/tsan/CMakeLists.txt
+25
-2
25 additions, 2 deletions
compiler-rt/lib/tsan/CMakeLists.txt
compiler-rt/test/tsan/CMakeLists.txt
+31
-0
31 additions, 0 deletions
compiler-rt/test/tsan/CMakeLists.txt
with
62 additions
and
2 deletions
compiler-rt/cmake/config-ix.cmake
+
6
−
0
View file @
91bfccf8
...
...
@@ -737,6 +737,12 @@ else()
set
(
COMPILER_RT_HAS_TSAN FALSE
)
endif
()
if
(
OS_NAME MATCHES
"Linux|FreeBSD|Windows|NetBSD|SunOS"
)
set
(
COMPILER_RT_TSAN_HAS_STATIC_RUNTIME TRUE
)
else
()
set
(
COMPILER_RT_TSAN_HAS_STATIC_RUNTIME FALSE
)
endif
()
if
(
COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND
OS_NAME MATCHES
"Darwin|Linux|FreeBSD|NetBSD|Windows|Android|Fuchsia|SunOS"
)
set
(
COMPILER_RT_HAS_UBSAN TRUE
)
...
...
This diff is collapsed.
Click to expand it.
compiler-rt/lib/tsan/CMakeLists.txt
+
25
−
2
View file @
91bfccf8
...
...
@@ -24,6 +24,12 @@ append_list_if(SANITIZER_LIMIT_FRAME_SIZE -Wframe-larger-than=530
append_list_if
(
COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors
TSAN_RTL_CFLAGS
)
set
(
TSAN_RTL_DYNAMIC_CFLAGS
${
TSAN_RTL_CFLAGS
}
)
list
(
REMOVE_ITEM TSAN_RTL_DYNAMIC_CFLAGS -fPIE
)
append_list_if
(
COMPILER_RT_HAS_LIBDL dl TSAN_DYNAMIC_LINK_LIBS
)
append_list_if
(
COMPILER_RT_HAS_LIBPTHREAD pthread TSAN_DYNAMIC_LINK_LIBS
)
set
(
TSAN_SOURCES
rtl/tsan_clock.cpp
rtl/tsan_debugging.cpp
...
...
@@ -40,7 +46,6 @@ set(TSAN_SOURCES
rtl/tsan_md5.cpp
rtl/tsan_mman.cpp
rtl/tsan_mutexset.cpp
rtl/tsan_preinit.cpp
rtl/tsan_report.cpp
rtl/tsan_rtl.cpp
rtl/tsan_rtl_mutex.cpp
...
...
@@ -58,6 +63,10 @@ set(TSAN_CXX_SOURCES
rtl/tsan_new_delete.cpp
)
set
(
TSAN_PREINIT_SOURCES
rtl/tsan_preinit.cpp
)
if
(
APPLE
)
list
(
APPEND TSAN_SOURCES
rtl/tsan_interceptors_mac.cpp
...
...
@@ -238,7 +247,7 @@ else()
add_compiler_rt_runtime
(
clang_rt.tsan
STATIC
ARCHS
${
arch
}
SOURCES
${
TSAN_SOURCES
}
${
TSAN_ASM_SOURCES
}
SOURCES
${
TSAN_SOURCES
}
${
TSAN_ASM_SOURCES
}
${
TSAN_PREINIT_SOURCES
}
$<TARGET_OBJECTS:RTInterception.
${
arch
}
>
$<TARGET_OBJECTS:RTSanitizerCommon.
${
arch
}
>
$<TARGET_OBJECTS:RTSanitizerCommonLibc.
${
arch
}
>
...
...
@@ -258,6 +267,20 @@ else()
PARENT_TARGET tsan
)
list
(
APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-
${
arch
}
clang_rt.tsan_cxx-
${
arch
}
)
add_compiler_rt_runtime
(
clang_rt.tsan
SHARED
ARCHS
${
arch
}
SOURCES
${
TSAN_SOURCES
}
${
TSAN_ASM_SOURCES
}
$<TARGET_OBJECTS:RTInterception.
${
arch
}
>
$<TARGET_OBJECTS:RTSanitizerCommon.
${
arch
}
>
$<TARGET_OBJECTS:RTSanitizerCommonLibc.
${
arch
}
>
$<TARGET_OBJECTS:RTSanitizerCommonCoverage.
${
arch
}
>
$<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.
${
arch
}
>
$<TARGET_OBJECTS:RTUbsan.
${
arch
}
>
ADDITIONAL_HEADERS
${
TSAN_HEADERS
}
CFLAGS
${
TSAN_RTL_DYNAMIC_CFLAGS
}
LINK_LIBS
${
TSAN_DYNAMIC_LINK_LIBS
}
PARENT_TARGET tsan
)
add_sanitizer_rt_symbols
(
clang_rt.tsan
ARCHS
${
arch
}
EXTRA rtl/tsan.syms.extra
)
...
...
This diff is collapsed.
Click to expand it.
compiler-rt/test/tsan/CMakeLists.txt
+
31
−
0
View file @
91bfccf8
...
...
@@ -17,7 +17,9 @@ else()
set
(
TSAN_HAS_LIBCXX False
)
endif
()
set
(
TSAN_DYNAMIC_TEST_DEPS
${
TSAN_TEST_DEPS
}
)
set
(
TSAN_TESTSUITES
)
set
(
TSAN_DYNAMIC_TESTSUITES
)
if
(
NOT DEFINED TSAN_TEST_DEFLAKE_THRESHOLD
)
set
(
TSAN_TEST_DEFLAKE_THRESHOLD
"10"
)
...
...
@@ -49,6 +51,19 @@ foreach(arch ${TSAN_TEST_ARCH})
${
CMAKE_CURRENT_SOURCE_DIR
}
/lit.cfg.py
)
list
(
APPEND TSAN_TESTSUITES
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CONFIG_NAME
}
)
if
(
COMPILER_RT_TSAN_HAS_STATIC_RUNTIME
)
string
(
TOLOWER
"-
${
arch
}
-
${
OS_NAME
}
-dynamic"
TSAN_TEST_CONFIG_SUFFIX
)
set
(
CONFIG_NAME
${
ARCH_UPPER_CASE
}${
OS_NAME
}
DynamicConfig
)
configure_lit_site_cfg
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/lit.site.cfg.py.in
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CONFIG_NAME
}
/lit.site.cfg.py
MAIN_CONFIG
${
CMAKE_CURRENT_SOURCE_DIR
}
/lit.cfg.py
)
list
(
APPEND TSAN_DYNAMIC_TESTSUITES
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CONFIG_NAME
}
)
endif
()
endforeach
()
# iOS and iOS simulator test suites
...
...
@@ -98,11 +113,27 @@ if(COMPILER_RT_INCLUDE_TESTS)
configure_lit_site_cfg
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/Unit/lit.site.cfg.py.in
${
CMAKE_CURRENT_BINARY_DIR
}
/Unit/lit.site.cfg.py
)
if
(
COMPILER_RT_TSAN_HAS_STATIC_RUNTIME
)
configure_lit_site_cfg
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/Unit/lit.site.cfg.py.in
${
CMAKE_CURRENT_BINARY_DIR
}
/Unit/dynamic/lit.site.cfg.py
)
endif
()
list
(
APPEND TSAN_TEST_DEPS TsanUnitTests
)
list
(
APPEND TSAN_TESTSUITES
${
CMAKE_CURRENT_BINARY_DIR
}
/Unit
)
if
(
COMPILER_RT_TSAN_HAS_STATIC_RUNTIME
)
list
(
APPEND TSAN_DYNAMIC_TESTSUITES
${
CMAKE_CURRENT_BINARY_DIR
}
/Unit/dynamic
)
endif
()
endif
()
add_lit_testsuite
(
check-tsan
"Running ThreadSanitizer tests"
${
TSAN_TESTSUITES
}
DEPENDS
${
TSAN_TEST_DEPS
}
)
set_target_properties
(
check-tsan PROPERTIES FOLDER
"Compiler-RT Tests"
)
if
(
COMPILER_RT_TSAN_HAS_STATIC_RUNTIME
)
add_lit_testsuite
(
check-tsan-dynamic
"Running the ThreadSanitizer tests with dynamic runtime"
${
TSAN_DYNAMIC_TESTSUITES
}
EXCLUDE_FROM_CHECK_ALL
DEPENDS
${
TSAN_DYNAMIC_TEST_DEPS
}
)
set_target_properties
(
check-tsan-dynamic PROPERTIES FOLDER
"Compiler-RT Misc"
)
endif
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment