From bc5c8df20b85e21894bacd9222f315bb4e4e61ee Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Mon, 7 Jun 2021 14:22:53 -0400 Subject: [PATCH] SWDEV-289871 - Restore missing -Bsymbolic option -Bsymbolic is required to make sure all AMD OpenCL runtime symbols are resolved internally, otherwise ld might resolve them using symbols from the OpenCL ICD. This will cause incorrect functions to be called. Change-Id: I4ca0326a574ee2e537525bfda96ec20fabfe0158 --- opencl/amdocl/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opencl/amdocl/CMakeLists.txt b/opencl/amdocl/CMakeLists.txt index a9cb826f04..5980f89f8c 100644 --- a/opencl/amdocl/CMakeLists.txt +++ b/opencl/amdocl/CMakeLists.txt @@ -97,6 +97,9 @@ if(BUILD_SHARED_LIBS) if(WIN32) target_sources(amdocl PRIVATE amdocl.def) else() + # -Bsymbolic is required to make sure all AMD OpenCL runtime symbols are resolved internally + # Otherwise ld might resolve them using symbols from the OpenCL ICD + target_link_libraries(amdocl PRIVATE "-Wl,-Bsymbolic") target_link_libraries(amdocl PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/amdocl.map") set_target_properties(amdocl PROPERTIES LINK_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/amdocl.map") endif()