[all-commits] [llvm/llvm-project] a916cb: [clang][driver][darwin] DarwinSDKInfo doesn't matc...
Ian Anderson via All-commits
all-commits at lists.llvm.org
Thu Jun 25 11:59:07 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a916cb6b5793ee5e853dd308fed9c14940821023
https://github.com/llvm/llvm-project/commit/a916cb6b5793ee5e853dd308fed9c14940821023
Author: Ian Anderson <iana at apple.com>
Date: 2026-06-25 (Thu, 25 Jun 2026)
Changed paths:
M clang/include/clang/Basic/DarwinSDKInfo.h
M clang/lib/Basic/DarwinSDKInfo.cpp
M clang/lib/Driver/ToolChains/Darwin.cpp
M clang/lib/Driver/ToolChains/Darwin.h
M clang/test/Driver/driverkit-path.c
M clang/test/Driver/incompatible_sysroot.c
M clang/unittests/Basic/DarwinSDKInfoTest.cpp
Log Message:
-----------
[clang][driver][darwin] DarwinSDKInfo doesn't match sufficiently modified triples, doesn't warn for unsupported architectures (#204061)
DarwinSDKInfo::getPlatformPrefix(...) is passed the effective target
triple which has undergone modifications from the original -target
value, which can sometimes even include changes to the triple's
environment. That will cause it to fail to match the platform infos, not
get a platform prefix, and get incorrect default search paths. In the
case where a triple doesn't match, check all platform infos, and if they
all have the same platform prefix, then use that.
DarwinSDKInfo::supportsTriple(...) doesn't try to match the architecture
of the triple. That makes it not emit -Wincompatible-sysroot e.g. when
trying to use arm64 against a sufficiently old macOS SDK or when still
trying to build i386 for macOS. Instead of parsing values from
SDKSettings.json into a Triple, storing the probably-relevant
components, and then comparing those against a full Triple, just store
the parsed triple and get rid of the custom comparison code. While this
does make the matching problem above a little more fragile, in practice
that's well mitigated by treating thumb* and arm* as equivalent, and it
does allow for better diagnostics and overall simpler code.
Clean up some unnecessary copies in DarwinSDKInfo and related code.
Assisted-by: Claude Code
rdar://172876443
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list