Skip to content

Improved clang type parser target tuple validation #7697

@emesare

Description

@emesare

When a user registers the architecture "xtensa" we will attempt to guess the target tuple as "xtensa-unknown-unknown-unknown" which is invalid for our clang build, resulting in any clang parser input failing with:

SyntaxError: error: <unknown>: Unknown error occurred in parsing source.

You can verify this with the type parser:

Screen.Recording.2025-11-25.at.3.53.02.PM.mov

For now if user runs into it they should adjust the type parser arguments in the platform like in windows:

virtual void AdjustTypeParserInput(
Ref<TypeParser> parser,
std::vector<std::string>& arguments,
std::vector<std::pair<std::string, std::string>>& sourceFiles
) override
{
if (parser->GetName() != "ClangTypeParser")
{
return;
}
for (auto& arg: arguments)
{
if (arg.find("--target=") == 0 && arg.find("-unknown-") != std::string::npos)
{
arg = "--target=i386-pc-windows-msvc";
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: Type ParserIssue needs changes to Clang/CoreTypeParserEffort: TrivialIssues require < 1 day of workImpact: LowIssue is a papercut or has a good, supported workaround

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions