diff options
-rw-r--r-- | meta/conf/distro/include/tcmode-external-sourcery.inc | 51 | ||||
-rw-r--r-- | meta/recipes-core/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 79fef25bd0..ede4403d4c 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 = "" | |||
42 | 42 | ||
43 | TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}" | 43 | TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}" |
44 | 44 | ||
45 | # Translate to CodeSourcery's names for their optimized files in the toolchain | 45 | # Point to the appropriate multilib sysroot from the external toolchain, whose |
46 | def csl_target_core(d): | 46 | # files will be extracted into the OE sysroot |
47 | coredata = { | 47 | def exttc_run(d, cmd): |
48 | 'armv7a-vfp-neon': 'armv7-a-neon', | 48 | try: |
49 | 'i586': 'sgxx-glibc', | 49 | return bb.process.run(cmd, shell=True, env={'PATH': d.getVar('PATH', True)})[0].rstrip() |
50 | 'i686': 'sgxx-glibc', | 50 | except (OSError, bb.process.CmdError): |
51 | 'core2': 'sgxx-glibc', | 51 | return '' |
52 | 'mips': 'mips32', | 52 | |
53 | 'mipsel': 'el', | 53 | EXTERNAL_TOOLCHAIN_SYSROOT_CMD = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} -print-sysroot" |
54 | 'powerpc-nf': 'nof', | 54 | EXTERNAL_TOOLCHAIN_SYSROOT ??= "${@exttc_run(d, EXTERNAL_TOOLCHAIN_SYSROOT_CMD)}" |
55 | 'ppce500': 'te500v1', | 55 | |
56 | 'ppce500mc': 'te500mc', | 56 | # These bits are here temporarily to sidestep the need to use a separate set |
57 | 'ppce500v2': 'te500v2', | 57 | # of tune files to pass the appropriate multilib selection arguments to the |
58 | 'ppce600': 'te600' | 58 | # sourcery toolchain, as is needed to extract the sysroot content. |
59 | } | 59 | CSL_MULTILIB_ARGS[i586] ?= "-msgxx-glibc" |
60 | return coredata.get(d.getVar('TUNE_PKGARCH', True), '') | 60 | CSL_MULTILIB_ARGS[i686] ?= "-msgxx-glibc" |
61 | 61 | CSL_MULTILIB_ARGS[core2] ?= "-msgxx-glibc" | |
62 | CSL_TARGET_CORE ?= "${@csl_target_core(d)}" | 62 | CSL_MULTILIB_ARGS[x86] ?= "-msgxx-glibc" |
63 | CSL_MULTILIB_ARGS[x86-64] ?= "-msgxx-glibc" | ||
64 | CSL_MULTILIB_ARGS[ppce500] ?= "-te500v1" | ||
65 | CSL_MULTILIB_ARGS[ppce500mc] ?= "-te500mc" | ||
66 | CSL_MULTILIB_ARGS[ppce500v2] ?= "-te500v2" | ||
67 | CSL_MULTILIB_ARGS[ppce600] ?= "-te600" | ||
68 | |||
69 | def csl_multilib_arg(d): | ||
70 | argument = d.getVarFlag('CSL_MULTILIB_ARGS', d.getVar('DEFAULTTUNE', True) or '') | ||
71 | if argument: | ||
72 | return argument | ||
73 | else: | ||
74 | return '' | ||
75 | |||
76 | EXTERNAL_TOOLCHAIN_SYSROOT_CMD += "${@csl_multilib_arg(d)}" | ||
77 | |||
63 | 78 | ||
64 | # Unfortunately, the CSL ia32 toolchain has non-prefixed binaries in its | 79 | # Unfortunately, the CSL ia32 toolchain has non-prefixed binaries in its |
65 | # bindir (e.g. gcc, ld). To avoid this messing up our build, we avoid adding | 80 | # 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 b8cb6d9baf..b67410b6d1 100644 --- a/meta/recipes-core/meta/external-sourcery-toolchain.bb +++ b/meta/recipes-core/meta/external-sourcery-toolchain.bb | |||
@@ -24,7 +24,7 @@ PROVIDES += "\ | |||
24 | virtual/linux-libc-headers \ | 24 | virtual/linux-libc-headers \ |
25 | " | 25 | " |
26 | PV = "${CSL_VER_MAIN}" | 26 | PV = "${CSL_VER_MAIN}" |
27 | PR = "r5" | 27 | PR = "r6" |
28 | 28 | ||
29 | #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2" | 29 | #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2" |
30 | 30 | ||
@@ -32,10 +32,7 @@ SRC_URI = "file://SUPPORTED" | |||
32 | 32 | ||
33 | do_install() { | 33 | do_install() { |
34 | # Use optimized files if available | 34 | # Use optimized files if available |
35 | sysroot="${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc" | 35 | sysroot="${EXTERNAL_TOOLCHAIN_SYSROOT}" |
36 | if [ -d $sysroot/${CSL_TARGET_CORE} ]; then | ||
37 | sysroot="$sysroot/${CSL_TARGET_CORE}" | ||
38 | fi | ||
39 | 36 | ||
40 | cp -a $sysroot${base_libdir}/. ${D}${base_libdir} | 37 | cp -a $sysroot${base_libdir}/. ${D}${base_libdir} |
41 | cp -a $sysroot/etc/. ${D}${sysconfdir} | 38 | cp -a $sysroot/etc/. ${D}${sysconfdir} |
@@ -76,15 +73,11 @@ do_install() { | |||
76 | 73 | ||
77 | SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust" | 74 | SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust" |
78 | external_toolchain_sysroot_adjust() { | 75 | external_toolchain_sysroot_adjust() { |
79 | if [ -n "${CSL_TARGET_CORE}" ]; then | 76 | dest_sysroot="$(${CC} -print-sysroot | sed -e's,^${STAGING_DIR_HOST},,; s,/$,,')" |
80 | rm -f ${SYSROOT_DESTDIR}/${CSL_TARGET_CORE} | 77 | if [ -n "$dest_sysroot" ]; then |
81 | ln -s . ${SYSROOT_DESTDIR}/${CSL_TARGET_CORE} | 78 | rm -f ${SYSROOT_DESTDIR}/$dest_sysroot |
82 | fi | 79 | ln -s . ${SYSROOT_DESTDIR}/$dest_sysroot |
83 | 80 | fi | |
84 | if [ "${TUNE_PKGARCH}" = "i586" ]; then | ||
85 | rm -f ${SYSROOT_DESTDIR}/system32 | ||
86 | ln -s . ${SYSROOT_DESTDIR}/system32 | ||
87 | fi | ||
88 | } | 81 | } |
89 | 82 | ||
90 | PACKAGES =+ "libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev linux-libc-headers linux-libc-headers-dev gdbserver gdbserver-dbg" | 83 | PACKAGES =+ "libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev linux-libc-headers linux-libc-headers-dev gdbserver gdbserver-dbg" |