[oe] Can cross binutils and gcc be made independent of ARM version?

pHilipp Zabel philipp.zabel at gmail.com
Sat Mar 10 16:20:35 UTC 2007


Hi,

currently binutils-cross, glibc-intermediate and gcc-cross have the
PACKAGE_ARCH set by the MACHINE, in my case armv4t or armv5te,
depending on the device. This causes them to be built twice,
overwriting each other in CROSS_DIR when building a single
distribution for all machines. Is it possible to change PACKAGE_ARCH
to just "arm" for arm cross packages and glibc-intermediate so that
binutils/gcc only have to be built once?

I'm currently testing the patch below (it sets cross packages' and
glibc-intermediate's  PACKAGE_ARCH to TARGET_ARCH for arm). Is there a
good reason not to do this, and if yes, could anything be done to work
around it?

regards
Philipp

#
# old_revision [b7093a0b54878418e08732a71380ec1eff1b1456]
#
# patch "classes/cross.bbclass"
#  from [c0fd2d21a749ceca1bef334641e20b66e044c5b4]
#    to [c6677dd5c700994a52b3f075078894c9a4a4b843]
#
# patch "packages/glibc/glibc-intermediate_2.5.bb"
#  from [d23bfd05eea7dd65fd5c7db7cdcb75dc34fa2953]
#    to [a872fc4fd91d6b0063f30dcac20714d23be8c09d]
#
============================================================
--- classes/cross.bbclass       c0fd2d21a749ceca1bef334641e20b66e044c5b4
+++ classes/cross.bbclass       c6677dd5c700994a52b3f075078894c9a4a4b843
@@ -1,10 +1,10 @@ OLD_PACKAGE_ARCH := ${PACKAGE_ARCH}
 # Cross packages are built indirectly via dependency,
 # no need for them to be a direct target of 'world'
 EXCLUDE_FROM_WORLD = "1"

 # Save PACKAGE_ARCH before changing HOST_ARCH
 OLD_PACKAGE_ARCH := ${PACKAGE_ARCH}
-PACKAGE_ARCH = ${OLD_PACKAGE_ARCH}
+PACKAGE_ARCH =
"${@["arm",bb.data.getVar('OLD_PACKAGE_ARCH',d,1)][bb.data.getVar('TARGET_ARCH',d,1)
!= 'arm']}"

 PACKAGES = ""

============================================================
--- packages/glibc/glibc-intermediate_2.5.bb
d23bfd05eea7dd65fd5c7db7cdcb75dc34fa2953
+++ packages/glibc/glibc-intermediate_2.5.bb
a872fc4fd91d6b0063f30dcac20714d23be8c09d
@@ -9,8 +9,10 @@ do_configure_prepend() {
        sed -i s:-Werror:: ${S}/configure
 }

+# don't build a new glibc-intermediate/gcc-cross for each arm*
+OLD_PACKAGE_ARCH := ${PACKAGE_ARCH}
+PACKAGE_ARCH =
"${@["arm",bb.data.getVar('OLD_PACKAGE_ARCH',d,1)][bb.data.getVar('TARGET_ARCH',d,1)
!= 'arm']}"

-
 PACKAGES = ""
 PROVIDES = "virtual/${TARGET_PREFIX}libc-for-gcc"
 DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers"




More information about the Openembedded-devel mailing list