Patchwork [RFC] bitbake.conf/tune files: Adjust PACKAGE_EXTEA_ARCHS

login
register
mail settings
Submitter Richard Purdie
Date March 15, 2011, 8:31 p.m.
Message ID <1300221086.30423.1839.camel@rex>
Download mbox | patch
Permalink /patch/1421/
State New, archived
Headers show

Comments

Richard Purdie - March 15, 2011, 8:31 p.m.
There is a problem with the current PACKAGE_EXTRA_ARCHS implementation
since its impossible to control which extra architectures sort higher
than TARGET_ARCH and which sort lower. In the x86 case for example,
TARGET_ARCH might be "i586", i486 should be lower than this and i686 should
be higher. There are also complications where its easy to inject duplicate
entries into the variable.
    
I tried various versions of this patch and concluded that it was simplest
just to force the tune files to include TARGET_ARCH in the list in the
right place if they're planning to customise it themselves. Other approaches
with appends and prepends just complicated the code for no good reason.
    
The TARGET_ARCH definitions should also move to the tune files but I'll
leave this for a separate patch.
    
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie - March 21, 2011, 5:34 p.m.
On Tue, 2011-03-15 at 20:31 +0000, Richard Purdie wrote:
> There is a problem with the current PACKAGE_EXTRA_ARCHS implementation
> since its impossible to control which extra architectures sort higher
> than TARGET_ARCH and which sort lower. In the x86 case for example,
> TARGET_ARCH might be "i586", i486 should be lower than this and i686 should
> be higher. There are also complications where its easy to inject duplicate
> entries into the variable.
>     
> I tried various versions of this patch and concluded that it was simplest
> just to force the tune files to include TARGET_ARCH in the list in the
> right place if they're planning to customise it themselves. Other approaches
> with appends and prepends just complicated the code for no good reason.
>     
> The TARGET_ARCH definitions should also move to the tune files but I'll
> leave this for a separate patch.
>     
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Since there were no objections to this (and I chatted to some people
over jabber about it too), I'm going to merge this.

Cheers,

Richard

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 42b9825..e51df7a 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -94,7 +94,8 @@  BASE_PACKAGE_ARCH = "${HOST_ARCH}"
 PACKAGE_ARCH = "${BASE_PACKAGE_ARCH}"
 MACHINE_ARCH = "${@[bb.data.getVar('BASE_PACKAGE_ARCH', d, 1), bb.data.getVar('MACHINE', d, 1)][bool(bb.data.getVar('MACHINE', d, 1))]}"
 MACHINE_ARCH_qemux86-64 = "qemux86_64"
-PACKAGE_ARCHS = "all any noarch ${TARGET_ARCH} ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
+PACKAGE_EXTRA_ARCHS ??= "${TARGET_ARCH}"
+PACKAGE_ARCHS = "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
 # MACHINE shouldn't be included here as a variable dependency since machine specific 
 # packages are handled using multimachine
 PACKAGE_ARCHS[vardepsexclude] = "MACHINE"
diff --git a/meta/conf/machine/include/tune-arm1136jf-s.inc b/meta/conf/machine/include/tune-arm1136jf-s.inc
index a771751..2ea3c9d 100644
--- a/meta/conf/machine/include/tune-arm1136jf-s.inc
+++ b/meta/conf/machine/include/tune-arm1136jf-s.inc
@@ -4,6 +4,6 @@  FEED_ARCH = "armv6"
 BASE_PACKAGE_ARCH = "armv6"
 
 ARM_INSTRUCTION_SET = "${@['thumb','arm'][bb.data.getVar('CPU_FEATURES', d, 1).find('thumb') == -1]}"
-PACKAGE_EXTRA_ARCHS += "armv4 armv4t armv5te armv6"
+PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t armv5te armv6"
 
 require conf/machine/include/tune-thumb.inc
diff --git a/meta/conf/machine/include/tune-arm920t.inc b/meta/conf/machine/include/tune-arm920t.inc
index fee5c58..564b557 100644
--- a/meta/conf/machine/include/tune-arm920t.inc
+++ b/meta/conf/machine/include/tune-arm920t.inc
@@ -1,4 +1,4 @@ 
 FEED_ARCH = "armv4t"
 BASE_PACKAGE_ARCH = "armv4t" 
 TARGET_CC_ARCH = "-march=armv4t -mtune=arm920t"
