Skip to content

[compiler-rt] Don't explicitly ad-hoc code sign dylibs if using Apple's new linker #88323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions compiler-rt/cmake/Modules/AddCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down