Skip to contentSkip to conversation

qemuarm: should it really have TUNE_ARCH armv5te?

DISCUSSION Martin Jansa 6 participants 28 messages Sep 11, 2012 – Sep 22, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#1 lore raw
Quoted 11 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

CCing bluelightning because xscale is used in lot of meta-handheld machines:

Does this make sense?

OE @ ~/openembedded-core/meta/conf/machine/include $ diff -uNr tune-arm926*; diff -uNr tune-xscale.inc*

tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 renamed from tune-arm926ejs.inc 2012-09-11 15:45:47.958202057 +0200 +1 -1
@@ -8,4 +8,4 @@
 AVAILTUNES += "arm926ejs"
 TUNE_FEATURES_tune-arm926ejs = "${TUNE_FEATURES_tune-armv5te} arm926ejs"
 PACKAGE_EXTRA_ARCHS_tune-arm926ejs = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
-
+TUNE_PKGARCH_tune-arm926ejs = "armv5te-arm926ejs"
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +2 -0
@@ -8,10 +8,12 @@
 AVAILTUNES += "xscale"
 TUNE_FEATURES_tune-xscale = "${TUNE_FEATURES_tune-armv5te} xscale"
 PACKAGE_EXTRA_ARCHS_tune-xscale = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
+TUNE_PKGARCH_tune-xscale = "armv5te-xscale"
 
 AVAILTUNES += "xscale-be"
 TUNE_FEATURES_tune-xscale-be = "${TUNE_FEATURES_tune-armv5teb} xscale bigendian"
 PACKAGE_EXTRA_ARCHS_tune-xscale-be = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb}"
+TUNE_PKGARCH_tune-xscale-be = "armv5teb-xscale"
 
 # webkit-gtk has alignment issues with double instructions on armv5 so
 # disable them here
Quoted 27 lines

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw

Re: ARM-tuning -- was qemuarm: should it really have TUNE_ARCH armv5te?

Quoted 6 lines · Martin Jansa
Quoted 5 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

I argued this when we original did the work for the tunings, and I lost....

Quoted 3 lines
Quoted 3 lines

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

That is certainly my expectation. I'm not sure that the arm926ej-s can produce binaries that are -not- arm5te binaries -- as that seems to be the standard for what an armv5te is. The xscale on the other hand is capable of having different tuning parameters and had a few additional instructions. In the past I've generated a tuning simple called "xscale" that was compatible w/ armv5te. This way you could share non-optimized things, and go w/ xscale as necessary.

Quoted 10 lines
Quoted 1 line

Does qemuarm use oe-core as it's intended?

CCing bluelightning because xscale is used in lot of meta-handheld machines:

Does this make sense?

OE @ ~/openembedded-core/meta/conf/machine/include $ diff -uNr tune-arm926*; diff -uNr tune-xscale.inc*

tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 line 11

Quoted 5 lines
tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 renamed from tune-arm926ejs.inc 2012-09-11 15:45:47.958202057 +0200 +1 -1
@@ -8,4 +8,4 @@
  AVAILTUNES += "arm926ejs"
  TUNE_FEATURES_tune-arm926ejs = "${TUNE_FEATURES_tune-armv5te} arm926ejs"
  PACKAGE_EXTRA_ARCHS_tune-arm926ejs = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
-
+TUNE_PKGARCH_tune-arm926ejs = "armv5te-arm926ejs"

I'd suggest simply arm926ejs....

tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 line 11

Quoted 7 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +1 -0
@@ -8,10 +8,12 @@
  AVAILTUNES += "xscale"
  TUNE_FEATURES_tune-xscale = "${TUNE_FEATURES_tune-armv5te} xscale"
  PACKAGE_EXTRA_ARCHS_tune-xscale = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
+TUNE_PKGARCH_tune-xscale = "armv5te-xscale"

Again simplify to xscale

tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 line 16

Quoted 4 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +1 -0
  AVAILTUNES += "xscale-be"
  TUNE_FEATURES_tune-xscale-be = "${TUNE_FEATURES_tune-armv5teb} xscale bigendian"
  PACKAGE_EXTRA_ARCHS_tune-xscale-be = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb}"
+TUNE_PKGARCH_tune-xscale-be = "armv5teb-xscale"

And xscaleeb (or be)

--Mark

Quoted 40 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +0 -0
  # webkit-gtk has alignment issues with double instructions on armv5 so
  # disable them here
 
Quoted 25 lines

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
   stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
   stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
   basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
   Variable TUNE_CCARGS value changed from
   ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
   ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
   to
   ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
   ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}
Quoted 2 lines

--
Martin 'JaMa' Jansa jabber: [email protected]

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#3 lore raw

Re: ARM-tuning -- was qemuarm: should it really have TUNE_ARCH armv5te?

Quoted 14 lines · Mark Hatle
Quoted 6 lines · Martin Jansa
Quoted 5 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

I argued this when we original did the work for the tunings, and I lost....

Quoted 3 lines
Quoted 3 lines

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Quoted 6 lines

That is certainly my expectation. I'm not sure that the arm926ej-s can produce binaries that are -not- arm5te binaries -- as that seems to be the standard for what an armv5te is. The xscale on the other hand is capable of having different tuning parameters and had a few additional instructions. In the past I've generated a tuning simple called "xscale" that was compatible w/ armv5te. This way you could share non-optimized things, and go w/ xscale as necessary.

Few more comments I did on IRC:

16:41:23 < JaMa> let's hope RP will comment on that as that was his comment I was copy&pasting
16:41:53 < JaMa> e.g. ppc seems to set TUNE_PKGARCH for each tune-*
16:44:24 < JaMa> but it would be better to set xscale/arm926 tune only for packages where such -mtune brings some speedup (and for those where we set PACKAGE_ARCH = MACHINE_ARCH already) and build the rest only with -march 16:45:36 < JaMa> but mixed feed and -mtune=xscale packages on arm926 targets looks like worst case
16:50:20 < JaMa> oe-classic had the same issue with mixed -mtune in package arch feeds, but at least it wasn't rebuilding them after each machine switch

And I'm not sure where we could decide what's worth -mtune and what is not, because in recipe we can do it only with a lot of _arch overrides and in tune file with lot of _pn-foo overrides (and some could be also in other layers then oe-core etc.)

But it would be nice to share most packages as "general" armv5te between e.g. spitz and qemuarm builds.

Cheers,

Quoted 84 lines
Quoted 11 lines
Quoted 2 lines

Does qemuarm use oe-core as it's intended?

CCing bluelightning because xscale is used in lot of meta-handheld machines:

Does this make sense?

OE @ ~/openembedded-core/meta/conf/machine/include $ diff -uNr tune-arm926*; diff -uNr tune-xscale.inc*

tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 line 11

Quoted 5 lines
tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 renamed from tune-arm926ejs.inc 2012-09-11 15:45:47.958202057 +0200 +1 -1
@@ -8,4 +8,4 @@
  AVAILTUNES += "arm926ejs"
  TUNE_FEATURES_tune-arm926ejs = "${TUNE_FEATURES_tune-armv5te} arm926ejs"
  PACKAGE_EXTRA_ARCHS_tune-arm926ejs = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
