Skip to content

[20230725][CMake] Detect properly new linker introduced in Xcode 15 #8006

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

Conversation

edymtt
Copy link

@edymtt edymtt commented Jan 19, 2024

As explained in 1, this linker is functionally equivalent to the classic one (ld64) for build system purposes -- in particular to enable the use of order files to link clang. For this reason, in addition to fixing the detection rename LLVM_LINKER_IS_LD64 to LLVM_LINKER_IS_APPLE to make the result of such detection more clear -- this should not cause any issue to downstream users, from a quick search in SourceGraph 2, only Swift uses the value of this variable (which I will take care of updating in due time).

rdar://120740222

(cherry picked from commit 9175dd9)

As explained in [1], this linker is functionally equivalent to the
classic one (`ld64`) for build system purposes -- in particular to
enable the use of order files to link `clang`. For this reason, in
addition to fixing the detection rename `LLVM_LINKER_IS_LD64` to
`LLVM_LINKER_IS_APPLE` to make the result of such detection more
clear -- this should not cause any issue to downstream users, from
a quick search in SourceGraph [2], only Swift uses the value of
this variable (which I will take care of updating in due time).

[1]: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking
[2]: https://sourcegraph.com/search?q=context:global+LLVM_LINKER_IS_LD64+lang:cmake+fork:no+-file:AddLLVM.cmake+-file:clang/tools/driver/CMakeLists.txt&patternType=standard&sm=1&groupBy=repo
rdar://120740222

(cherry picked from commit 9175dd9)
@edymtt edymtt requested a review from ldionne January 19, 2024 22:33
@edymtt
Copy link
Author

edymtt commented Jan 19, 2024

@swift-ci please test

@edymtt
Copy link
Author

edymtt commented Jan 19, 2024

@swift-ci test llvm

@edymtt
Copy link
Author

edymtt commented Jan 22, 2024

LLVM macOS job has one test failures that matches the ones in #7919 (a previous PR for stable/20230725 that tested LLVM)

Failed Tests (1):
  LLVM :: Instrumentation/AddressSanitizer/global_with_comdat.ll

The linux one has 220 failures, which I don't see in #7919 -- not positive this depends on this changes (since I had no regression when testing on LLVM buildkite), errors seem all related to finding modules

/home/build-user/llvm-project/clang/test/CXX/module/module.interface/p2.cpp:23:15: fatal error: error in loading module 'X' from prebuilt module path
   23 | export import X;
      |               ^
1 error generated.

@edymtt
Copy link
Author

edymtt commented Jan 22, 2024

@swift-ci test llvm Linux

@edymtt
Copy link
Author

edymtt commented Jan 22, 2024

In the second Linux run I have the exact failures as #7919

Failed Tests (2):
  Clang :: ClangScanDeps/modules-include-tree-prefix-map.c
  LLVM :: Instrumentation/AddressSanitizer/global_with_comdat.ll

So likely I hit some transient failure.

@edymtt edymtt merged commit 4b42851 into swiftlang:stable/20230725 Jan 22, 2024
@edymtt edymtt deleted the edymtt/detect-linker-xcode-15-20230725 branch January 30, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants