[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 09:40:23 PST 2024
carlocab wrote:
> Maybe it is because the `darwin` legacy OS in the triple?
This is a good guess, it seems to help:
```diff
diff --git a/clang/test/Driver/arc.c b/clang/test/Driver/arc.c
index 7f6ac81aad17..70cd66899dff 100644
--- a/clang/test/Driver/arc.c
+++ b/clang/test/Driver/arc.c
@@ -1,11 +1,8 @@
-// XFAIL: xcselect
-// FIXME: There's no reason why this should fail with CLANG_USE_XCSELECT.
-
-// RUN: not %clang -ObjC -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: not %clang -x objective-c -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: not %clang -x objective-c++ -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
-// RUN: not %clang -x c -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
-// RUN: not %clang -x c++ -target i386-apple-darwin10 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
+// RUN: not %clang -ObjC -target i386-apple-macosx10.6 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang -x objective-c -target i386-apple-macosx10.6 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang -x objective-c++ -target i386-apple-macosx10.6 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang -x c -target i386-apple-macosx10.6 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
+// RUN: not %clang -x c++ -target i386-apple-macosx10.6 -stdlib=libstdc++ -m32 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTOBJC %s
// RUN: not %clang -x objective-c -target x86_64-apple-darwin11 -mmacos-version-min=10.5 -fobjc-arc %s -fsyntax-only 2>&1 | FileCheck -check-prefix NOTSUPPORTED %s
// Just to test clang is working.
```
This change makes `arc.c` succeed.
> Maybe don't use `xcselect` when it is darwin since the modern spelling should `macOS` family?
This is an option, but not the ideal one since the default target triple still uses the `-darwin` spelling. Though I suppose one can just change this at configure time.
Is there any reason why default builds don't just use the macOS spelling, at least for modern versions of macOS?
https://github.com/llvm/llvm-project/pull/119670
More information about the cfe-commits
mailing list