mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 13:54:58 +08:00
fix: Remove RTLD_DEEPBIND from dlopen call
Resolves: NEO-15651 Signed-off-by: Pawel Szymichowski <pawel.szymichowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
bb734eb33a
commit
211cd3dd5d
@@ -732,7 +732,7 @@ else()
|
||||
option(USE_ASAN "Link with address sanitization support" OFF)
|
||||
if(USE_ASAN)
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(ASAN_FLAGS " -fsanitize=address -fno-omit-frame-pointer -DSANITIZER_BUILD")
|
||||
set(ASAN_FLAGS " -fsanitize=address -fno-omit-frame-pointer")
|
||||
set(ASAN_LIBS "asan")
|
||||
set(GTEST_ENV ${GTEST_ENV} LSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR}/opencl/test/unit_test/lsan_suppressions.txt)
|
||||
else()
|
||||
@@ -743,7 +743,7 @@ else()
|
||||
if(CMAKE_COMPILER_IS_GNUCC AND USE_ASAN)
|
||||
message(STATUS "Cannot use thread sanitization with address sanitization in gcc")
|
||||
else()
|
||||
set(TSAN_FLAGS " -fsanitize=thread -DSANITIZER_BUILD")
|
||||
set(TSAN_FLAGS " -fsanitize=thread")
|
||||
set(TSAN_LIBS "tsan")
|
||||
endif()
|
||||
endif()
|
||||
@@ -866,9 +866,6 @@ if(NOT MSVC)
|
||||
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
# clang only
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32 -Wno-extern-c-compat -Wno-instantiation-after-specialization")
|
||||
if(NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6))
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSANITIZER_BUILD")
|
||||
endif()
|
||||
else()
|
||||
# gcc only
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
||||
@@ -882,7 +879,7 @@ if(NOT MSVC)
|
||||
check_cxx_compiler_flag(-fsanitize=undefined COMPILER_SUPPORTS_UNDEFINED_BEHAVIOR_SANITIZER)
|
||||
if(COMPILER_SUPPORTS_UNDEFINED_BEHAVIOR_SANITIZER)
|
||||
message(STATUS "Enabling undefined behavior sanitizer")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fsanitize-recover=vptr -fno-rtti -DSANITIZER_BUILD")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fsanitize-recover=vptr -fno-rtti")
|
||||
if(NOT SANITIZE_UB_ALLOW_CONTINUE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-sanitize-recover=undefined")
|
||||
endif()
|
||||
|
||||
@@ -42,12 +42,7 @@ OsLibrary::OsLibrary(const OsLibraryCreateProperties &properties) {
|
||||
if (properties.libraryName.empty() || properties.performSelfLoad) {
|
||||
this->handle = SysCalls::dlopen(0, RTLD_LAZY);
|
||||
} else {
|
||||
#ifdef SANITIZER_BUILD
|
||||
auto dlopenFlag = RTLD_LAZY;
|
||||
#else
|
||||
auto dlopenFlag = RTLD_LAZY | RTLD_DEEPBIND;
|
||||
/* Background: https://github.com/intel/compute-runtime/issues/122 */
|
||||
#endif
|
||||
dlopenFlag = properties.customLoadFlags ? *properties.customLoadFlags : dlopenFlag;
|
||||
adjustLibraryFlags(dlopenFlag);
|
||||
this->handle = SysCalls::dlopen(properties.libraryName.c_str(), dlopenFlag);
|
||||
|
||||
Reference in New Issue
Block a user