I have x86-64 Debian sid installed in kvm-qemu. I have 64-bit clang-3.5
installed from Debian repository.
When compiling a simple program with -march=native, clang fails.
$ cat hello.c
include
int main(void)
{
printf("Hello World!\n");
return 0;
}
$ clang -march=native hello.c
error: unknown target CPU 'athlon'
Apparently, there is some bug in processor detection, even if the system is
64-bit, clang detects a 32-bit "athlon" processor and subsequently fails, because
the 64-bit target doesn't know this processor.
Note that kvm reports some features of the underlying CPU (the CPU is
istanbul-class Opteron) as not present in order to allow the program to be
migrated. This probably confuses clang, so that it clasifies the CPU as 32-bit
Athlon.
| | |
| --- | --- |
| Bugzilla Link | [19236](https://llvm.org/bz19236) |
| Version | trunk |
| OS | Linux |
| Attachments | [The content of https://user-images.githubusercontent.com/95090467/143749222-ccc47988-4cb1-4ab8-b1b3-9438cd943022.gz), [The output of the cpuid utility in the guest system](https://user-images.githubusercontent.com/95090467/143749223-ee791819-6fdc-401e-a079-3847691ebf38.gz) |
## Extended Description
I have x86-64 Debian sid installed in kvm-qemu. I have 64-bit clang-3.5
installed from Debian repository.
When compiling a simple program with -march=native, clang fails.
$ cat hello.c
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
$ clang -march=native hello.c
error: unknown target CPU 'athlon'
Apparently, there is some bug in processor detection, even if the system is
64-bit, clang detects a 32-bit "athlon" processor and subsequently fails, because
the 64-bit target doesn't know this processor.
Note that kvm reports some features of the underlying CPU (the CPU is
istanbul-class Opteron) as not present in order to allow the program to be
migrated. This probably confuses clang, so that it clasifies the CPU as 32-bit
Athlon.
Extended Description
I have x86-64 Debian sid installed in kvm-qemu. I have 64-bit clang-3.5 installed from Debian repository.
When compiling a simple program with -march=native, clang fails. $ cat hello.c
include
int main(void) { printf("Hello World!\n"); return 0; } $ clang -march=native hello.c error: unknown target CPU 'athlon'
Apparently, there is some bug in processor detection, even if the system is 64-bit, clang detects a 32-bit "athlon" processor and subsequently fails, because the 64-bit target doesn't know this processor.
Note that kvm reports some features of the underlying CPU (the CPU is istanbul-class Opteron) as not present in order to allow the program to be migrated. This probably confuses clang, so that it clasifies the CPU as 32-bit Athlon.