-
+TUNE_PKGARCH_tune-arm926ejs = "armv5te-arm926ejs"

I'd suggest simply arm926ejs....

tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 line 11

Quoted 7 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +1 -0
@@ -8,10 +8,12 @@
  AVAILTUNES += "xscale"
  TUNE_FEATURES_tune-xscale = "${TUNE_FEATURES_tune-armv5te} xscale"
  PACKAGE_EXTRA_ARCHS_tune-xscale = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
+TUNE_PKGARCH_tune-xscale = "armv5te-xscale"

Again simplify to xscale

tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 line 16

Quoted 4 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +1 -0
  AVAILTUNES += "xscale-be"
  TUNE_FEATURES_tune-xscale-be = "${TUNE_FEATURES_tune-armv5teb} xscale bigendian"
  PACKAGE_EXTRA_ARCHS_tune-xscale-be = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb}"
+TUNE_PKGARCH_tune-xscale-be = "armv5teb-xscale"

And xscaleeb (or be)

--Mark

Quoted 35 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +0 -0
  # webkit-gtk has alignment issues with double instructions on armv5 so
  # disable them here
 
Quoted 25 lines

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
   stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
   stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
   basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
   Variable TUNE_CCARGS value changed from
   ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
   ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
   to
   ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
   ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}
Quoted 2 lines

--
Martin 'JaMa' Jansa jabber: [email protected]

Quoted 5 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#4 lore raw

Re: ARM-tuning -- was qemuarm: should it really have TUNE_ARCH armv5te?

Quoted 30 lines · Martin Jansa
Quoted 14 lines · Mark Hatle
Quoted 6 lines · Martin Jansa
Quoted 5 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

I argued this when we original did the work for the tunings, and I lost....

Quoted 3 lines
Quoted 3 lines

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Quoted 6 lines

That is certainly my expectation. I'm not sure that the arm926ej-s can produce binaries that are -not- arm5te binaries -- as that seems to be the standard for what an armv5te is. The xscale on the other hand is capable of having different tuning parameters and had a few additional instructions. In the past I've generated a tuning simple called "xscale" that was compatible w/ armv5te. This way you could share non-optimized things, and go w/ xscale as necessary.

Few more comments I did on IRC:

16:41:23 < JaMa> let's hope RP will comment on that as that was his comment I was copy&pasting
16:41:53 < JaMa> e.g. ppc seems to set TUNE_PKGARCH for each tune-*
16:44:24 < JaMa> but it would be better to set xscale/arm926 tune only for packages where such -mtune brings some speedup (and for those where we set PACKAGE_ARCH = MACHINE_ARCH already) and build the rest only with -march 16:45:36 < JaMa> but mixed feed and -mtune=xscale packages on arm926 targets looks like worst case
16:50:20 < JaMa> oe-classic had the same issue with mixed -mtune in package arch feeds, but at least it wasn't rebuilding them after each machine switch

Quoted 5 lines

And I'm not sure where we could decide what's worth -mtune and what is not, because in recipe we can do it only with a lot of _arch overrides and in tune file with lot of _pn-foo overrides (and some could be also in other layers then oe-core etc.)

But it would be nice to share most packages as "general" armv5te between e.g. spitz and qemuarm builds.

This really hints that defining the tunings become a distribution configuration.

You should be able to do:

DEFAULTTUNE_pn-openssl = "xscale"

To enable just openssl benefits from the xscale tunings. (The pn- may not be needed.. I can never remember anymore...) But that was the original idea with the tunings, make a way to specify DEFAULTTUNE for various things when alternative, but compatible tunings made a difference... set that in the distro.conf and you have an optimized distribution for specific uses. (You of course could also move that to a machine setting or similar file.)

--Mark

Quoted 87 lines

Cheers,

Quoted 84 lines
Quoted 11 lines
Quoted 2 lines

Does qemuarm use oe-core as it's intended?

CCing bluelightning because xscale is used in lot of meta-handheld machines:

Does this make sense?

OE @ ~/openembedded-core/meta/conf/machine/include $ diff -uNr tune-arm926*; diff -uNr tune-xscale.inc*

tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 line 11

Quoted 5 lines
tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 renamed from tune-arm926ejs.inc 2012-09-11 15:45:47.958202057 +0200 +1 -1
@@ -8,4 +8,4 @@
   AVAILTUNES += "arm926ejs"
   TUNE_FEATURES_tune-arm926ejs = "${TUNE_FEATURES_tune-armv5te} arm926ejs"
   PACKAGE_EXTRA_ARCHS_tune-arm926ejs = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
-
+TUNE_PKGARCH_tune-arm926ejs = "armv5te-arm926ejs"

I'd suggest simply arm926ejs....

tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 line 11

Quoted 7 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +1 -0
@@ -8,10 +8,12 @@
   AVAILTUNES += "xscale"
   TUNE_FEATURES_tune-xscale = "${TUNE_FEATURES_tune-armv5te} xscale"
   PACKAGE_EXTRA_ARCHS_tune-xscale = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
+TUNE_PKGARCH_tune-xscale = "armv5te-xscale"

Again simplify to xscale

tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 line 16

Quoted 4 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +1 -0
   AVAILTUNES += "xscale-be"
   TUNE_FEATURES_tune-xscale-be = "${TUNE_FEATURES_tune-armv5teb} xscale bigendian"
   PACKAGE_EXTRA_ARCHS_tune-xscale-be = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb}"
+TUNE_PKGARCH_tune-xscale-be = "armv5teb-xscale"

And xscaleeb (or be)

--Mark

Quoted 35 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +0 -0
   # webkit-gtk has alignment issues with double instructions on armv5 so
   # disable them here
 
Quoted 25 lines

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
    stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
    stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
    basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
    Variable TUNE_CCARGS value changed from
    ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
    ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
    to
    ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
    ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}
Quoted 2 lines

--
Martin 'JaMa' Jansa jabber: [email protected]

Quoted 5 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#5 lore raw

Re: ARM-tuning -- was qemuarm: should it really have TUNE_ARCH armv5te?

Quoted 35 lines · Mark Hatle
Quoted 34 lines · Martin Jansa
Quoted 14 lines · Mark Hatle
Quoted 6 lines · Martin Jansa
Quoted 5 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

I argued this when we original did the work for the tunings, and I lost....

Quoted 3 lines
Quoted 3 lines

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Quoted 6 lines

That is certainly my expectation. I'm not sure that the arm926ej-s can produce binaries that are -not- arm5te binaries -- as that seems to be the standard for what an armv5te is. The xscale on the other hand is capable of having different tuning parameters and had a few additional instructions. In the past I've generated a tuning simple called "xscale" that was compatible w/ armv5te. This way you could share non-optimized things, and go w/ xscale as necessary.

Few more comments I did on IRC:

