From 83b3427bf14b2f9d9da4a0cc838d95ec9f00099e Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Tue, 1 Sep 2020 15:00:45 -0700 Subject: [PATCH] Fix multiple version strings in coreclr shared libraries We were incorrectly adding the version.c source to all coreclr libraries and not just the shared ones. That caused multiple occurences of the version string in coreclr shared libraries composed of sublibraries. This change fixes it by adding that source file for shared libraries only. I've also discovered that libcoreclrtraceptprovider.so was missing the version string completely, so I've added it there. --- eng/native/functions.cmake | 4 ++-- .../src/pal/src/eventprovider/lttngprovider/CMakeLists.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index 1509a17fa59b0..1bdcf1ddd3845 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -439,11 +439,11 @@ function(_add_executable) endfunction() function(_add_library) - if(NOT WIN32) + if(NOT WIN32 AND "${ARGV1}" STREQUAL "SHARED") add_library(${ARGV} ${VERSION_FILE_PATH}) else() add_library(${ARGV}) - endif(NOT WIN32) + endif(NOT WIN32 AND "${ARGV1}" STREQUAL "SHARED") list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX) if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1) set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1) diff --git a/src/coreclr/src/pal/src/eventprovider/lttngprovider/CMakeLists.txt b/src/coreclr/src/pal/src/eventprovider/lttngprovider/CMakeLists.txt index d55dab3557f35..b6b54e24ac734 100644 --- a/src/coreclr/src/pal/src/eventprovider/lttngprovider/CMakeLists.txt +++ b/src/coreclr/src/pal/src/eventprovider/lttngprovider/CMakeLists.txt @@ -55,6 +55,7 @@ add_library(eventprovider add_library(coreclrtraceptprovider SHARED ${TRACEPOINT_PROVIDER_SOURCES} + ${VERSION_FILE_PATH} ) add_dependencies(eventprovider generated_eventing_headers)