diff options
author | Christopher Larson <chris_larson@mentor.com> | 2012-01-27 11:13:45 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-03 16:17:16 +0000 |
commit | c0d7e9b062117a844293e7b358601d959e03b981 (patch) | |
tree | 137579c082921d3d65d26ba54e4974d99e1f277d | |
parent | b942a8ee6a196631ba472225ebcdc058fd72d33a (diff) | |
download | poky-c0d7e9b062117a844293e7b358601d959e03b981.tar.gz |
external-csl-toolchain: support mips/ppc/arm
- Rather than adjusting TARGET_VENDOR, which results in our TARGET_SYS
matching the external toolchain, override TARGET_PREFIX to match external,
and leave TARGET_SYS alone
- Grab the optimized files out of the toolchain if available
- Create a symlink in sysroot to ensure the sysroot layout matches toolchain
expectations (optimized files in a subdir)
(From OE-Core rev: a37298eb3421a44e88ec5a66b2fc5305ab18f453)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/conf/distro/include/tcmode-external-csl.inc | 27 | ||||
-rw-r--r-- | meta/recipes-core/meta/external-csl-toolchain.bb | 32 |
2 files changed, 50 insertions, 9 deletions
diff --git a/meta/conf/distro/include/tcmode-external-csl.inc b/meta/conf/distro/include/tcmode-external-csl.inc index 0af3a45127..1d82ca1900 100644 --- a/meta/conf/distro/include/tcmode-external-csl.inc +++ b/meta/conf/distro/include/tcmode-external-csl.inc | |||
@@ -2,12 +2,20 @@ | |||
2 | # Configuration to use external CSL toolchain | 2 | # Configuration to use external CSL toolchain |
3 | # | 3 | # |
4 | 4 | ||
5 | TARGET_VENDOR = "-none" | ||
6 | |||
7 | EXTERNAL_TOOLCHAIN ?= "/usr/local/csl/${TARGET_ARCH}" | 5 | EXTERNAL_TOOLCHAIN ?= "/usr/local/csl/${TARGET_ARCH}" |
8 | 6 | ||
9 | PATH =. "${EXTERNAL_TOOLCHAIN}/bin:" | 7 | PATH =. "${EXTERNAL_TOOLCHAIN}/bin:" |
10 | 8 | ||
9 | CSL_TARGET_SYS_powerpc = "powerpc-linux-gnu" | ||
10 | CSL_TARGET_SYS_powerpc64 = "powerpc-linux-gnu" | ||
11 | CSL_TARGET_SYS_arm = "arm-none-linux-gnueabi" | ||
12 | CSL_TARGET_SYS_mips = "mips-linux-gnu" | ||
13 | CSL_TARGET_SYS_mipsel = "mips-linux-gnu" | ||
14 | CSL_TARGET_SYS_mips64 = "mips-linux-gnu" | ||
15 | CSL_TARGET_SYS = "${TARGET_SYS}" | ||
16 | |||
17 | TARGET_PREFIX = "${CSL_TARGET_SYS}-" | ||
18 | |||
11 | PREFERRED_PROVIDER_linux-libc-headers = "external-csl-toolchain" | 19 | PREFERRED_PROVIDER_linux-libc-headers = "external-csl-toolchain" |
12 | PREFERRED_PROVIDER_linux-libc-headers-dev = "external-csl-toolchain" | 20 | PREFERRED_PROVIDER_linux-libc-headers-dev = "external-csl-toolchain" |
13 | PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-csl-toolchain" | 21 | PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-csl-toolchain" |
@@ -28,3 +36,18 @@ TARGET_CPPFLAGS_prepend = " -isystem${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/include | |||
28 | TARGET_LDFLAGS_prepend = " -L${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/lib -Wl,-rpath-link,${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/lib " | 36 | TARGET_LDFLAGS_prepend = " -L${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/lib -Wl,-rpath-link,${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/lib " |
29 | 37 | ||
30 | TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}" | 38 | TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}" |
39 | |||
40 | # Translate to CodeSourcery's names for their optimized files in the toolchain | ||
41 | def csl_target_core(d): | ||
42 | coredata = { | ||
43 | 'armv7a-vfp-neon': 'armv7-a-neon', | ||
44 | 'mips': 'mips32', | ||
45 | 'mipsel': 'el', | ||
46 | 'ppce500': 'te500v1', | ||
47 | 'ppce500mc': 'te500mc', | ||
48 | 'ppce500v2': 'te500v2', | ||
49 | 'ppce600': 'te600' | ||
50 | } | ||
51 | return coredata.get(d.getVar('TUNE_PKGARCH', True), '') | ||
52 | |||
53 | CSL_TARGET_CORE = "${@csl_target_core(d)}" | ||
diff --git a/meta/recipes-core/meta/external-csl-toolchain.bb b/meta/recipes-core/meta/external-csl-toolchain.bb index f1e53328b4..37ea271eb1 100644 --- a/meta/recipes-core/meta/external-csl-toolchain.bb +++ b/meta/recipes-core/meta/external-csl-toolchain.bb | |||
@@ -25,25 +25,43 @@ PROVIDES = "\ | |||
25 | virtual/linux-libc-headers " | 25 | virtual/linux-libc-headers " |
26 | RPROVIDES = "glibc-utils libsegfault glibc-thread-db" | 26 | RPROVIDES = "glibc-utils libsegfault glibc-thread-db" |
27 | PACKAGES_DYNAMIC = "glibc-gconv-*" | 27 | PACKAGES_DYNAMIC = "glibc-gconv-*" |
28 | PR = "r2" | 28 | PR = "r3" |
29 | 29 | ||
30 | #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2" | 30 | #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2" |
31 | 31 | ||
32 | SRC_URI = "file://SUPPORTED" | 32 | SRC_URI = "file://SUPPORTED" |
33 | 33 | ||
34 | do_install() { | 34 | do_install() { |
35 | install -d ${D}${sysconfdir} ${D}${bindir} ${D}${sbindir} ${D}${base_bindir} ${D}${libdir} | 35 | install -d ${D}${sysconfdir} ${D}${bindir} ${D}${sbindir} ${D}${base_bindir} ${D}${libdir} |
36 | install -d ${D}${base_libdir} ${D}${base_sbindir} ${D}${datadir} | 36 | install -d ${D}${base_libdir} ${D}${base_sbindir} ${D}${datadir} ${D}/usr |
37 | 37 | ||
38 | cp -a ${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/libc/lib/* ${D}${base_libdir} | 38 | if [ -d ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE} ]; then |
39 | cp -a ${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/libc/etc/* ${D}${sysconfdir} | 39 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/lib/. ${D}${base_libdir} |
40 | cp -a ${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/libc/sbin/* ${D}${base_sbindir} | 40 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/etc/. ${D}${sysconfdir} |
41 | cp -a ${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/libc/usr/* ${D}/usr | 41 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/sbin/. ${D}${base_sbindir} |
42 | if [ ! -e ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/usr/include ]; then | ||
43 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/usr/include ${D}/usr/ | ||
44 | fi | ||
45 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/usr/. ${D}/usr/ | ||
46 | else | ||
47 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/lib/. ${D}${base_libdir} | ||
48 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/etc/. ${D}${sysconfdir} | ||
49 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/sbin/. ${D}${base_sbindir} | ||
50 | cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/usr/. ${D}/usr/ | ||
51 | fi | ||
42 | 52 | ||
43 | sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so | 53 | sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so |
44 | sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libpthread.so | 54 | sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libpthread.so |
45 | } | 55 | } |
46 | 56 | ||
57 | SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust" | ||
58 | external_toolchain_sysroot_adjust() { | ||
59 | if [ -n "${CSL_TARGET_CORE}" ]; then | ||
60 | rm -f ${SYSROOT_DESTDIR}/${CSL_TARGET_CORE} | ||
61 | ln -s . ${SYSROOT_DESTDIR}/${CSL_TARGET_CORE} | ||
62 | fi | ||
63 | } | ||
64 | |||
47 | GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "compile" | 65 | GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "compile" |
48 | 66 | ||
49 | PACKAGES += "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers linux-libc-headers-dev" | 67 | PACKAGES += "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers linux-libc-headers-dev" |