<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">It&#39;s not caused by this change (not the previous one I believe), but today I&#39;ve noticed that aarch64 tunes don&#39;t set TUNE_PKGARCH correctly.<div><br></div><div>e.g. with raspberrypi3-64 which since this commit:</div><div><a href="https://github.com/agherzan/meta-raspberrypi/commit/9cc89cb7341d633b6fc3a92b937b5560d26257a1">https://github.com/agherzan/meta-raspberrypi/commit/9cc89cb7341d633b6fc3a92b937b5560d26257a1</a><br></div><div>uses conf/machine/include/tune-cortexa53.inc I was expecting it to use cortexa53 specific TUNE_PKGARCH (and stop messing with other MACHINEs which are using aarch64 package feed).</div><div><br></div><div>There is indeed:</div><div>DEFAULTTUNE=&quot;cortexa53&quot;<br></div><div>and mcpu=cortex-a53+crc in CC:</div><div><div>export CC=&quot;aarch64-webos-linux-gcc  -mcpu=cortex-a53+crc --sysroot=/OE/build/luneos-warrior/webos-ports/tmp-glibc/work/aarch64-webos-linux/zlib/1.2.11-r0/recipe-sysroot&quot;</div></div><div><br></div><div>But</div><div>ARMPKGARCH=&quot;cortexa53&quot;<br></div><div><div><br></div><div># $TUNE_PKGARCH_32</div><div>#   set /OE/build/luneos-warrior/webos-ports/openembedded-core/meta/conf/machine/include/arm/arch-arm64.inc:29</div><div>#     &quot;${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}&quot;</div><div>TUNE_PKGARCH_32=&quot;cortexa53&quot;</div><div>#</div><div># $TUNE_PKGARCH_64</div><div>#   set /OE/build/luneos-warrior/webos-ports/openembedded-core/meta/conf/machine/include/arm/arch-arm64.inc:23</div><div>#     &quot;aarch64${ARMPKGSFX_ENDIAN_64}&quot;</div><div>TUNE_PKGARCH_64=&quot;aarch64&quot;</div></div><div><br></div><div><div>#   &quot;${@bb.utils.contains(&#39;TUNE_FEATURES&#39;, &#39;aarch64&#39;, &#39;${TUNE_PKGARCH_64}&#39;, &#39;${TUNE_PKGARCH_32}&#39; ,d)}&quot;</div><div>TUNE_PKGARCH=&quot;aarch64&quot;</div></div><div><br></div><div>so the packages built with -mcpu=cortex-a53+crc (and rpi overrides) end in the same TUNE_PKGARCH as other MACHINEs which include e.g.</div><div>conf/machine/include/arm/arch-arm64.inc and DEFAULTTUNE=&quot;aarch64&quot; which surprisingly uses aarch64 in both TUNE_PKGARCH_32/64:<br></div><div><br></div><div><div>#   &quot;${@bb.utils.contains(&#39;TUNE_FEATURES&#39;, &#39;aarch64&#39;, &#39;${TUNE_PKGARCH_64}&#39;, &#39;${TUNE_PKGARCH_32}&#39; ,d)}&quot;</div><div>TUNE_PKGARCH=&quot;aarch64&quot;</div><div>#</div><div># $TUNE_PKGARCH_32</div><div>#   set /OE/build/luneos-warrior/webos-ports/openembedded-core/meta/conf/machine/include/arm/arch-arm64.inc:29</div><div>#     &quot;${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}&quot;</div><div>TUNE_PKGARCH_32=&quot;aarch64&quot;</div><div>#</div><div># $TUNE_PKGARCH_64</div><div>#   set /OE/build/luneos-warrior/webos-ports/openembedded-core/meta/conf/machine/include/arm/arch-arm64.inc:23</div><div>#     &quot;aarch64${ARMPKGSFX_ENDIAN_64}&quot;</div><div>TUNE_PKGARCH_64=&quot;aarch64&quot;</div></div><div><br></div><div>Looks like aarch64 are even bigger mess than arm tunes already :/.</div></div></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 3, 2019 at 10:48 PM Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Apr 3, 2019 at 1:24 PM Adrian Bunk &lt;<a href="mailto:bunk@stusta.de" target="_blank">bunk@stusta.de</a>&gt; wrote:<br>
&gt; On Wed, Apr 03, 2019 at 12:29:29PM -0700, Andre McCurdy wrote:<br>
&gt; &gt; On Tue, Apr 2, 2019 at 11:23 PM Adrian Bunk &lt;<a href="mailto:bunk@stusta.de" target="_blank">bunk@stusta.de</a>&gt; wrote:<br>
&gt; &gt; &gt; On Tue, Apr 02, 2019 at 09:26:46PM +0100, Richard Purdie wrote:<br>
&gt; &gt; &gt; &gt;...<br>
&gt; &gt; &gt; &gt; &quot;armv4t&quot; is defined in the arm tune files to mean &quot;add -march=armv4t&quot;<br>
&gt; &gt; &gt; &gt; which is the convention used throughout all the tune files.<br>
&gt; &gt; &gt; &gt;...<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Unfortunately this is not true.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; OE has both armv7a and armv7at tunes.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; There is no armv7a without Thumb support,<br>
&gt; &gt; &gt; so no -march=armv7-at exists in gcc.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Both armv7a and armv7at tunes pass the same march to gcc,<br>
&gt; &gt; &gt; but [1] is not true:<br>
&gt; &gt; &gt;   Default to using the Thumb-2 instruction set for armv7a and above.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The hardware supports Thumb-2 in any case, the actual difference between<br>
&gt; &gt; &gt; the armv7a and armv7at OE tunes is whether OE tells the compiler to<br>
&gt; &gt; &gt; generate ARM or Thumb-2 code.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; OE has both armv6 and armv6t tunes.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; There is no armv6 without Thumb support<br>
&gt; &gt; &gt; so no -march=armv6t exists in gcc.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Some v6 support only Thumb-1 and some v6 support also Thumb-2,<br>
&gt; &gt; &gt; so what gcc does have is an -march=armv6t2.<br>
&gt; &gt; &gt; But OE lacks tunes for that.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; For matching the gcc options it would be correct to remove all<br>
&gt; &gt; &gt; armv6t and armv7at tunes that have no coresponding gcc options,<br>
&gt; &gt; &gt; and add armv6t2 tunes.<br>
&gt; &gt;<br>
&gt; &gt; Aligning the tuning options exposed via the machine config files to<br>
&gt; &gt; those supported by gcc seems like a worthy goal... but would be a big<br>
&gt; &gt; upheaval at this point.<br>
&gt; &gt;<br>
&gt; &gt; Note that the problem isn&#39;t specific to ARM. There are similar issues<br>
&gt; &gt; for x86, but there we seem happy to provide a very minimal abstraction<br>
&gt; &gt; with no attempt to track gcc. e.g. &quot;corei7&quot; hasn&#39;t been a documented<br>
&gt; &gt; -march option since gcc 4.8 and we (somewhat arbitrarily) map it to<br>
&gt; &gt; -march=nehalem to hide that fact from end users.<br>
&gt; &gt;<br>
&gt; &gt; So the high level question seems to be: should DEFAULTTUNE even<br>
&gt; &gt; attempt to provide a full featured mapping to the options provided by<br>
&gt; &gt; gcc? Are we happy to expose a limited subset without a 1:1 mapping for<br>
&gt; &gt; the options we do expose (current ARM approach) or is it better for<br>
&gt; &gt; DEFAULTTUNE to hide away all the complexity of the options provided by<br>
&gt; &gt; gcc (current x86 approach).<br>
&gt;<br>
&gt; The current 32bit ARM[1] approach seems to be an attempt<br>
&gt; of a 1:1 mapping.<br>
&gt;<br>
&gt; For ARMv8 it is already obvious that DEFAULTTUNE is not long-term<br>
&gt; maintainable, and duplicating all the gcc rules regarding feature<br>
&gt; flags[2] also sounds like a pointless exercise.<br>
&gt;<br>
&gt; What are actually the benefits of DEFAULTTUNE with all the tune files,<br>
&gt; compared to just let the user provide a string that is passed to -march?<br>
<br>
Restricting the user to a certain set of DEFAULTTUNE options means<br>
there will always be a valid mapping from DEFAULTTUNE to<br>
PACKAGE_EXTRA_ARCHS.<br>
<br>
If we let the user pass an arbitrary string to -march then we lose the<br>
ability to determine that (for example) it&#39;s safe for a<br>
&quot;armv7athf-vfpv3&quot; machine to pull from a &quot;armv7athf-vfpv3d16&quot; package<br>
feed.<br>
<br>
Whether or not anyone in the real world actually maintains a generic<br>
package feed and pulls from it from multiple machine specific builds<br>
(verses setting up separate package feeds for each DEFAULTTUNE they<br>
care about) would be an interesting question...<br>
<br>
&gt; cu<br>
&gt; Adrian<br>
&gt;<br>
&gt; [1] ARM &lt;= v7, not the differing 32bit ABI of ARMv8<br>
&gt; [2] example:<br>
&gt; &#39;fp16fml&#39;<br>
&gt;      Enable FP16 fmla extension.  This also enables FP16 extensions and<br>
&gt;      floating-point instructions.  This option is enabled by default for<br>
&gt;      &#39;-march=armv8.4-a&#39;.  Use of this option with architectures prior to<br>
&gt;      Armv8.2-A is not supported.<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt;        &quot;Is there not promise of rain?&quot; Ling Tan asked suddenly out<br>
&gt;         of the darkness. There had been need of rain for many days.<br>
&gt;        &quot;Only a promise,&quot; Lao Er said.<br>
&gt;                                        Pearl S. Buck - Dragon Seed<br>
&gt;<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>