[oe] [PATCH] sane-toolchain-eglibc.inc: Set TARGET_OS = linux-gnuspe for e500

Phil Blundell philb at gnu.org
Sun Aug 30 08:10:52 UTC 2009


On Sat, 2009-08-29 at 18:22 -0700, Khem Raj wrote:
> We can override only for powerpc second time around. So changing it to 
> 
> TARGET_OS_powerpc =
> "linux${@['','-gnuspe'][bb.data.getVar('TARGET_ARCH',d,1) in ['ppc',
> 'powerpc'] and bb.data.getVar('MACHINE',d) in ['calamari', 'tqm8540']]}"
> 
> will that be ok ?

That's better, but it still doesn't seem terribly elegant.  I also
remain slightly unconvinced that the eglibc-specific file is,
conceptually, the right place for this logic.  I would propose:

a) write a single, generic function to generate an appropriate TARGET_OS
suffix based on the distro properties, something along the approximate
lines of:

if target_os == "linux":
  # compute and apply appropriate suffix
  linux_suffix = ""
  if bb.data.getVar("LIBC", d, 1) == "uclibc":
    linux_suffix += "uclibc"
  if bb.data.getVar("TARGET_ARCH", d, 1) in [ 'arm', 'armeb' ] and
arm_abi == "eabi":
    linux_suffix += "gnueabi"
  # does this really need to mention both ppc and powerpc; can't we just
pick one?
  if bb.data.getVar('TARGET_ARCH',d,1) in ['ppc', 'powerpc'] and
bb.data.getVar('MACHINE',d) in ['calamari', 'tqm8540'] and "spe" in
distro_features:
    linux_suffix += "gnuspe"
  if linux_suffix != "":
    target_os = "%s-%s" % (target_os, linux_suffix)

(the above is obviously incomplete but I imagine you get the idea)

b) absent an obviously more appropriate place, put it in the top level
sane-toolchain.inc

That way at least we only have this stuff in one place, rather than the
current proliferation of duplicated logic (see the eabi selector for
example).

p.






More information about the Openembedded-devel mailing list