Clang error: unknown target CPU 'A' (err_target_unknown_cpu)
Jump to navigation
Jump to search
Text | error: unknown target CPU 'A' |
---|---|
Type | Error |
Category | None |
Internal Id | err_target_unknown_cpu |
Internal Message | unknown target CPU '%0'
|
Regular Expression | (?:error|fatal error)\: unknown target CPU '(.*?)'
|
First Commit | 2009-12-18 acde99ea522d ARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX). |
Description
Example
Flags | -xc -march=armv8-a+nosve
|
|
---|---|---|
Source |
void f(__SVInt8_t v) {} // Used an SVE data type but the target CPU doesn't support SVE
| |
Compiler Output |
error: unknown target CPU 'armv8-a+nosve' note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, x86-64-v2, x86-64-v3, x86-64-v4 |
Clang Internals (17.0.6)
Git Commit Message
ARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX). - This should be done leveraging the backend, but I'm a little refactored out. I'll fix it one day, I promise. llvm-svn: 91700
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 787)
/// CreateTargetInfo - Return the target info object for the specified target
/// options.
TargetInfo *TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags, const std::shared_ptr<TargetOptions> &Opts) {
// ...
// Set the target CPU if specified.
if (!Opts->CPU.empty() && !Target->setCPU(Opts->CPU)) {
Diags.Report(diag::err_target_unknown_cpu) << Opts->CPU;
clang/lib/Basic/Targets.cpp (line 798)
/// CreateTargetInfo - Return the target info object for the specified target
/// options.
TargetInfo *TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags, const std::shared_ptr<TargetOptions> &Opts) {
// ...
// Check the TuneCPU name if specified.
if (!Opts->TuneCPU.empty() && !Target->isValidTuneCPUName(Opts->TuneCPU)) {
Diags.Report(diag::err_target_unknown_cpu) << Opts->TuneCPU;
Triggered in Clang Tests
This section lists all internal Clang test cases that trigger the diagnostic.
clang/test/Preprocessor/predefined-arch-macros.c
- error: unknown target CPU 'amdgcn'