Clang error: unknown target triple 'A' (err_target_unknown_triple)
Jump to navigation
Jump to search
Text | error: unknown target triple 'A' |
---|---|
Type | Error |
Category | None |
Internal Id | err_target_unknown_triple |
Internal Message | unknown target triple '%0'
|
Regular Expression | (?:error|fatal error)\: unknown target triple '(.*?)'
|
First Commit | 2009-11-15 b9bbd54fdb5b Add TargetOptions and use it when constructing targets. |
Description
Example
Flags | -xc -target unknown
|
|
---|---|---|
Source |
int main() { return 0; } // Simple function
| |
Compiler Output |
error: unknown target triple 'unknown' |
Clang Internals (17.0.6)
Git Commit Message
Add TargetOptions and use it when constructing targets. - This ended up being hard to factor, sorry for the large diff. - Some post-commit cleanup to come. llvm-svn: 88833
Used in Clang Sources
This section lists all occurrences of the diagnostic within the Clang's codebase. For each occurrence, an auto-extracted snipped from the source code is listed including key elements like control structures, functions, or classes. It should illustrate the conditions under which the diagnostic is activated.
clang/lib/Basic/Targets.cpp (line 780)
/// CreateTargetInfo - Return the target info object for the specified target
/// options.
TargetInfo *TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags, const std::shared_ptr<TargetOptions> &Opts) {
// ...
if (!Target) {
Diags.Report(diag::err_target_unknown_triple) << Triple.str();
clang/lib/Driver/ToolChains/CrossWindows.cpp (line 97)
void tools::CrossWindows::Linker::ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const {
// ...
default:
D.Diag(diag::err_target_unknown_triple) << TC.getEffectiveTriple().str();
clang/lib/Driver/ToolChains/Gnu.cpp (line 452)
void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const {
// ...
if (const char *LDMOption = getLDMOption(ToolChain.getTriple(), Args)) {
// ...
} else {
D.Diag(diag::err_target_unknown_triple) << Triple.str();
clang/lib/Driver/ToolChains/MinGW.cpp (line 138)
void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const {
// ...
default:
D.Diag(diag::err_target_unknown_triple) << TC.getEffectiveTriple().str();
clang/tools/driver/cc1as_main.cpp (line 389)
static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts, DiagnosticsEngine &Diags) {
// ...
if (!TheTarget)
return Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;
clang/tools/driver/cc1as_main.cpp (line 573)
static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts, DiagnosticsEngine &Diags) {
// ...
if (!TAP)
Failed = Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;
clang/unittests/Basic/DiagnosticTest.cpp (line 41)
// Check that DiagnosticErrorTrap works with SuppressAllDiagnostics.
TEST(DiagnosticTest, suppressAndTrap) {
// ...
{
// ...
Diags.Report(diag::err_target_unknown_triple) << "unknown";