[clang] [llvm] [CMake] Detect properly new linker introduced in Xcode 15 (PR #77806)

Eric Miotto via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 14:18:35 PST 2024


================
@@ -211,10 +211,10 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32)
     )
 
   if(APPLE)
-    if("${stderr}" MATCHES "PROJECT:ld64")
+    if("${stderr}" MATCHES "PROGRAM:ld")
----------------
edymtt wrote:

Yes, that's the intent -- in fact we are not checking the `PROJECT` part anymore, but the `PROGRAM` one, which I found empirically remains more "stable" across Xcode versions (while not making the check needlessly complicated with regexes):

```
> .../Xcode14.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -v
@(#)PROGRAM:ld  PROJECT:ld64-857.1
...
```

```
> .../Xcode15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -v
@(#)PROGRAM:ld  PROJECT:dyld-1022.1
...
```

https://github.com/llvm/llvm-project/pull/77806


More information about the cfe-commits mailing list