[PATCH] D123475: [compiler-rt] Stop explictly ad-hoc signing compiler-rt dylibs in apple builds

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 10 18:31:57 PDT 2022


thakis created this revision.
thakis added a reviewer: kubamracek.
Herald added subscribers: mgorny, dberris.
Herald added a project: All.
thakis requested review of this revision.

ld64 implicitly ad-hoc code-signs as of Xcode 12, and `strip` and friends know
how keep this special ad-hoc signature valid.

So this should have no effective behavior change, except that you can now strip
libclang_rt.asan_osx_dynamic.dylib and it'll still have a valid ad-hoc
signature, instead of strip printing "warning: changes being made to the file
will invalidate the code signature in:" and making the ad-hoc code signature
invalid.


https://reviews.llvm.org/D123475

Files:
  compiler-rt/cmake/Modules/AddCompilerRT.cmake


Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake
===================================================================
--- compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -372,14 +372,6 @@
         set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
         set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
       endif()
-      if(APPLE)
-        # Ad-hoc sign the dylibs
-        add_custom_command(TARGET ${libname}
-          POST_BUILD
-          COMMAND codesign --sign - $<TARGET_FILE:${libname}>
-          WORKING_DIRECTORY ${COMPILER_RT_OUTPUT_LIBRARY_DIR}
-        )
-      endif()
     endif()
 
     set(parent_target_arg)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123475.421815.patch
Type: text/x-patch
Size: 717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220411/2ab41037/attachment.bin>


More information about the llvm-commits mailing list