Adhoc codesign corrupt signatures (#46435)
authorSteve MacLean <Steve.MacLean@microsoft.com>
Wed, 30 Dec 2020 16:03:37 +0000 (11:03 -0500)
committerGitHub <noreply@github.com>
Wed, 30 Dec 2020 16:03:37 +0000 (17:03 +0100)
* Adhoc codesign corrupt signatures

* PR Feedback

eng/native/functions.cmake
src/coreclr/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt
src/coreclr/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt
src/coreclr/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt

index 3cbda05..eec3097 100644 (file)
@@ -315,6 +315,12 @@ function(install_with_stripped_symbols targetName kind destination)
       strip_symbols(${targetName} symbol_file)
       install_symbols(${symbol_file} ${destination})
     endif()
+
+    if ((CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) AND ("${kind}" STREQUAL "TARGETS"))
+      # We want to avoid the kind=TARGET install behaviors which corrupt code signatures on osx-arm64
+      set(kind PROGRAMS)
+    endif()
+
     if ("${kind}" STREQUAL "TARGETS")
       set(install_source ${targetName})
     elseif("${kind}" STREQUAL "PROGRAMS")
index b1b5c56..27ab467 100644 (file)
@@ -63,4 +63,4 @@ else()
     _install (FILES $<TARGET_PDB_FILE:superpmi-shim-collector> DESTINATION PDB)
 endif(CLR_CMAKE_HOST_UNIX)
 
-_install (TARGETS superpmi-shim-collector DESTINATION .)
+_install (PROGRAMS $<TARGET_FILE:superpmi-shim-collector> DESTINATION .)
index 0e65456..57a42a5 100644 (file)
@@ -65,4 +65,4 @@ else()
     _install (FILES $<TARGET_PDB_FILE:superpmi-shim-counter> DESTINATION PDB)
 endif(CLR_CMAKE_HOST_UNIX)
 
-_install (TARGETS superpmi-shim-counter DESTINATION .)
+_install (PROGRAMS $<TARGET_FILE:superpmi-shim-counter> DESTINATION .)
index 72fdf07..58afa78 100644 (file)
@@ -64,4 +64,4 @@ else()
     _install (FILES $<TARGET_PDB_FILE:superpmi-shim-simple> DESTINATION PDB)
 endif(CLR_CMAKE_HOST_UNIX)
 
-_install (TARGETS superpmi-shim-simple DESTINATION .)
+_install (PROGRAMS $<TARGET_FILE:superpmi-shim-simple> DESTINATION .)