aboutsummaryrefslogtreecommitdiff
path: root/compiler-rt
diff options
context:
space:
mode:
authorMark Rowe <mrowe@bdash.net.nz>2024-04-11 16:13:54 -0700
committerGitHub <noreply@github.com>2024-04-11 16:13:54 -0700
commit2f55056c89dd1ccb1aa69a9aed68048a59413d4d (patch)
tree0fe0083fa566e5ebf42ad46d95d7b71467e2c891 /compiler-rt
parent43d0891d3bb1fc40ff5dcea91c28d1582978caff (diff)
downloadllvm-2f55056c89dd1ccb1aa69a9aed68048a59413d4d.tar.gz
llvm-2f55056c89dd1ccb1aa69a9aed68048a59413d4d.tar.bz2
llvm-2f55056c89dd1ccb1aa69a9aed68048a59413d4d.zip
[compiler-rt] Don't explicitly ad-hoc code sign dylibs if using Apple's new linker (#88323)
Apple's new linker reports itself as ld rather than ld64 and does not match the version detection regex. Invert the logic to look only for older versions of ld64. This ensures the runtime dylibs are left with a linker-generated code signature that tools such as `strip` will preserve. Co-authored-by: Mark Rowe <markrowe@chromium.org>
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/cmake/Modules/AddCompilerRT.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index e0400a8ea952..dc36f16c661c 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -405,11 +405,14 @@ function(add_compiler_rt_runtime name type)
if (HAD_ERROR)
message(FATAL_ERROR "${CMAKE_LINKER} failed with status ${HAD_ERROR}")
endif()
- set(NEED_EXPLICIT_ADHOC_CODESIGN 1)
+ set(NEED_EXPLICIT_ADHOC_CODESIGN 0)
+ # Apple introduced a new linker by default in Xcode 15. This linker reports itself as ld
+ # rather than ld64 and does not match this version regex. That's ok since it never needs
+ # the explicit ad-hoc code signature.
if ("${LD_V_OUTPUT}" MATCHES ".*ld64-([0-9.]+).*")
string(REGEX REPLACE ".*ld64-([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
- if (HOST_LINK_VERSION VERSION_GREATER_EQUAL 609)
- set(NEED_EXPLICIT_ADHOC_CODESIGN 0)
+ if (HOST_LINK_VERSION VERSION_LESS 609)
+ set(NEED_EXPLICIT_ADHOC_CODESIGN 1)
endif()
endif()
if (NEED_EXPLICIT_ADHOC_CODESIGN)