16:41:23 < JaMa> let's hope RP will comment on that as that was his comment I was copy&pasting
16:41:53 < JaMa> e.g. ppc seems to set TUNE_PKGARCH for each tune-*
16:44:24 < JaMa> but it would be better to set xscale/arm926 tune only for packages where such -mtune brings some speedup (and for those where we set PACKAGE_ARCH = MACHINE_ARCH already) and build the rest only with -march 16:45:36 < JaMa> but mixed feed and -mtune=xscale packages on arm926 targets looks like worst case
16:50:20 < JaMa> oe-classic had the same issue with mixed -mtune in package arch feeds, but at least it wasn't rebuilding them after each machine switch

And I'm not sure where we could decide what's worth -mtune and what is not, because in recipe we can do it only with a lot of _arch overrides and in tune file with lot of _pn-foo overrides (and some could be also in other layers then oe-core etc.)

Quoted 7 lines
Quoted 1 line

But it would be nice to share most packages as "general" armv5te between e.g. spitz and qemuarm builds.

This really hints that defining the tunings become a distribution configuration.

You should be able to do:

DEFAULTTUNE_pn-openssl = "xscale"

Where? in some distro config? What after I switch machine to some armv7a machine? (that's why I said a lot of _arch overrides)

something like:

# to set only armv5te as default (for most PN)
DEFAULTTUNE_armv5te = "armv5te"
# then use "optimized" DEFAULTTUNE where it's worth
DEFAULTTUNE_pn-openssl_spitz = "xscale"
DEFAULTTUNE_pn-openssl_mycorei7 = "corei7"

But that sucks because I have to list all MACHINES which have some "optimized" DEFAULTTUNE.

What about something like this:
bitbake.conf:
OPTDEFAULTTUNE ??= "${DEFAULTTUNE}"

conf/machine/include/tune-xscale.inc:
-DEFAULTTUNE ?= "xscale"
+OPTDEFAULTTUNE ?= "xscale"

conf/machine/include/tune-arm926ejs.inc
-DEFAULTTUNE ?= "arm926ejs"
+OPTDEFAULTTUNE ?= "arm926ejs"

conf/distro/include/opt-default-tune.inc:
DEFAULTTUNE_pn-openssl = ${OPTDEFAULTTUNE}
DEFAULTTUNE_pn-mplayer = ${OPTDEFAULTTUNE}

That would be easier to manage I guess.

Quoted 98 lines

To enable just openssl benefits from the xscale tunings. (The pn- may not be needed.. I can never remember anymore...) But that was the original idea with the tunings, make a way to specify DEFAULTTUNE for various things when alternative, but compatible tunings made a difference... set that in the distro.conf and you have an optimized distribution for specific uses. (You of course could also move that to a machine setting or similar file.)

--Mark

Quoted 87 lines

Cheers,

Quoted 84 lines
Quoted 11 lines
Quoted 2 lines

Does qemuarm use oe-core as it's intended?

CCing bluelightning because xscale is used in lot of meta-handheld machines:

Does this make sense?

OE @ ~/openembedded-core/meta/conf/machine/include $ diff -uNr tune-arm926*; diff -uNr tune-xscale.inc*

tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 line 11

Quoted 5 lines
tune-arm926ejs.inc.new 2012-09-11 15:45:40.579194777 +0200 renamed from tune-arm926ejs.inc 2012-09-11 15:45:47.958202057 +0200 +1 -1
@@ -8,4 +8,4 @@
   AVAILTUNES += "arm926ejs"
   TUNE_FEATURES_tune-arm926ejs = "${TUNE_FEATURES_tune-armv5te} arm926ejs"
   PACKAGE_EXTRA_ARCHS_tune-arm926ejs = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
-
+TUNE_PKGARCH_tune-arm926ejs = "armv5te-arm926ejs"

I'd suggest simply arm926ejs....

tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 line 11

Quoted 7 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +1 -0
@@ -8,10 +8,12 @@
   AVAILTUNES += "xscale"
   TUNE_FEATURES_tune-xscale = "${TUNE_FEATURES_tune-armv5te} xscale"
   PACKAGE_EXTRA_ARCHS_tune-xscale = "${PACKAGE_EXTRA_ARCHS_tune-armv5te}"
+TUNE_PKGARCH_tune-xscale = "armv5te-xscale"

Again simplify to xscale

tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 line 16

Quoted 4 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +1 -0
   AVAILTUNES += "xscale-be"
   TUNE_FEATURES_tune-xscale-be = "${TUNE_FEATURES_tune-armv5teb} xscale bigendian"
   PACKAGE_EXTRA_ARCHS_tune-xscale-be = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb}"
+TUNE_PKGARCH_tune-xscale-be = "armv5teb-xscale"

And xscaleeb (or be)

--Mark

Quoted 35 lines
tune-xscale.inc.new 2012-09-11 15:43:24.560060591 +0200 renamed from tune-xscale.inc 2012-08-28 11:01:04.899070433 +0200 +0 -0
   # webkit-gtk has alignment issues with double instructions on armv5 so
   # disable them here
 
Quoted 25 lines

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
    stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
    stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
    basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
    Variable TUNE_CCARGS value changed from
    ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
    ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
    to
    ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
    ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
    ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}
Quoted 2 lines

--
Martin 'JaMa' Jansa jabber: [email protected]

Quoted 5 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#6 lore raw

Re: ARM-tuning -- was qemuarm: should it really have TUNE_ARCH armv5te?

In reply to Mark Hatle

Op 11 sep. 2012, om 17:51 heeft Mark Hatle <[email protected]> het volgende geschreven:

Quoted 8 lines · Martin Jansa
Quoted 6 lines · Martin Jansa
Quoted 5 lines

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

Quoted 7 lines

I argued this when we original did the work for the tunings, and I lost....

Quoted 3 lines
Quoted 3 lines

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

That is certainly my expectation. I'm not sure that the arm926ej-s can produce binaries that are -not- arm5te binaries -- as that seems to be the standard for what an armv5te is. The xscale on the other hand is capable of having different tuning parameters and had a few additional instructions.

From a gcc point of view both are the same ISA, but using xscale will take in account the absurdly long pipeline on that SoC.

#7 lore raw

Re: ARM-tuning -- was qemuarm: should it really have TUNE_ARCH armv5te?

Quoted 1 line · Koen Kooi

From a gcc point of view both are the same ISA, but using xscale will take in account the absurdly long pipeline on that SoC.

Not really, when you tune for XScale it will use ldrd/strd and pld if possible

#8 lore raw

Re: ARM-tuning -- was qemuarm: should it really have TUNE_ARCH armv5te?

Quoted 4 lines · Khem Raj
Quoted 1 line · Koen Kooi

From a gcc point of view both are the same ISA, but using xscale will take in account the absurdly long pipeline on that SoC.

Not really, when you tune for XScale it will use ldrd/strd and pld if possible

Are you sure? As far as I remember, the only effects of -mtune=xscale are to alter some minor pipeline-related tradeoffs in code generation. In particular, LDM is especially slow on xscale so it is usually best avoided unless loading very large numbers of registers.

I can't think of any reason why pld would be any more beneficial on xscale than generic v5TE, and I don't think gcc does anything special with it in that regard.

p.

#9 lore raw

Re: ARM-tuning -- was qemuarm: should it really have TUNE_ARCH armv5te?

