Patchwork gcc-cross-kernel: update to match new toolchain sysroot layout

login
register
mail settings
Submitter Koen Kooi
Date June 27, 2011, 4:56 p.m.
Message ID <1309193802-17201-1-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/6537/
State New, archived
Headers show

Comments

Koen Kooi - June 27, 2011, 4:56 p.m.
The versioned gcc binary gets installed and the needed binutils symlinks are made.

To make it fully work again the following is needed in kernel recipes/classes:

PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.gcc-cross-kernel:"

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/recipes-devtools/gcc/gcc-cross-kernel.inc |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
Richard Purdie - June 28, 2011, 2:04 p.m.
On Mon, 2011-06-27 at 18:56 +0200, Koen Kooi wrote:
> The versioned gcc binary gets installed and the needed binutils symlinks are made.
> 
> To make it fully work again the following is needed in kernel recipes/classes:
> 
> PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.gcc-cross-kernel:"
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>

Merged to master, thanks.

Richard

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-cross-kernel.inc b/meta/recipes-devtools/gcc/gcc-cross-kernel.inc
index 5347762..be772ba 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-kernel.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-kernel.inc
@@ -6,5 +6,14 @@  PROVIDES = "virtual/${TARGET_PREFIX}gcc-${PV}"
 do_install () {
 	cd gcc
 	oe_runmake 'DESTDIR=${D}' install-common install-headers install-libgcc
-	install -m 0755 xgcc ${D}${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gcc-${PV}
+	install -m 0755 xgcc  ${D}${bindir}/${TARGET_PREFIX}gcc-${PV}
+
+    # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+    # found. These need to be relative paths so they work in different locations.
+    dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+    install -d $dest
+    for t in ar as ld nm objcopy objdump ranlib strip cpp; do
+        ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+        ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
+    done
 }