Author: cbieneman
Date: Thu May 30 15:25:48 2019
New Revision: 362169

URL: http://llvm.org/viewvc/llvm-project?rev=362169&view=rev
Log:
Support codesigning bundles and forcing

Summary:
Clangd's framework is assembled by copying binaries from the lib and bin 
directories into a bundle shape. This results in an invalid bundle code 
signature because the signature only applies to the binaries not the resources.

This patch adds two new options to `llvm_codesign` to enable re-signing the 
library and XPC service as bundles.

The `BUNDLE_PATH` option allow specifying an explicit path to codesign, which 
enables signing bundles which aren't generated using CMake's `FRAMEWORK` or 
`BUNDLE` target properties.

The `FORCE` option allows re-signing binaries that have already been signed. 
This is required for how clangd exposes the clangd library and tools as both 
XPC and non-XPC services using the same binary.

Reviewers: jkorous, bogner

Reviewed By: bogner

Subscribers: mgorny, ilya-biryukov, dexonsmith, arphaman, kadircet, 
cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D62693

Modified:
    
clang-tools-extra/trunk/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake

Modified: 
clang-tools-extra/trunk/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake?rev=362169&r1=362168&r2=362169&view=diff
==============================================================================
--- 
clang-tools-extra/trunk/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake 
(original)
+++ 
clang-tools-extra/trunk/clangd/xpc/cmake/modules/CreateClangdXPCFramework.cmake 
Thu May 30 15:25:48 2019
@@ -70,4 +70,9 @@ macro(create_clangd_xpc_framework target
     ${target}
     ${CLANGD_FRAMEWORK_LOCATION}
   )
+
+  # clangd is already signed as a standalone executable, so it must be forced.
+  llvm_codesign(ClangdXPC BUNDLE_PATH 
"${CLANGD_FRAMEWORK_OUT_LOCATION}/XPCServices/${CLANGD_XPC_SERVICE_NAME}.xpc/" 
FORCE)
+  # ClangdXPC library is already signed as a standalone library, so it must be 
forced.
+  llvm_codesign(ClangdXPC BUNDLE_PATH "${CLANGD_FRAMEWORK_LOCATION}" FORCE)
 endmacro(create_clangd_xpc_framework)


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to