-PACKAGE_EXTRA_ARCHS += "armv4 armv4t"
+PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t"
diff --git a/meta/conf/machine/include/tune-arm926ejs.inc b/meta/conf/machine/include/tune-arm926ejs.inc
index f41e460..9d546c9 100644
--- a/meta/conf/machine/include/tune-arm926ejs.inc
+++ b/meta/conf/machine/include/tune-arm926ejs.inc
@@ -1,5 +1,5 @@ 
 FEED_ARCH = "armv5te"
-PACKAGE_EXTRA_ARCHS += "armv4 armv4t armv5te"
+PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t armv5te"
 # For gcc 3.x you need:
 #TARGET_CC_ARCH = "-march=armv5te -mtune=arm926ejs"
 # For gcc 4.x you need:
diff --git a/meta/conf/machine/include/tune-arm9tdmi.inc b/meta/conf/machine/include/tune-arm9tdmi.inc
index d788b53..5446ce8 100644
--- a/meta/conf/machine/include/tune-arm9tdmi.inc
+++ b/meta/conf/machine/include/tune-arm9tdmi.inc
@@ -1,4 +1,4 @@ 
 FEED_ARCH = "armv4t"
 BASE_PACKAGE_ARCH = "armv4t"
-PACKAGE_EXTRA_ARCHS += "armv4 armv4t"
+PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t"
 TARGET_CC_ARCH = "-mcpu=arm9tdmi -mtune=arm9tdmi"
diff --git a/meta/conf/machine/include/tune-armv7.inc b/meta/conf/machine/include/tune-armv7.inc
index 379a3eb..979d6fe 100644
--- a/meta/conf/machine/include/tune-armv7.inc
+++ b/meta/conf/machine/include/tune-armv7.inc
@@ -3,5 +3,5 @@ 
 # This will NOT compile programs in 'ARM' mode, which is what you really want
 TARGET_CC_ARCH = "-march=armv7 -mfpu=vfp -mfloat-abi=softfp"
 FEED_ARCH = "armv7"
-PACKAGE_EXTRA_ARCHS += "armv4 armv4t armv5te armv6 armv7"
+PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t armv5te armv6 armv7"
 BASE_PACKAGE_ARCH = "armv7"
diff --git a/meta/conf/machine/include/tune-atom.inc b/meta/conf/machine/include/tune-atom.inc
index 66d960a..399ea54 100644
--- a/meta/conf/machine/include/tune-atom.inc
+++ b/meta/conf/machine/include/tune-atom.inc
@@ -2,4 +2,4 @@  BASE_PACKAGE_ARCH = "core2"
 TARGET_CC_ARCH = "-m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse"
 #MOBLIN_CFLAGS = "-Os -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables"
 
-PACKAGE_EXTRA_ARCHS += "x86 i386 i486 core2"
+PACKAGE_EXTRA_ARCHS = "x86 i386 i486 i586 i686 core2"
diff --git a/meta/conf/machine/include/tune-c3.inc b/meta/conf/machine/include/tune-c3.inc
index 1d636e8..d33df5f 100644
--- a/meta/conf/machine/include/tune-c3.inc
+++ b/meta/conf/machine/include/tune-c3.inc
@@ -1,4 +1,4 @@ 
 TARGET_CC_ARCH = "-march=c3 -mtune=c3"
-PACKAGE_EXTRA_ARCHS += "i386 i486 i586"
+PACKAGE_EXTRA_ARCHS = "i386 i486 i586"
 BASE_PACKAGE_ARCH = "i586"
 FEED_ARCH = "i586"
diff --git a/meta/conf/machine/include/tune-cortexa8.inc b/meta/conf/machine/include/tune-cortexa8.inc
index 3ec1c03..a5b982a 100644
--- a/meta/conf/machine/include/tune-cortexa8.inc
+++ b/meta/conf/machine/include/tune-cortexa8.inc
@@ -10,4 +10,4 @@  TARGET_CC_ARCH = "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
 
 FEED_ARCH = "armv7a"
 BASE_PACKAGE_ARCH = "armv7a"
-PACKAGE_EXTRA_ARCHS += "armv4 armv4t armv5te armv6 armv7 armv7a"
+PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t armv5te armv6 armv7 armv7a"
diff --git a/meta/conf/machine/include/tune-ep9312.inc b/meta/conf/machine/include/tune-ep9312.inc
index d0c5bb2..e1515a0 100644
--- a/meta/conf/machine/include/tune-ep9312.inc
+++ b/meta/conf/machine/include/tune-ep9312.inc
@@ -2,7 +2,7 @@  TARGET_CC_ARCH = "-march=ep9312 -mtune=ep9312 -mcpu=ep9312"
 # add "-mfp=maverick" for newer gcc versions > 4.0
 
 #set arch to ep9312 for all generated packages
