[cfe-dev] unknown target CPU 'pentium-m'

Craig Topper via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 22 15:08:05 PST 2018


Clang is rejecting pentium-m because the compiler is trying to output
64-bit mode code presumably because your host OS is a 64-bit OS. 64-bit
code won't run on pentium-m. I apologize that the error message for that is
bad.

Add -m32 to your command line and that should fix it.

~Craig


On Thu, Nov 22, 2018 at 2:05 PM George via cfe-dev <cfe-dev at lists.llvm.org>
wrote:

> Hi,
>
> I asked this in cfe-users in September but
> unfortunately it didn't receive much attention and
> remains unresolved.
>
> 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:
>
> https://susepaste.org/40af776d
>
> 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
> use:
>
> 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:
>
> https://stackoverflow.com/a/35061913
>
> 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?
>
> --
> George
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181122/02545b44/attachment.html>


More information about the cfe-dev mailing list