Quoted 10 lines · Phil Blundell
Quoted 4 lines · Khem Raj
Quoted 1 line · Koen Kooi

From a gcc point of view both are the same ISA, but using xscale will take in account the absurdly long pipeline on that SoC.

Not really, when you tune for XScale it will use ldrd/strd and pld if possible

Are you sure? As far as I remember, the only effects of -mtune=xscale are to alter some minor pipeline-related tradeoffs in code generation. In particular, LDM is especially slow on xscale so it is usually best avoided unless loading very large numbers of registers.

yes that seems to be right looking at trunk and it does not prefer LDRD/STRD/PLD too. so all my claims are not valid anymore.

const struct tune_params arm_xscale_tune =
{
arm_xscale_rtx_costs,
xscale_sched_adjust_cost,

  2,                                            /* Constant limit.  */
  3,                                            /* Max cond insns.  */

ARM_PREFETCH_NOT_BENEFICIAL,
true, /* Prefer constant pool. */
arm_default_branch_cost,
false /* Prefer LDRD/STRD. */
};

Quoted 8 lines

I can't think of any reason why pld would be any more beneficial on xscale than generic v5TE, and I don't think gcc does anything special with it in that regard.

p.

Signature · 1 line
-Khem
#10 lore raw
In reply to Martin Jansa
Quoted 1 line · Martin Jansa

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs?

That's a DISTRO policy decision really.

"armv5te", in common with most of the PACKAGE_ARCHes, represents an ISA. That is, it is guaranteed to only contain instructions which are supported by all v5TE cores (which includes both ARM926EJ-S and XScale). It obviously follows from this that packages with PACKAGE_ARCH=armv5te are suitable for running on both qemuarm and xscale MACHINEs.

Note that a binary that was built with -mtune=arm926ej-s is still an ARMv5TE binary and will run just fine on xscale. It won't run quite as fast as one that was built -mtune=xscale, though the performance difference is not so great as to be completely crippling. With current gcc, the reverse is true as well: a binary built -mtune=xscale is also still ARMv5TE and will run just fine on ARM926EJ-S, and in fact the performance penalty is less this way around.

Now, if your DISTRO feels that the performance difference is important enough to be worth distinguishing the packages, you can certainly arrange for those two tunings to get separate PACKAGE_ARCHes and maintain parallel feeds. But in the general case it's not totally obvious that this would be worthwhile, and I'm not sure it is a very useful thing to do by default.

p.

#11 lore raw
Quoted 19 lines · Phil Blundell
Quoted 1 line · Martin Jansa

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs?

That's a DISTRO policy decision really.

"armv5te", in common with most of the PACKAGE_ARCHes, represents an ISA. That is, it is guaranteed to only contain instructions which are supported by all v5TE cores (which includes both ARM926EJ-S and XScale). It obviously follows from this that packages with PACKAGE_ARCH=armv5te are suitable for running on both qemuarm and xscale MACHINEs.

Note that a binary that was built with -mtune=arm926ej-s is still an ARMv5TE binary and will run just fine on xscale. It won't run quite as fast as one that was built -mtune=xscale, though the performance difference is not so great as to be completely crippling. With current gcc, the reverse is true as well: a binary built -mtune=xscale is also still ARMv5TE and will run just fine on ARM926EJ-S, and in fact the performance penalty is less this way around.

Quoted 6 lines

Now, if your DISTRO feels that the performance difference is important enough to be worth distinguishing the packages, you can certainly arrange for those two tunings to get separate PACKAGE_ARCHes and maintain parallel feeds. But in the general case it's not totally obvious that this would be worthwhile, and I'm not sure it is a very useful thing to do by default.

But that is default now, that's why I've started this thread.

It uses PACKAGE_ARCH=armv5te while using -mtune. Causing different sstate checksums and rebuilds when you switch e.g. qemuarm and spitz.

If we drop DEFAULTTUNE from tune-xscale and tune-arm926ejs then PACKAGE_ARCH=armv5te would be the same and the same feed will be built only once.

And if DISTO feels that the performance difference is important then something like OPTDEFAULTTUNE could be added:
http://lists.linuxtogo.org/pipermail/openembedded-core/2012-September/029455.html

Cheers,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#12 lore raw
Quoted 3 lines · Martin Jansa

If we drop DEFAULTTUNE from tune-xscale and tune-arm926ejs then PACKAGE_ARCH=armv5te would be the same and the same feed will be built only once.

Well, that would also make those two tune files rather useless. It seems like it would be better to just refrain from including them if you don't want the corresponding tunings.

p.

#13 lore raw
Quoted 8 lines · Phil Blundell
Quoted 3 lines · Martin Jansa

If we drop DEFAULTTUNE from tune-xscale and tune-arm926ejs then PACKAGE_ARCH=armv5te would be the same and the same feed will be built only once.

Well, that would also make those two tune files rather useless. It seems like it would be better to just refrain from including them if you don't want the corresponding tunings.

But that does not allow me to still use it for few packages if my DISTRO decides it's worth it.

I'll test tomorrow, something like top 3 patches here:
http://git.openembedded.org/openembedded-core-contrib/log/?h=jansa/tune

Cheers,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#14 lore raw
Quoted 10 lines · Martin Jansa
Quoted 8 lines · Phil Blundell
Quoted 3 lines · Martin Jansa

If we drop DEFAULTTUNE from tune-xscale and tune-arm926ejs then PACKAGE_ARCH=armv5te would be the same and the same feed will be built only once.

Well, that would also make those two tune files rather useless. It seems like it would be better to just refrain from including them if you don't want the corresponding tunings.

Quoted 5 lines

But that does not allow me to still use it for few packages if my DISTRO decides it's worth it.

I'll test tomorrow, something like top 3 patches here:
http://git.openembedded.org/openembedded-core-contrib/log/?h=jansa/tune

If this works then DISTRO would have finer control of which DEFAULTTUNE to use

1) default: don't use mtune, optimize only for march (don't mix mtune in the same feed).

2) include optimized-tune.inc in distro.conf: use mtune only for some packages, but with separate package feed for them

3) DEFAULTTUNE = ${OPTDEFAULTTUNE} in distro.conf: always use best mtune available for MACHINE, but unlike current default, don't mix them in same package feed

DEFAULTTUNE = ${OPTDEFAULTTUNE} should also be used for PACKAGE_ARCH == MACHINE_ARCH

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#15 lore raw
Quoted 9 lines · Martin Jansa

If this works then DISTRO would have finer control of which DEFAULTTUNE to use

1) default: don't use mtune, optimize only for march (don't mix mtune in the same feed).

2) include optimized-tune.inc in distro.conf: use mtune only for some packages, but with separate package feed for them

Quoted 6 lines

3) DEFAULTTUNE = ${OPTDEFAULTTUNE} in distro.conf: always use best mtune available for MACHINE, but unlike current default, don't mix them in same package feed

DEFAULTTUNE = ${OPTDEFAULTTUNE} should also be used for PACKAGE_ARCH == MACHINE_ARCH

