All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [PATCH] sane-toolchain-eglibc.inc: Set TARGET_OS	= linux-gnuspe for e500
Date: Sun, 30 Aug 2009 02:22:50 -0700	[thread overview]
Message-ID: <20090830092250.GA16275@gmail.com> (raw)
In-Reply-To: <1251620948.4215.673.camel@lenovo.internal.reciva.com>

[-- Attachment #1: Type: text/plain, Size: 1686 bytes --]

On (30/08/09 09:29), Phil Blundell wrote:
> On Sun, 2009-08-30 at 09:10 +0100, Phil Blundell wrote:
> > 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. 
> 
> Actually, there is still a bigger problem with this change: it will
> cause the ABI to change in a semi-random way depending on the selected
> MACHINE and this will screw up people who are trying to do multimachine
> builds.
> 
> For example, if I set MACHINE=calamari and then bitbake micro-image, it
> will select linux-gnuspe and I will presumably get the SPE ABI.  But
> then, if I set MACHINE=efika, say, and build another package in the same
> tree, it'll now select regular linux and the ABI will change, although
> this won't be reflected in the naming of the output packages: they'll
> all just be named "powerpc".  Worse, if eglibc itself happens to be
> version-bumped while I am building for efika, my C library will be
> quietly recompiled with a different ABI and, presumably, lose in a
> fairly serious way.

based upon your idea in last email. Here is something I put together
seems to work. It will need testing ofcourse

What do you think about this one ?

Thanks

-Khem

[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 4322 bytes --]

diff --git a/conf/distro/include/sane-toolchain-eglibc.inc b/conf/distro/include/sane-toolchain-eglibc.inc
index 006f1d6..4c5f44f 100644
--- a/conf/distro/include/sane-toolchain-eglibc.inc
+++ b/conf/distro/include/sane-toolchain-eglibc.inc
@@ -3,10 +3,6 @@
 # eglibc:
 # [23:00] oxo: glibc (any version) on sparc does not like (repeat me) "-Os"
 
-TARGET_OS = "linux${@['','-gnueabi'][bb.data.getVar('TARGET_ARCH',d,1) in ['arm', 'armeb'] and bb.data.getVar('MACHINE',d) not in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']]}"
-
-TARGET_OS_powerpc = "linux${@['','-gnuspe'][bb.data.getVar('TARGET_ARCH',d,1) in ['ppc', 'powerpc'] and bb.data.getVar('MACHINE',d) in ['calamari', 'tqm8540']]}"
-
 FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os"
 FULL_OPTIMIZATION_pn-perl = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O1"
 FULL_OPTIMIZATION_sparc = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2"
diff --git a/conf/distro/include/sane-toolchain-glibc.inc b/conf/distro/include/sane-toolchain-glibc.inc
index f3da7c3..f029c6f 100644
--- a/conf/distro/include/sane-toolchain-glibc.inc
+++ b/conf/distro/include/sane-toolchain-glibc.inc
@@ -2,8 +2,6 @@
 
 # glibc:
 
-TARGET_OS = "linux${@['','-gnueabi'][bb.data.getVar('TARGET_ARCH',d,1) in ['arm', 'armeb'] and bb.data.getVar('MACHINE',d) not in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']]}"
-
 #mess with compiler flags to use -Os instead of -O2
 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
 # perl has some problems, see http://bugs.openembedded.net/show_bug.cgi?id=1616
diff --git a/conf/distro/include/sane-toolchain-uclibc.inc b/conf/distro/include/sane-toolchain-uclibc.inc
index 04935fe..3069820 100644
--- a/conf/distro/include/sane-toolchain-uclibc.inc
+++ b/conf/distro/include/sane-toolchain-uclibc.inc
@@ -15,9 +15,6 @@ USE_NLS_glib-2.0 = "yes"
 USE_NLS_glib-2.0-native = "yes"
 USE_NLS_gcc-cross = "no"
 
-TARGET_OS_UC = "linux${@['-uclibc','-uclibcgnueabi'][bb.data.getVar('TARGET_ARCH',d,1) in ['arm', 'armeb'] and bb.data.getVar('MACHINE',d) not in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']]}"
-TARGET_OS = "${@['${TARGET_OS_UC}', 'uclinux-uclibc'][bb.data.getVar('TARGET_ARCH',d)  in ['bfin']]}"
-
 #mess with compiler flags to use -Os instead of -O2
 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
 FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os"
diff --git a/conf/distro/include/sane-toolchain.inc b/conf/distro/include/sane-toolchain.inc
index cebe77b..7279936 100644
--- a/conf/distro/include/sane-toolchain.inc
+++ b/conf/distro/include/sane-toolchain.inc
@@ -137,6 +137,38 @@ ENABLE_BINARY_LOCALE_GENERATION_armv7a = "0"
 #qemu has taken a dislike to armeb as well
 ENABLE_BINARY_LOCALE_GENERATION_armeb = "0"
 
+python detect_arm_abi () {
+	if bb.data.getVar("TARGET_ARCH", d, 1) in [ 'arm', 'armeb' ]:          
+		if bb.data.getVar('MACHINE',d) in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']:
+			return "oabi"
+		return "eabi"
+	else
+		return ""
+}
+
+python compute_os_portion_of_target_triplet () {
+
+	if bb.data.getVar('TARGET_ARCH',d,1) in ['bfin']:
+		os_suffix = "uclinux"
+	else
+  		os_suffix = "linux"
+
+	arm_abi	= detect_arm_abi(d)
+  	if bb.data.getVar("LIBC", d, 1) == "uclibc":
+    		libc_suffix = "uclibc"
+	else
+		libc_suffix = "gnu"
+	
+  	if arm_abi == "eabi":
+    		abi_suffix = "eabi"
+  	if bb.data.getVar('TARGET_ARCH',d,1) in ['ppc', 'powerpc'] and
+	bb.data.getVar('MACHINE',d) in ['calamari', 'tqm8540'] and 
+	bb.data.getVar('DISTRO_FEATURES',d) in ['spe']:
+    		abi_suffix = "spe"
+    	target_os = "%s-%s%s" % (os_suffix, libc_suffix, abi_suffix)
+	return target_os
+}
 # This is needed to get a correct PACKAGE_ARCH for packages that have PACKAGE_ARCH = ${MACHINE_ARCH}
-ARM_ABI ?= "${@['','oabi'][bb.data.getVar('MACHINE',d) in ['collie','h3600', 'h3800', 'simpad', 'htcwallaby']]}"
+ARM_ABI ?= "${@detect_arm_abi(d,1)}"
+TARGET_OS ?= "${@compute_os_portion_of_target_triplet (d, 1)}"
 include conf/distro/include/sane-toolchain-${ARM_ABI}.inc

  reply	other threads:[~2009-08-30  9:41 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-29  0:00 [PATCH] sane-toolchain-eglibc.inc: Set TARGET_OS = linux-gnuspe for e500 Khem Raj
2009-08-29  2:02 ` Tom Rini
2009-08-29  7:50   ` Khem Raj
2009-08-30  1:22     ` Khem Raj
2009-08-30  8:10       ` Phil Blundell
2009-08-30  8:29         ` Phil Blundell
2009-08-30  9:22           ` Khem Raj [this message]
2009-08-30  9:54             ` Phil Blundell
2009-08-30 10:38               ` Khem Raj
2009-08-30 11:18                 ` Phil Blundell
2009-08-30 18:08                   ` Khem Raj
2009-08-30 18:11                     ` Khem Raj
2009-08-30 20:27                     ` Phil Blundell
2009-08-30  9:33           ` Koen Kooi
2009-08-30  9:48           ` Khem Raj
2009-08-31 11:33             ` Marcin Juszkiewicz
2009-08-31 18:57               ` [PATCH] sane-toolchain-eglibc.inc: Set TARGET_OS?= " Khem Raj
2009-09-01  5:57               ` Khem Raj
2009-09-01  8:21                 ` Dirk Opfer
2009-09-01 15:31                   ` Khem Raj
2009-09-01 23:07                     ` Khem Raj
2009-09-02 19:20                       ` Khem Raj
2009-09-02 20:29                         ` Phil Blundell
2009-09-02 21:07                           ` Khem Raj
2009-09-03  4:36                             ` Tom Rini
2009-09-03  5:15                               ` Khem Raj
2009-09-03  9:32                               ` Phil Blundell
2009-09-03 15:11                                 ` Khem Raj
2009-09-04 10:51                                   ` Phil Blundell
2009-09-04 12:45                                     ` Leon Woestenberg
2009-09-04 15:27                                     ` Khem Raj
2009-09-04 15:37                                       ` Phil Blundell
2009-09-04 17:34                                         ` Khem Raj
2009-09-04 18:59                                           ` Phil Blundell
2009-09-04 21:52                                             ` Khem Raj
2009-08-29  8:14 ` [PATCH] sane-toolchain-eglibc.inc: Set TARGET_OS = " Phil Blundell
2009-08-29  8:33   ` Khem Raj
2009-08-29  8:53     ` Phil Blundell
2009-08-29 14:30       ` Koen Kooi
2009-08-29 17:08         ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090830092250.GA16275@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.