mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
DynamicAnalysis: Blacklist third party modules and libraries
For use with sanitizer builds.
This commit is contained in:
parent
73659c2900
commit
b5e618c980
42
CMake/VTKmCompilerDynamicAnalysisFlags.cmake
Normal file
42
CMake/VTKmCompilerDynamicAnalysisFlags.cmake
Normal file
@ -0,0 +1,42 @@
|
||||
##============================================================================
|
||||
## Copyright (c) Kitware, Inc.
|
||||
## All rights reserved.
|
||||
## See LICENSE.txt for details.
|
||||
## This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
## PURPOSE. See the above copyright notice for more information.
|
||||
##
|
||||
## Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
||||
## Copyright 2014 UT-Battelle, LLC.
|
||||
## Copyright 2014 Los Alamos National Security.
|
||||
##
|
||||
## Under the terms of Contract DE-NA0003525 with NTESS,
|
||||
## the U.S. Government retains certain rights in this software.
|
||||
##
|
||||
## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
||||
## Laboratory (LANL), the U.S. Government retains certain rights in
|
||||
## this software.
|
||||
##============================================================================
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# check if this is a sanitizer build. If so, set up the environment.
|
||||
|
||||
function(vtkm_check_sanitizer_build)
|
||||
string (FIND "${CTEST_MEMORYCHECK_TYPE}" "Sanitizer" SANITIZER_BUILD)
|
||||
if (${SANITIZER_BUILD} GREATER -1)
|
||||
# This is a sanitizer build.
|
||||
# Configure the sanitizer blacklist file
|
||||
set (SANITIZER_BLACKLIST "${VTKm_BINARY_DIR}/sanitizer_blacklist.txt")
|
||||
configure_file (
|
||||
"${VTKm_SOURCE_DIR}/Utilities/DynamicAnalysis/sanitizer_blacklist.txt.in"
|
||||
${SANITIZER_BLACKLIST}
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Add the compiler flags for blacklist
|
||||
set (FSANITIZE_BLACKLIST "\"-fsanitize-blacklist=${SANITIZER_BLACKLIST}\"")
|
||||
foreach (entity C CXX SHARED_LINKER EXE_LINKER MODULE_LINKER)
|
||||
set (CMAKE_${entity}_FLAGS "${CMAKE_${entity}_FLAGS} ${FSANITIZE_BLACKLIST}")
|
||||
endforeach ()
|
||||
endif ()
|
||||
endfunction()
|
@ -200,6 +200,11 @@ if (VTKm_ENABLE_TESTING)
|
||||
# Find Pyexpander in case somebody wants to update the auto generated
|
||||
# faux variadic template code
|
||||
find_package(Pyexpander QUIET)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Setup compiler flags for dynamic analysis if needed
|
||||
include(VTKmCompilerDynamicAnalysisFlags)
|
||||
vtkm_check_sanitizer_build()
|
||||
endif (VTKm_ENABLE_TESTING)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
1
Utilities/DynamicAnalysis/lsan.supp
Normal file
1
Utilities/DynamicAnalysis/lsan.supp
Normal file
@ -0,0 +1 @@
|
||||
leak:libX11*
|
2
Utilities/DynamicAnalysis/sanitizer_blacklist.txt.in
Normal file
2
Utilities/DynamicAnalysis/sanitizer_blacklist.txt.in
Normal file
@ -0,0 +1,2 @@
|
||||
# Blacklist third party libraries from invoking sanitizer errors
|
||||
src:@VTKm_SOURCE_DIR@/vtkm/thirdparty/*
|
Loading…
Reference in New Issue
Block a user