Yeah, that all sounds fairly reasonable to me. I'm not sure that optimized-tune.inc belongs in oe-core, since its contents is inherently distro-specific, but the general plan seems pretty good.

p.

#16 lore raw
Quoted 14 lines · Phil Blundell
Quoted 13 lines · Martin Jansa

If this works then DISTRO would have finer control of which DEFAULTTUNE to use

1) default: don't use mtune, optimize only for march (don't mix mtune in the same feed).

2) include optimized-tune.inc in distro.conf: use mtune only for some packages, but with separate package feed for them

3) DEFAULTTUNE = ${OPTDEFAULTTUNE} in distro.conf: always use best mtune available for MACHINE, but unlike current default, don't mix them in same package feed

Quoted 6 lines
Quoted 2 lines

DEFAULTTUNE = ${OPTDEFAULTTUNE} should also be used for PACKAGE_ARCH == MACHINE_ARCH

Yeah, that all sounds fairly reasonable to me. I'm not sure that optimized-tune.inc belongs in oe-core, since its contents is inherently distro-specific, but the general plan seems pretty good.

OK, thanks

I've put optimized-tune.inc to oe-core only to share knowledge of which packages are worth using OPTDEFAULTTUNE, but I expect DISTRO maintainers to add their own entries too (e.g. for stuff which is only in their own layer), so I'm fine with optimized-tune.inc in meta-distro too.

Cheers,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#17 lore raw
Quoted 22 lines · Martin Jansa
Quoted 14 lines · Phil Blundell
Quoted 13 lines · Martin Jansa

If this works then DISTRO would have finer control of which DEFAULTTUNE to use

1) default: don't use mtune, optimize only for march (don't mix mtune in the same feed).

2) include optimized-tune.inc in distro.conf: use mtune only for some packages, but with separate package feed for them

3) DEFAULTTUNE = ${OPTDEFAULTTUNE} in distro.conf: always use best mtune available for MACHINE, but unlike current default, don't mix them in same package feed

Quoted 6 lines
Quoted 2 lines

DEFAULTTUNE = ${OPTDEFAULTTUNE} should also be used for PACKAGE_ARCH == MACHINE_ARCH

Yeah, that all sounds fairly reasonable to me. I'm not sure that optimized-tune.inc belongs in oe-core, since its contents is inherently distro-specific, but the general plan seems pretty good.

Quoted 6 lines

OK, thanks

I've put optimized-tune.inc to oe-core only to share knowledge of which packages are worth using OPTDEFAULTTUNE, but I expect DISTRO maintainers to add their own entries too (e.g. for stuff which is only in their own layer), so I'm fine with optimized-tune.inc in meta-distro too.

Along those lines.. I'm always asked for optimized crypto libraries (nss, openssl, beecrypt, etc...), database (mysql or similar), codecs, sometimes libc itself, and graphics drivers.. otherwise nobody seems to care if it's "good enough".

--Mark

Quoted 9 lines

Cheers,

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#18 lore raw
In reply to Martin Jansa
Quoted 35 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
Quoted 9 lines
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}

This is a tricky one. As others have mentioned, this is a tune parameter, not an arch one and as such the binaries are compatible with each other although they potentially are compiled differently with different optimisations.

As such, mixing the feeds is permitted and will not cause any real world usage problem. As you point out, sstate is much more sensitive to this kind of change and is correctly deciding the output is different though.

I think my preferred approach would be to have the tune files do something like:

-mtune=${ARMV5TEDEFAULTTUNE}

and then the user can set ARMV5DEFAULTTUNE to whatever the believe is a appropriate. This would result in the package feed at least having a consistent state of one tune and sstate would be happy. It then becomes a distro policy decision which is what it should be. ARMV5TEDEFAULTTUNE would default to the current values meaning the distro would then just do:

ARMV5TEDEFAULTTUNE_poky = "xscale"

and hence make their decision. Of course the distro could also decide to split the package architectures up which is equally fine.

Does something like that sound like it would work?

Cheers,

Richard

#19 lore raw
Quoted 67 lines · Richard Purdie
Quoted 35 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
Quoted 9 lines
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}

This is a tricky one. As others have mentioned, this is a tune parameter, not an arch one and as such the binaries are compatible with each other although they potentially are compiled differently with different optimisations.

As such, mixing the feeds is permitted and will not cause any real world usage problem. As you point out, sstate is much more sensitive to this kind of change and is correctly deciding the output is different though.

I think my preferred approach would be to have the tune files do something like:

-mtune=${ARMV5TEDEFAULTTUNE}

and then the user can set ARMV5DEFAULTTUNE to whatever the believe is a appropriate. This would result in the package feed at least having a consistent state of one tune and sstate would be happy. It then becomes a distro policy decision which is what it should be. ARMV5TEDEFAULTTUNE would default to the current values meaning the distro would then just do:

Quoted 6 lines

ARMV5TEDEFAULTTUNE_poky = "xscale"

and hence make their decision. Of course the distro could also decide to split the package architectures up which is equally fine.

Does something like that sound like it would work?

My solution seems to be a bit more flexible then this.

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#20 lore raw
Quoted 68 lines · Martin Jansa
Quoted 67 lines · Richard Purdie
Quoted 35 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
Quoted 9 lines
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}

This is a tricky one. As others have mentioned, this is a tune parameter, not an arch one and as such the binaries are compatible with each other although they potentially are compiled differently with different optimisations.

As such, mixing the feeds is permitted and will not cause any real world usage problem. As you point out, sstate is much more sensitive to this kind of change and is correctly deciding the output is different though.

I think my preferred approach would be to have the tune files do something like:

-mtune=${ARMV5TEDEFAULTTUNE}

and then the user can set ARMV5DEFAULTTUNE to whatever the believe is a appropriate. This would result in the package feed at least having a consistent state of one tune and sstate would be happy. It then becomes a distro policy decision which is what it should be. ARMV5TEDEFAULTTUNE would default to the current values meaning the distro would then just do:

Quoted 8 lines
Quoted 6 lines

ARMV5TEDEFAULTTUNE_poky = "xscale"

and hence make their decision. Of course the distro could also decide to split the package architectures up which is equally fine.

Does something like that sound like it would work?

My solution seems to be a bit more flexible then this.

Which cases does it enable which the above doesn't?

I'm a little worried about adding more indirection to the DEFAULTTUNE variable itself since the whole tune situation is already convoluted and indirected enough without adding another level of it :/. That variable is the one exposed to the user straight away, not hidden more behind the scenes.

Taking a step back and looking at the APIs I'm really not very happy with the usability of them already and I don't think this helps.

Someone commented about the ppc situation and I was told that there, the binaries are incompatible with each other. It is more unusual to have situations where there are micro-optimisations through -mtune yet the binaries remain compatible.

Cheers,

Richard

#21 lore raw
Quoted 71 lines · Richard Purdie
Quoted 70 lines · Martin Jansa
Quoted 69 lines · Richard Purdie
Quoted 35 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
Quoted 9 lines
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}

This is a tricky one. As others have mentioned, this is a tune parameter, not an arch one and as such the binaries are compatible with each other although they potentially are compiled differently with different optimisations.

