[clang] [clang][Driver][Darwin] Optionally use xcselect to find macOS SDK (PR #119670)

Carlo Cabrera via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 13 10:09:55 PST 2024


carlocab wrote:

For reference, the failure from dropping `XFAIL` from `darwin-ld-platform-version-macos.c`:

<details>
<summary>Failure Log</summary>

```
+ /Users/carlocab/github/llvm-project/build-xcselect/bin/FileCheck --check-prefix=NOSDK /Users/carlocab/github/llvm-project/clang/test/Driver/darwin-ld-platform-version-macos.c
/Users/carlocab/github/llvm-project/clang/test/Driver/darwin-ld-platform-version-macos.c:50:11: error: NOSDK: expected string not found in input
// NOSDK: "-platform_version" "macos" "10.13.0" "10.13.0"
          ^
<stdin>:1:1: note: scanning from here
clang version 20.0.0git (https://github.com/carlocab/llvm-project.git dc195bd7668c09b7ec94abf771b618170cfd4b78)
^
<stdin>:6:141: note: possible intended match here
 "/usr/bin/ld" "-demangle" "-lto_library" "/Users/carlocab/github/llvm-project/build-xcselect/lib/libLTO.dylib" "-dynamic" "-arch" "x86_64" "-platform_version" "macos" "10.13.0" "15.2" "-syslibroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk" "-mllvm" "-enable-linkonceodr-outlining" "-o" "a.out" "/Users/carlocab/github/llvm-project/build-xcselect/tools/clang/test/Driver/Output/darwin-ld-platform-version-macos.c.tmp.o" "-lSystem" "/Users/carlocab/github/llvm-project/build-xcselect/lib/clang/20/lib/darwin/libclang_rt.osx.a"
                                                                                                                                            ^

Input file: <stdin>
Check file: /Users/carlocab/github/llvm-project/clang/test/Driver/darwin-ld-platform-version-macos.c

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: clang version 20.0.0git (https://github.com/carlocab/llvm-project.git dc195bd7668c09b7ec94abf771b618170cfd4b78)
check:50'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: Target: x86_64-apple-macos10.13
check:50'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: Thread model: posix
check:50'0     ~~~~~~~~~~~~~~~~~~~~
            4: InstalledDir: /Users/carlocab/github/llvm-project/build-xcselect/bin
check:50'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5: Build config: +assertions
check:50'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
            6:  "/usr/bin/ld" "-demangle" "-lto_library" "/Users/carlocab/github/llvm-project/build-xcselect/lib/libLTO.dylib" "-dynamic" "-arch" "x86_64" "-platform_version" "macos" "10.13.0" "15.2" "-syslibroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk" "-mllvm" "-enable-linkonceodr-outlining" "-o" "a.out" "/Users/carlocab/github/llvm-project/build-xcselect/tools/clang/test/Driver/Output/darwin-ld-platform-version-macos.c.tmp.o" "-lSystem" "/Users/carlocab/github/llvm-project/build-xcselect/lib/clang/20/lib/darwin/libclang_rt.osx.a"
check:50'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:50'1                                                                                                                                                 ?                                                                                                                                                                                                                                                                                                                                                                                                                                                             possible intended match
>>>>>>
```

</details>

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


More information about the cfe-commits mailing list