I asked this in cfe-users in September but
unfortunately it didn't receive much attention and
I am trying to cross compile a program on an i7 CPU
for a target "Intel(R) Celeron(R) M processor
1.50GHz". Here is `cat /proc/cpuinfo` for the target:
In my attempt to find the proper architecture name I
ran on the target:
gcc -march=native -Q --help=target | grep -- '-march=' | cut -f3
which gave me "pentium-m". Normally for gcc I would
CFLAGS="-O3 -pipe -march=pentium-m -mtune=pentium-m"
However as per the subject of this message it seems
Clang doesn't recognize this target and throws a
series of similar errors:
error: unknown target CPU 'pentium-m'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, iavx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cannonlake, iicelake-server, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, x8
Then I found this info:
which suggests running:
$ llc --version
(to show supported architectures)
$ llc -march=ARCH -mattr=help
(to list "available CPUs" and "available features")
So I found for my case:
$ llc -march=x86 -mattr=help
Available CPUs for this target:
pentium-m - Select the pentium-m processor.
And I modified my script to use:
CFLAGS='-O3 -march=x86 -mtune=pentium-m'
Unfortunately clang complains again:
error: unknown target CPU 'x86'
note: valid target CPU values are: (same old list)
I hope someone can shed some light on all this. There
seem to be others complaining from the lack of info.
What target should I use and how can I optimize the
build for it?