-PACKAGE_EXTRA_ARCHS += "armv4t ep9312"
+PACKAGE_EXTRA_ARCHS = "arm armv4t ep9312"
 BASE_PACKAGE_ARCH = "ep9312"
 FEED_ARCH = "ep9312"
 
diff --git a/meta/conf/machine/include/tune-iwmmxt.inc b/meta/conf/machine/include/tune-iwmmxt.inc
index f7291be..7191ab0 100644
--- a/meta/conf/machine/include/tune-iwmmxt.inc
+++ b/meta/conf/machine/include/tune-iwmmxt.inc
@@ -2,6 +2,6 @@ 
 # Please use tune-xscale for PXA255/PXA26x based processors.
 TARGET_CC_ARCH = "-march=iwmmxt -mcpu=iwmmxt -mtune=iwmmxt"
 BASE_PACKAGE_ARCH = "iwmmxt"
-PACKAGE_EXTRA_ARCHS += "armv4 armv4t armv5te iwmmxt"
+PACKAGE_EXTRA_ARCHS = "arm armv4 armv4t armv5te iwmmxt"
 FEED_ARCH = "iwmmxt"
 
diff --git a/meta/conf/machine/include/tune-ppc603e.inc b/meta/conf/machine/include/tune-ppc603e.inc
index 15a72d1..dc95d0d 100644
--- a/meta/conf/machine/include/tune-ppc603e.inc
+++ b/meta/conf/machine/include/tune-ppc603e.inc
@@ -1,4 +1,4 @@ 
 TARGET_CC_ARCH = "-mcpu=603e  -mhard-float"
 BASE_PACKAGE_ARCH = "ppc603e"
 FEED_ARCH = "ppc603e"
-PACKAGE_EXTRA_ARCHS += "ppc603e"
+PACKAGE_EXTRA_ARCHS = "powerpc ppc603e"
diff --git a/meta/conf/machine/include/tune-ppce300c2.inc b/meta/conf/machine/include/tune-ppce300c2.inc
index 2956875..3e552e6 100644
--- a/meta/conf/machine/include/tune-ppce300c2.inc
+++ b/meta/conf/machine/include/tune-ppce300c2.inc
@@ -1,3 +1,3 @@ 
 TARGET_CC_ARCH = "-mcpu=e300c2 -msoft-float"
 BASE_PACKAGE_ARCH = "ppce300"
-PACKAGE_EXTRA_ARCHS += "ppce300"
+PACKAGE_EXTRA_ARCHS = "powerpc ppce300"
diff --git a/meta/conf/machine/include/tune-ppce500.inc b/meta/conf/machine/include/tune-ppce500.inc
index 44f8742..45e1f0d 100644
--- a/meta/conf/machine/include/tune-ppce500.inc
+++ b/meta/conf/machine/include/tune-ppce500.inc
@@ -1,4 +1,4 @@ 
 TARGET_CC_ARCH = "-mcpu=8540"
 BASE_PACKAGE_ARCH = "ppce500"
 FEED_ARCH = "ppce500"
-PACKAGE_EXTRA_ARCHS += "ppce500"
+PACKAGE_EXTRA_ARCHS = "powerpc ppce500"
diff --git a/meta/conf/machine/include/tune-xscale.inc b/meta/conf/machine/include/tune-xscale.inc
index f1ef3d4..cfdcc99 100644
--- a/meta/conf/machine/include/tune-xscale.inc
+++ b/meta/conf/machine/include/tune-xscale.inc
@@ -5,7 +5,7 @@  INHERIT += "siteinfo"
 TARGET_CC_ARCH = "-march=armv5te -mtune=xscale"
 TARGET_CC_KERNEL_ARCH = "-march=armv5te -mtune=xscale"
 BASE_PACKAGE_ARCH = "${@['armv5teb', 'armv5te'][bb.data.getVar('SITEINFO_ENDIANESS', d, 1) == 'le']}"
-PACKAGE_EXTRA_ARCHS += "${@['armv4b armv4tb armv5teb', 'armv4 armv4t armv5te'][bb.data.getVar('SITEINFO_ENDIANESS', d, 1) == 'le']}"
+PACKAGE_EXTRA_ARCHS = "${@['armeb armv4b armv4tb armv5teb', 'arm armv4 armv4t armv5te'][bb.data.getVar('SITEINFO_ENDIANESS', d, 1) == 'le']}"
 
 # webkit-gtk has alignment issues with double instructions on armv5 so
 # disable them here