As such, mixing the feeds is permitted and will not cause any real world usage problem. As you point out, sstate is much more sensitive to this kind of change and is correctly deciding the output is different though.

I think my preferred approach would be to have the tune files do something like:

-mtune=${ARMV5TEDEFAULTTUNE}

and then the user can set ARMV5DEFAULTTUNE to whatever the believe is a appropriate. This would result in the package feed at least having a consistent state of one tune and sstate would be happy. It then becomes a distro policy decision which is what it should be. ARMV5TEDEFAULTTUNE would default to the current values meaning the distro would then just do:

ARMV5TEDEFAULTTUNE_poky = "xscale"

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

and hence make their decision. Of course the distro could also decide to split the package architectures up which is equally fine.

Does something like that sound like it would work?

My solution seems to be a bit more flexible then this.

Which cases does it enable which the above doesn't?

To have separate binary feeds for some packages while keeping most of other packages in armv5te feed without any -mtune or with some ARMV5TEDEFAULTTUNE.

But -mtune=${ARMV5TEDEFAULTTUNE} in tune-arm926ejs.inc with xscale value set through ARMV5TEDEFAULTTUNE_disto doesn't look very intuitive.

And how many .*DEFAUTTUNE variables distro should set?

Anyway I'll be off for next 10 days or so..

Quoted 19 lines

I'm a little worried about adding more indirection to the DEFAULTTUNE variable itself since the whole tune situation is already convoluted and indirected enough without adding another level of it :/. That variable is the one exposed to the user straight away, not hidden more behind the scenes.

Taking a step back and looking at the APIs I'm really not very happy with the usability of them already and I don't think this helps.

Someone commented about the ppc situation and I was told that there, the binaries are incompatible with each other. It is more unusual to have situations where there are micro-optimisations through -mtune yet the binaries remain compatible.

Cheers,

Richard

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#22 lore raw
Quoted 77 lines · Martin Jansa
Quoted 76 lines · Richard Purdie
Quoted 75 lines · Martin Jansa
Quoted 73 lines · Richard Purdie
Quoted 35 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
Quoted 9 lines
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}

This is a tricky one. As others have mentioned, this is a tune parameter, not an arch one and as such the binaries are compatible with each other although they potentially are compiled differently with different optimisations.

As such, mixing the feeds is permitted and will not cause any real world usage problem. As you point out, sstate is much more sensitive to this kind of change and is correctly deciding the output is different though.

I think my preferred approach would be to have the tune files do something like:

-mtune=${ARMV5TEDEFAULTTUNE}

and then the user can set ARMV5DEFAULTTUNE to whatever the believe is a appropriate. This would result in the package feed at least having a consistent state of one tune and sstate would be happy. It then becomes a distro policy decision which is what it should be. ARMV5TEDEFAULTTUNE would default to the current values meaning the distro would then just do:

ARMV5TEDEFAULTTUNE_poky = "xscale"

and hence make their decision. Of course the distro could also decide to split the package architectures up which is equally fine.

Does something like that sound like it would work?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

My solution seems to be a bit more flexible then this.

Which cases does it enable which the above doesn't?

To have separate binary feeds for some packages while keeping most of other packages in armv5te feed without any -mtune or with some ARMV5TEDEFAULTTUNE.

Firstly, lets clearly define what the problems are. We want to have some packages with the existing tune in separate feeds and have other packages sharing (or have no) mtune values?

The reason I say that is that initially this looked like a problem with sstate and the specific mtune values which is a relatively generic and widespread issue. The problem described above is implementation of what is very specific distro policy. I want to be clear about which problem(s) we're solving as that is leading to confusion discussing it.

If the problem(s) we're solving are the distro feed one rather than sstate, the problem is more specific the distro policy and I'd expect the distro itself to be handling this and not the core.

Quoted 3 lines

But -mtune=${ARMV5TEDEFAULTTUNE} in tune-arm926ejs.inc with xscale value set through ARMV5TEDEFAULTTUNE_disto doesn't look very intuitive.

I'm not saying that it is. What I'm saying is that it puts the pain in the place of the person trying to do the deep configuration and isn't the first thing a new user hits and struggles with.

We can add variables for *everything*. That doesn't mean that we should and this is one case that I think the proposal complicates something that is already too complicated, badly (under) documented and being misused (see the number of patches I've seen recently abusing DEFAULTTUNE).

At least if the tune files and system was well documented I might feel better about things but right now it isn't.

Quoted 1 line

And how many .*DEFAUTTUNE variables distro should set?

As soon as you enter the world of recipe specific tunings, I suspect a number of variables are going to need to get set.

Cheers,

Richard

#23 lore raw
Quoted 82 lines · Richard Purdie
Quoted 81 lines · Martin Jansa
Quoted 79 lines · Richard Purdie
Quoted 68 lines · Martin Jansa
Quoted 67 lines · Richard Purdie
Quoted 35 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
Quoted 9 lines
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}

This is a tricky one. As others have mentioned, this is a tune parameter, not an arch one and as such the binaries are compatible with each other although they potentially are compiled differently with different optimisations.

As such, mixing the feeds is permitted and will not cause any real world usage problem. As you point out, sstate is much more sensitive to this kind of change and is correctly deciding the output is different though.

I think my preferred approach would be to have the tune files do something like:

-mtune=${ARMV5TEDEFAULTTUNE}

and then the user can set ARMV5DEFAULTTUNE to whatever the believe is a appropriate. This would result in the package feed at least having a consistent state of one tune and sstate would be happy. It then becomes a distro policy decision which is what it should be. ARMV5TEDEFAULTTUNE would default to the current values meaning the distro would then just do:

Quoted 8 lines
Quoted 6 lines

ARMV5TEDEFAULTTUNE_poky = "xscale"

and hence make their decision. Of course the distro could also decide to split the package architectures up which is equally fine.

Does something like that sound like it would work?

My solution seems to be a bit more flexible then this.

Which cases does it enable which the above doesn't?

Quoted 7 lines
Quoted 3 lines

To have separate binary feeds for some packages while keeping most of other packages in armv5te feed without any -mtune or with some ARMV5TEDEFAULTTUNE.

Firstly, lets clearly define what the problems are. We want to have some packages with the existing tune in separate feeds and have other packages sharing (or have no) mtune values?

The proble is, that tune-cpu.inc files sets different -mcpu while keeping the same PACKAGE_ARCH (first commit in my brach)

Quoted 5 lines

The reason I say that is that initially this looked like a problem with sstate and the specific mtune values which is a relatively generic and widespread issue. The problem described above is implementation of what is very specific distro policy. I want to be clear about which problem(s) we're solving as that is leading to confusion discussing it.

sstate is "correctly" detecting -mcpu change and rebuild all packages with new mcpu, but resulting ipk are in the same arch -> user wont see which -mcpu was used to buld particular .ipk.

Quoted 3 lines

If the problem(s) we're solving are the distro feed one rather than sstate, the problem is more specific the distro policy and I'd expect the distro itself to be handling this and not the core.

If I add those PACKAGE_ARCH setting to each tune* which sets new DEFAULTUNE them some distributions can see it as regression as e.g. xscale and arm926ejs feed will need twice as much space as now shared armv5te.

Removin tune-cpu from machine config also seems bad, because of loosing the option to use correct -mcpu.

That's my solution keeps all information "local" in tune file DEFAULTTUNE will be set to generic arm5te OPTDEFAULTTUN to xscale

and distro then can choose which one to use by default or for some packages.. see my e-mail about it (I won't write it again because I'm writting from phone)

Quoted 26 lines
Quoted 3 lines

But -mtune=${ARMV5TEDEFAULTTUNE} in tune-arm926ejs.inc with xscale value set through ARMV5TEDEFAULTTUNE_disto doesn't look very intuitive.

I'm not saying that it is. What I'm saying is that it puts the pain in the place of the person trying to do the deep configuration and isn't the first thing a new user hits and struggles with.

We can add variables for *everything*. That doesn't mean that we should and this is one case that I think the proposal complicates something that is already too complicated, badly (under) documented and being misused (see the number of patches I've seen recently abusing DEFAULTTUNE).

At least if the tune files and system was well documented I might feel better about things but right now it isn't.

Quoted 1 line

And how many .*DEFAUTTUNE variables distro should set?

As soon as you enter the world of recipe specific tunings, I suspect a number of variables are going to need to get set.

Cheers,

Richard

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#24 lore raw
Quoted 116 lines · Martin Jansa
Quoted 82 lines · Richard Purdie
Quoted 81 lines · Martin Jansa
Quoted 79 lines · Richard Purdie
Quoted 68 lines · Martin Jansa
Quoted 67 lines · Richard Purdie
Quoted 35 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
  stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
  stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
  basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
  Variable TUNE_CCARGS value changed from
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
Quoted 9 lines
  ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
  to
  ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
  ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
  ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}

This is a tricky one. As others have mentioned, this is a tune parameter, not an arch one and as such the binaries are compatible with each other although they potentially are compiled differently with different optimisations.

As such, mixing the feeds is permitted and will not cause any real world usage problem. As you point out, sstate is much more sensitive to this kind of change and is correctly deciding the output is different though.

I think my preferred approach would be to have the tune files do something like:

-mtune=${ARMV5TEDEFAULTTUNE}

and then the user can set ARMV5DEFAULTTUNE to whatever the believe is a appropriate. This would result in the package feed at least having a consistent state of one tune and sstate would be happy. It then becomes a distro policy decision which is what it should be. ARMV5TEDEFAULTTUNE would default to the current values meaning the distro would then just do:

Quoted 8 lines
Quoted 6 lines

ARMV5TEDEFAULTTUNE_poky = "xscale"

and hence make their decision. Of course the distro could also decide to split the package architectures up which is equally fine.

Does something like that sound like it would work?

My solution seems to be a bit more flexible then this.

Which cases does it enable which the above doesn't?

Quoted 7 lines
Quoted 3 lines

To have separate binary feeds for some packages while keeping most of other packages in armv5te feed without any -mtune or with some ARMV5TEDEFAULTTUNE.

Firstly, lets clearly define what the problems are. We want to have some packages with the existing tune in separate feeds and have other packages sharing (or have no) mtune values?

The proble is, that tune-cpu.inc files sets different -mcpu while keeping the same PACKAGE_ARCH (first commit in my brach)

Quoted 5 lines

The reason I say that is that initially this looked like a problem with sstate and the specific mtune values which is a relatively generic and widespread issue. The problem described above is implementation of what is very specific distro policy. I want to be clear about which problem(s) we're solving as that is leading to confusion discussing it.

sstate is "correctly" detecting -mcpu change and rebuild all packages with new mcpu, but resulting ipk are in the same arch -> user wont see which -mcpu was used to buld particular .ipk.

Quoted 3 lines

If the problem(s) we're solving are the distro feed one rather than sstate, the problem is more specific the distro policy and I'd expect the distro itself to be handling this and not the core.

If I add those PACKAGE_ARCH setting to each tune* which sets new DEFAULTUNE them some distributions can see it as regression as e.g. xscale and arm926ejs feed will need twice as much space as now shared armv5te.

Removin tune-cpu from machine config also seems bad, because of loosing the option to use correct -mcpu.

Quoted 7 lines

That's my solution keeps all information "local" in tune file DEFAULTTUNE will be set to generic arm5te OPTDEFAULTTUN to xscale

and distro then can choose which one to use by default or for some packages.. see my e-mail about it (I won't write it again because I'm writting from phone)

Even with last version of jansa/tune it does not really help with rebuilds

$ bitbake-diffsigs stamps.1348241943/*/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure*
basehash changed from 82dd3229952508550532e9ab37e78dc4 to 1d04ba204fe9afb1d346156dc066da93
Variable TUNE_CCARGS value changed from  
${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)} 
${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)} 
${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)} 
to  
${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)} 
${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)} 
${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
Hash for dependent task linux-libc-headers_3.4.3.bb.do_patch changed from 4d1f46fa912bc21421d343811acab517 to 663e25ca238e049eaff02fd288c5342e

So even if I let both machines using only armv5 thumb dsp TUNE_FEATURES it still rebuilds e.g. linux-libc-headers.

We can merge all those
TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}" fragmets to arch-armv5-dsp.inc, but that doesn't look very correct too (imagine someone who wants to add new tune-magicfoo in his BSP which adds another possible value for TUNE_FEATURES but still uses armv5te feed.

Any idea?

Cheers,

Quoted 30 lines
Quoted 27 lines
Quoted 4 lines

But -mtune=${ARMV5TEDEFAULTTUNE} in tune-arm926ejs.inc with xscale value set through ARMV5TEDEFAULTTUNE_disto doesn't look very intuitive.

I'm not saying that it is. What I'm saying is that it puts the pain in the place of the person trying to do the deep configuration and isn't the first thing a new user hits and struggles with.

We can add variables for *everything*. That doesn't mean that we should and this is one case that I think the proposal complicates something that is already too complicated, badly (under) documented and being misused (see the number of patches I've seen recently abusing DEFAULTTUNE).

At least if the tune files and system was well documented I might feel better about things but right now it isn't.

Quoted 1 line

And how many .*DEFAUTTUNE variables distro should set?

As soon as you enter the world of recipe specific tunings, I suspect a number of variables are going to need to get set.

Cheers,

Richard

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#25 lore raw
Quoted 24 lines · Martin Jansa

Even with last version of jansa/tune it does not really help with rebuilds

$ bitbake-diffsigs stamps.1348241943/*/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure*
basehash changed from 82dd3229952508550532e9ab37e78dc4 to 1d04ba204fe9afb1d346156dc066da93
Variable TUNE_CCARGS value changed from  
${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)} 
${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)} 
${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)} 
to  
${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)} 
${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)} 
${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)} 
${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
Hash for dependent task linux-libc-headers_3.4.3.bb.do_patch changed from 4d1f46fa912bc21421d343811acab517 to 663e25ca238e049eaff02fd288c5342e

So even if I let both machines using only armv5 thumb dsp TUNE_FEATURES it still rebuilds e.g. linux-libc-headers.

Quoted 7 lines

We can merge all those
TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}" fragmets to arch-armv5-dsp.inc, but that doesn't look very correct too (imagine someone who wants to add new tune-magicfoo in his BSP which adds another possible value for TUNE_FEATURES but still uses armv5te feed.

Any idea?

TUNE_CCARGS[vardepvalue] = "${TUNE_CCARGS}"

This should flatten it. We care about the final value, not how its obtained in this case.

Cheers,

Richard

#26 lore raw
In reply to Richard Purdie
Quoted 86 lines · Richard Purdie
Quoted 68 lines · Martin Jansa
Quoted 67 lines · Richard Purdie
Quoted 35 lines · Martin Jansa

Hi,

when building spitz and qemuarm (both produces packages in armv5te feed) resulting packages are tuned with -mtune=xscale (when built for spitz) or -mtune=arm926ej-s (when built for qemuarm).

From
https://bugzilla.yoctoproject.org/show_bug.cgi?id=1916#c5
Firstly, if you go changing the tune parameters in a given machine, you are expected to use a different PACKAGE_ARCH. If you do that, you will get a different package feed for the different binaries, different WORKDIR and so on. This was always the way the package architectures was intended to work and nothing has changed there. Yes, you as the user changing various variables can create inconsistent package feeds. There are 101 ways you can do that, the simple answer is just don't. We're therefore unlikely to add MACHINE to DEPLOY_DIR or remove PACKAGE_ARCH, please just use it as its intended.

Does qemuarm use oe-core as it's intended?

Shouldn't spitz produce something like armv5te-xscale and qemuarm armv5te-arm926ejs? It would cause all recipes to build again (cannot share armv5te feed anymore), but at least it would build it and user will really get it on target, right now opkg upgrade can download some packages with xscale some with arm926ej-s.

$ ~/bitbake/bin/bitbake-diffsigs
   stamps.1347348910/spitz/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.04b364a15889fcff7502614f1c116abc
   stamps.1347348910/qemuarm/armv5te-oe-linux-gnueabi/linux-libc-headers-3.4.3-r0.do_configure.sigdata.656f0583be969b427f040f2e143bcb14
   basehash changed from 7fe9c0a3455dac20ba6a90ed337b097e to d8dd2ff8613d0aafe60bef1a1e9469a1
   Variable TUNE_CCARGS value changed from
   ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
Quoted 9 lines
   ${@bb.utils.contains("TUNE_FEATURES", "xscale", "-mtune=xscale", "", d)}
   to
   ${@bb.utils.contains("TUNE_FEATURES", "armv5", "-march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "armv4", "-march=armv4${ARMPKGSFX_THUMB}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "thumb", "${ARM_THUMB_M_OPT}", "", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "no-thumb-interwork", "-mno-thumb-interwork", "-mthumb-interwork", d)}
   ${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "-mfloat-abi=hard", "-mfloat-abi=softfp", d), "" ,d)}
   ${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", "-mtune=arm926ej-s", "", d)}

This is a tricky one. As others have mentioned, this is a tune parameter, not an arch one and as such the binaries are compatible with each other although they potentially are compiled differently with different optimisations.

As such, mixing the feeds is permitted and will not cause any real world usage problem. As you point out, sstate is much more sensitive to this kind of change and is correctly deciding the output is different though.

I think my preferred approach would be to have the tune files do something like:

-mtune=${ARMV5TEDEFAULTTUNE}

and then the user can set ARMV5DEFAULTTUNE to whatever the believe is a appropriate. This would result in the package feed at least having a consistent state of one tune and sstate would be happy. It then becomes a distro policy decision which is what it should be. ARMV5TEDEFAULTTUNE would default to the current values meaning the distro would then just do:

Quoted 8 lines
Quoted 6 lines

ARMV5TEDEFAULTTUNE_poky = "xscale"

and hence make their decision. Of course the distro could also decide to split the package architectures up which is equally fine.

Does something like that sound like it would work?

My solution seems to be a bit more flexible then this.

Which cases does it enable which the above doesn't?

I'm a little worried about adding more indirection to the DEFAULTTUNE variable itself since the whole tune situation is already convoluted and indirected enough without adding another level of it :/. That variable is the one exposed to the user straight away, not hidden more behind the scenes.

Quoted 7 lines

Taking a step back and looking at the APIs I'm really not very happy with the usability of them already and I don't think this helps.

Someone commented about the ppc situation and I was told that there, the binaries are incompatible with each other. It is more unusual to have situations where there are micro-optimisations through -mtune yet the binaries remain compatible.

On PPC there are a bunch of different ABIs:

PPC32 (Classic)
PPC32-soft float (Classic)
PPC32-e500v1 (e500v1 instructions and registers)
PPC32-e500v2 (e500v2 instructions and registers)

There are some variations in the classic mode, w/ and w/o using Altivec. However, on PPC the save/restore of variables on context switching is done using exception handling -- and register passing for classic mode is always through normal registers.

They do have variants of processors for the PPC32 and PPC32-soft float ABIs, for each variant we just assign a new package arch -- and then make that compatible with the other package archs. (Almost exactly the same way it's done on traditional Linux systems on x86).

So in the end you really have two levels of information that make up the package ARCH. ABI & CPU instructions/optimization.

MIPS is a bit more complex, but generally the same rules apply. You have ABI and processor optimizations that produce the package ARCH.

ARM seems to be the one exception, where you have three levels.. ABI (EABI/hf-EABI), processor family (armv4, armv5, armv7, cortext....), and then CPU optimization. This seems to cause additional confusion, as the CPU optimizations are not being captured in the current package ARCH, which makes it difficult to optimize on a feed.

--Mark

Quoted 11 lines

Cheers,

Richard

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#27 lore raw
Quoted 5 lines · Mark Hatle

ARM seems to be the one exception, where you have three levels.. ABI (EABI/hf-EABI), processor family (armv4, armv5, armv7, cortext....), and then CPU optimization. This seems to cause additional confusion, as the CPU optimizations are not being captured in the current package ARCH, which makes it difficult to optimize on a feed.

I guess that by "processor family" you mean ISA. (I'm not aware of an ARM ISA variant named "cortext", though I haven't really been keeping up with the latest developments there so I could imagine that one might exist.)

Anyway, the basic three-way scenario (ISA, ABI, optimisation) that you describe above isn't in any sense unique to ARM; the concept of per-cpu-model optimisation/tuning applies equally to other architectures (x86 for example) as well. It's probably less of an issue for MIPS but I suspect that's more a reflection of gcc's weaker optimisation capabilities on that architecture rather than a homogeous CPU population. I don't know PowerPC well enough to make any comment about that.

There's no particular reason that the per-cpu tuning couldn't be captured in PACKAGE_ARCH if one wanted to do it. But the decision about how to structure a binary feed is clearly one for the DISTRO and the question of how to map that into PACKAGE_ARCH is, equally clearly, one that the distro ought to be solving. Since oe-core itself doesn't build any feeds, I don't think there's any reason for it to make heroic efforts to sort out the package architectures that would go into them.

p.