================
@@ -1248,6 +1296,11 @@ void DarwinClang::addClangWarningOptions(ArgStringList
&CC1Args) const {
CC1Args.push_back("-Werror=undef-prefix");
// For modern targets, promote certain warnings to errors.
+ // Lazily initialize the target if needed (e.g. when Darwin is used as
+ // a host toolchain for device offloading).
+ ensureTargetInitialized();
----------------
pvelesko wrote:
Darwin's AddDeploymentTarget() runs inside TranslateArgs(), which early-returns
when BoundArch is empty. In the HIP offloading path, the host Darwin toolchain
is created without a bound arch, so AddDeploymentTarget() never runs and
TargetInitialized stays false.
Then addClangWarningOptions() calls isTargetWatchOSBased(), which hits the
assert(TargetInitialized) in Darwin::isTargetInitialized().
https://github.com/llvm/llvm-project/pull/183991
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits