Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] More external toolchain fixes/improvements
@ 2012-06-01  2:00 Christopher Larson
  2012-06-01  2:00 ` [PATCH 1/3] external-sourcery: extract src and dest sysroot paths from gcc Christopher Larson
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Christopher Larson @ 2012-06-01  2:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

The following changes since commit e3113827810e98eb1b012f0b280fb917199704c1:

  webkit-gtk: Use glib as unicode backend to avoid browser crash (2012-05-30 17:37:58 +0100)

are available in the git repository at:
  github:kergoth/oe-core toolchain

Christopher Larson (3):
  external-sourcery: extract src and dest sysroot paths from gcc
  tcmode-external-sourcery: pass -msgxx-glibc for x86
  external-sourcery-toolchain: forcibly create usr/lib

 .../distro/include/tcmode-external-sourcery.inc    |   48 ++++++++++++-------
 .../meta/external-sourcery-toolchain.bb            |   25 +++++------
 2 files changed, 41 insertions(+), 32 deletions(-)

-- 
1.7.4.1




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] external-sourcery: extract src and dest sysroot paths from gcc
  2012-06-01  2:00 [PATCH 0/3] More external toolchain fixes/improvements Christopher Larson
@ 2012-06-01  2:00 ` Christopher Larson
  2012-06-01  4:06   ` Peter Seebach
  2012-06-01  2:00 ` [PATCH 2/3] tcmode-external-sourcery: pass -msgxx-glibc for x86 Christopher Larson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Christopher Larson @ 2012-06-01  2:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

Rather than hardcoding the multilib path in a map, and hardcoding dest sysroot
symlink creation in a hook, now we just use -print-sysroot for both, and pass
the appropriate multilib args to the toolchain for particular tunes.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 .../distro/include/tcmode-external-sourcery.inc    |   51 +++++++++++++-------
 .../meta/external-sourcery-toolchain.bb            |   21 +++-----
 2 files changed, 40 insertions(+), 32 deletions(-)

diff --git a/meta/conf/distro/include/tcmode-external-sourcery.inc b/meta/conf/distro/include/tcmode-external-sourcery.inc
index 79fef25..d5abc16 100644
--- a/meta/conf/distro/include/tcmode-external-sourcery.inc
+++ b/meta/conf/distro/include/tcmode-external-sourcery.inc
@@ -42,24 +42,39 @@ ENABLE_BINARY_LOCALE_GENERATION = ""
 
 TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}"
 
-# Translate to CodeSourcery's names for their optimized files in the toolchain
-def csl_target_core(d):
-    coredata = {
-        'armv7a-vfp-neon': 'armv7-a-neon',
-        'i586': 'sgxx-glibc',
-        'i686': 'sgxx-glibc',
-        'core2': 'sgxx-glibc',
-        'mips': 'mips32',
-        'mipsel': 'el',
-        'powerpc-nf': 'nof',
-        'ppce500': 'te500v1',
-        'ppce500mc': 'te500mc',
-        'ppce500v2': 'te500v2',
-        'ppce600': 'te600'
-    }
-    return coredata.get(d.getVar('TUNE_PKGARCH', True), '')
-
-CSL_TARGET_CORE ?= "${@csl_target_core(d)}"
+# Point to the appropriate multilib sysroot from the external toolchain, whose
+# files will be extracted into the OE sysroot
+def exttc_run(d, cmd):
+    try:
+        return bb.process.run(cmd, shell=True, env={'PATH': d.getVar('PATH', True)})[0].rstrip()
+    except (OSError, bb.process.CmdError):
+        return ''
+
+EXTERNAL_TOOLCHAIN_SYSROOT_CMD = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} -print-sysroot"
+EXTERNAL_TOOLCHAIN_SYSROOT ??= "${@exttc_run(d, EXTERNAL_TOOLCHAIN_SYSROOT_CMD)}"
+
+# These bits are here temporarily to sidestep the need to use a separate set
+# of tune files to pass the appropriate multilib selection arguments to the
+# sourcery toolchain, as is needed to extract the sysroot content.
+CSL_MULTILIB_ARGS[i586] = "-msgxx-glibc"
+CSL_MULTILIB_ARGS[i686] = "-msgxx-glibc"
+CSL_MULTILIB_ARGS[core2] = "-msgxx-glibc"
+CSL_MULTILIB_ARGS[x86] = "-msgxx-glibc"
+CSL_MULTILIB_ARGS[x86-64] = "-msgxx-glibc"
+CSL_MULTILIB_ARGS[ppce500] = "-te500v1"
+CSL_MULTILIB_ARGS[ppce500mc] = "-te500mc"
+CSL_MULTILIB_ARGS[ppce500v2] = "-te500v2"
+CSL_MULTILIB_ARGS[ppce600] = "-te600"
+
+def csl_multilib_arg(d):
+    argument = d.getVarFlag('CSL_MULTILIB_ARGS', d.getVar('DEFAULTTUNE', True) or '')
+    if argument:
+        return argument
+    else:
+        return ''
+
+EXTERNAL_TOOLCHAIN_SYSROOT_CMD += "${@csl_multilib_arg(d)}"
+
 
 # Unfortunately, the CSL ia32 toolchain has non-prefixed binaries in its
 # bindir (e.g. gcc, ld). To avoid this messing up our build, we avoid adding
diff --git a/meta/recipes-core/meta/external-sourcery-toolchain.bb b/meta/recipes-core/meta/external-sourcery-toolchain.bb
index b8cb6d9..b67410b 100644
--- a/meta/recipes-core/meta/external-sourcery-toolchain.bb
+++ b/meta/recipes-core/meta/external-sourcery-toolchain.bb
@@ -24,7 +24,7 @@ PROVIDES += "\
 	virtual/linux-libc-headers \
 "
 PV = "${CSL_VER_MAIN}"
-PR = "r5"
+PR = "r6"
 
 #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2"
 
@@ -32,10 +32,7 @@ SRC_URI = "file://SUPPORTED"
 
 do_install() {
 	# Use optimized files if available
-	sysroot="${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc"
-	if [ -d $sysroot/${CSL_TARGET_CORE} ]; then
-		sysroot="$sysroot/${CSL_TARGET_CORE}"
-	fi
+	sysroot="${EXTERNAL_TOOLCHAIN_SYSROOT}"
 
 	cp -a $sysroot${base_libdir}/. ${D}${base_libdir}
 	cp -a $sysroot/etc/. ${D}${sysconfdir}
@@ -76,15 +73,11 @@ do_install() {
 
 SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust"
 external_toolchain_sysroot_adjust() {
-       if [ -n "${CSL_TARGET_CORE}" ]; then
-               rm -f ${SYSROOT_DESTDIR}/${CSL_TARGET_CORE}
-               ln -s . ${SYSROOT_DESTDIR}/${CSL_TARGET_CORE}
-       fi
-
-       if [ "${TUNE_PKGARCH}" = "i586" ]; then
-               rm -f ${SYSROOT_DESTDIR}/system32
-               ln -s . ${SYSROOT_DESTDIR}/system32
-       fi
+	dest_sysroot="$(${CC} -print-sysroot | sed -e's,^${STAGING_DIR_HOST},,; s,/$,,')"
+	if [ -n "$dest_sysroot" ]; then
+		rm -f ${SYSROOT_DESTDIR}/$dest_sysroot
+		ln -s . ${SYSROOT_DESTDIR}/$dest_sysroot
+	fi
 }
 
 PACKAGES =+ "libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev linux-libc-headers linux-libc-headers-dev gdbserver gdbserver-dbg"
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] tcmode-external-sourcery: pass -msgxx-glibc for x86
  2012-06-01  2:00 [PATCH 0/3] More external toolchain fixes/improvements Christopher Larson
  2012-06-01  2:00 ` [PATCH 1/3] external-sourcery: extract src and dest sysroot paths from gcc Christopher Larson
@ 2012-06-01  2:00 ` Christopher Larson
  2012-06-01  2:00 ` [PATCH 3/3] external-sourcery-toolchain: forcibly create usr/lib Christopher Larson
  2012-06-01  2:01 ` [PATCH 0/3] More external toolchain fixes/improvements Christopher Larson
  3 siblings, 0 replies; 7+ messages in thread
From: Christopher Larson @ 2012-06-01  2:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

This is needed to work around an issue with the toolchain search paths. It can
pick up the wrong features.h without it, it seems, even with the system32
symlink in the oe sysroot. Investigate this further in the future.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 .../distro/include/tcmode-external-sourcery.inc    |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/meta/conf/distro/include/tcmode-external-sourcery.inc b/meta/conf/distro/include/tcmode-external-sourcery.inc
index d5abc16..834a4d9 100644
--- a/meta/conf/distro/include/tcmode-external-sourcery.inc
+++ b/meta/conf/distro/include/tcmode-external-sourcery.inc
@@ -56,11 +56,8 @@ EXTERNAL_TOOLCHAIN_SYSROOT ??= "${@exttc_run(d, EXTERNAL_TOOLCHAIN_SYSROOT_CMD)}
 # These bits are here temporarily to sidestep the need to use a separate set
 # of tune files to pass the appropriate multilib selection arguments to the
 # sourcery toolchain, as is needed to extract the sysroot content.
-CSL_MULTILIB_ARGS[i586] = "-msgxx-glibc"
-CSL_MULTILIB_ARGS[i686] = "-msgxx-glibc"
-CSL_MULTILIB_ARGS[core2] = "-msgxx-glibc"
-CSL_MULTILIB_ARGS[x86] = "-msgxx-glibc"
-CSL_MULTILIB_ARGS[x86-64] = "-msgxx-glibc"
+TUNE_CCARGS_append_x86 = " -msgxx-glibc"
+
 CSL_MULTILIB_ARGS[ppce500] = "-te500v1"
 CSL_MULTILIB_ARGS[ppce500mc] = "-te500mc"
 CSL_MULTILIB_ARGS[ppce500v2] = "-te500v2"
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] external-sourcery-toolchain: forcibly create usr/lib
  2012-06-01  2:00 [PATCH 0/3] More external toolchain fixes/improvements Christopher Larson
  2012-06-01  2:00 ` [PATCH 1/3] external-sourcery: extract src and dest sysroot paths from gcc Christopher Larson
  2012-06-01  2:00 ` [PATCH 2/3] tcmode-external-sourcery: pass -msgxx-glibc for x86 Christopher Larson
@ 2012-06-01  2:00 ` Christopher Larson
  2012-06-01  2:01 ` [PATCH 0/3] More external toolchain fixes/improvements Christopher Larson
  3 siblings, 0 replies; 7+ messages in thread
From: Christopher Larson @ 2012-06-01  2:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

If the usr/lib directory doesn't exist, the toolchain can fail to even try to
find crti.o in a completely different directory. This causes a failure for the
case where baselib is lib64.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 .../meta/external-sourcery-toolchain.bb            |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-core/meta/external-sourcery-toolchain.bb b/meta/recipes-core/meta/external-sourcery-toolchain.bb
index b67410b..74c82ec 100644
--- a/meta/recipes-core/meta/external-sourcery-toolchain.bb
+++ b/meta/recipes-core/meta/external-sourcery-toolchain.bb
@@ -24,7 +24,7 @@ PROVIDES += "\
 	virtual/linux-libc-headers \
 "
 PV = "${CSL_VER_MAIN}"
-PR = "r6"
+PR = "r7"
 
 #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2"
 
@@ -78,6 +78,10 @@ external_toolchain_sysroot_adjust() {
 		rm -f ${SYSROOT_DESTDIR}/$dest_sysroot
 		ln -s . ${SYSROOT_DESTDIR}/$dest_sysroot
 	fi
+
+	# If the usr/lib directory doesn't exist, the toolchain fails to even
+	# try to find crti.o in a completely different directory (usr/lib64)
+	install -d ${SYSROOT_DESTDIR}/usr/lib
 }
 
 PACKAGES =+ "libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev linux-libc-headers linux-libc-headers-dev gdbserver gdbserver-dbg"
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] More external toolchain fixes/improvements
  2012-06-01  2:00 [PATCH 0/3] More external toolchain fixes/improvements Christopher Larson
                   ` (2 preceding siblings ...)
  2012-06-01  2:00 ` [PATCH 3/3] external-sourcery-toolchain: forcibly create usr/lib Christopher Larson
@ 2012-06-01  2:01 ` Christopher Larson
  3 siblings, 0 replies; 7+ messages in thread
From: Christopher Larson @ 2012-06-01  2:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: Christopher Larson

On Thu, May 31, 2012 at 7:00 PM, Christopher Larson <kergoth@gmail.com> wrote:
> are available in the git repository at:
>  github:kergoth/oe-core toolchain

Erm, forgot to correct the url, my git url insteadOf adjusts this.

https://github.com/kergoth/oe-core toolchain



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] external-sourcery: extract src and dest sysroot paths from gcc
  2012-06-01  2:00 ` [PATCH 1/3] external-sourcery: extract src and dest sysroot paths from gcc Christopher Larson
@ 2012-06-01  4:06   ` Peter Seebach
  2012-06-01 13:59     ` Chris Larson
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Seebach @ 2012-06-01  4:06 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Christopher Larson

On Thu, 31 May 2012 19:00:04 -0700
Christopher Larson <kergoth@gmail.com> wrote:

> +CSL_MULTILIB_ARGS[i586] = "-msgxx-glibc"
> +CSL_MULTILIB_ARGS[i686] = "-msgxx-glibc"
> +CSL_MULTILIB_ARGS[core2] = "-msgxx-glibc"
> +CSL_MULTILIB_ARGS[x86] = "-msgxx-glibc"
> +CSL_MULTILIB_ARGS[x86-64] = "-msgxx-glibc"
> +CSL_MULTILIB_ARGS[ppce500] = "-te500v1"
> +CSL_MULTILIB_ARGS[ppce500mc] = "-te500mc"
> +CSL_MULTILIB_ARGS[ppce500v2] = "-te500v2"
> +CSL_MULTILIB_ARGS[ppce600] = "-te600"

I would suggest that these be ?= assignments.

Rationale:  There is more than one Sourcery toolchain out there, and
they sometimes differ in these.  It'd be nice if a hypothetical vendor
using a hypothetical custom variant of the Sourcery toolchain could use
these configuration files with nothing more than a few variable
assignments.  :)

I do quite like the cleanup.

-s
-- 
Listen, get this.  Nobody with a good compiler needs to be justified.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] external-sourcery: extract src and dest sysroot paths from gcc
  2012-06-01  4:06   ` Peter Seebach
@ 2012-06-01 13:59     ` Chris Larson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Larson @ 2012-06-01 13:59 UTC (permalink / raw)
  To: Peter Seebach; +Cc: Patches and discussions about the oe-core layer

On Thu, May 31, 2012 at 9:06 PM, Peter Seebach
<peter.seebach@windriver.com> wrote:
> On Thu, 31 May 2012 19:00:04 -0700
> Christopher Larson <kergoth@gmail.com> wrote:
>
>> +CSL_MULTILIB_ARGS[i586] = "-msgxx-glibc"
>> +CSL_MULTILIB_ARGS[i686] = "-msgxx-glibc"
>> +CSL_MULTILIB_ARGS[core2] = "-msgxx-glibc"
>> +CSL_MULTILIB_ARGS[x86] = "-msgxx-glibc"
>> +CSL_MULTILIB_ARGS[x86-64] = "-msgxx-glibc"
>> +CSL_MULTILIB_ARGS[ppce500] = "-te500v1"
>> +CSL_MULTILIB_ARGS[ppce500mc] = "-te500mc"
>> +CSL_MULTILIB_ARGS[ppce500v2] = "-te500v2"
>> +CSL_MULTILIB_ARGS[ppce600] = "-te600"
>
> I would suggest that these be ?= assignments.
>
> Rationale:  There is more than one Sourcery toolchain out there, and
> they sometimes differ in these.  It'd be nice if a hypothetical vendor
> using a hypothetical custom variant of the Sourcery toolchain could use
> these configuration files with nothing more than a few variable
> assignments.  :)

Good point, I'll change that and send a v2. Thanks.
-- 
Christopher Larson



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-01 14:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-01  2:00 [PATCH 0/3] More external toolchain fixes/improvements Christopher Larson
2012-06-01  2:00 ` [PATCH 1/3] external-sourcery: extract src and dest sysroot paths from gcc Christopher Larson
2012-06-01  4:06   ` Peter Seebach
2012-06-01 13:59     ` Chris Larson
2012-06-01  2:00 ` [PATCH 2/3] tcmode-external-sourcery: pass -msgxx-glibc for x86 Christopher Larson
2012-06-01  2:00 ` [PATCH 3/3] external-sourcery-toolchain: forcibly create usr/lib Christopher Larson
2012-06-01  2:01 ` [PATCH 0/3] More external toolchain fixes/improvements Christopher Larson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox