aboutsummaryrefslogtreecommitdiffstats
path: root/meta/conf
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-12-12 16:07:05 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-12 22:31:12 +0000
commit7603b15415301679bccbcb89af688c211704a43a (patch)
treeffd67070d477df09dcebaba3724e8239c3a86b81 /meta/conf
parent3c4557df95e3c60ef938c53f00bb1d7f765fe0ef (diff)
downloadopenembedded-core-contrib-7603b15415301679bccbcb89af688c211704a43a.tar.gz
external-sourcery-toolchain: remove
As per discussion on the mailing list [1], remove this largely unmaintained external toolchain support in favour of the maintained version in meta-sourcery [2]. Also correct the example and documentation.conf entries for TCMODE to match up with this change. [1] http://lists.openembedded.org/pipermail/openembedded-core/2013-December/087133.html [2] https://github.com/MentorEmbedded/meta-sourcery/ Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf')
-rw-r--r--meta/conf/distro/include/csl-versions.inc107
-rw-r--r--meta/conf/distro/include/tcmode-external-csl.inc2
-rw-r--r--meta/conf/distro/include/tcmode-external-sourcery.inc128
-rw-r--r--meta/conf/documentation.conf2
-rw-r--r--meta/conf/local.conf.sample.extended20
5 files changed, 16 insertions, 243 deletions
diff --git a/meta/conf/distro/include/csl-versions.inc b/meta/conf/distro/include/csl-versions.inc
deleted file mode 100644
index 3938bf7ed2..0000000000
--- a/meta/conf/distro/include/csl-versions.inc
+++ /dev/null
@@ -1,107 +0,0 @@
-def csl_run(d, cmd, *args):
- import bb.process
- import subprocess
-
- topdir = d.getVar('TOPDIR', True)
- toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN', True)
- if not toolchain_path:
- return 'UNKNOWN', 'UNKNOWN'
-
- target_prefix = d.getVar('TARGET_PREFIX', True)
- path = os.path.join(toolchain_path, 'bin', target_prefix + cmd)
- args = [path] + list(args)
-
- return bb.process.run(args, cwd=topdir, stderr=subprocess.PIPE)
-
-def csl_get_version(d):
- try:
- stdout, stderr = csl_run(d, 'gcc', '-v')
- except bb.process.CmdError as exc:
- bb.error('Failed to obtain CodeSourcery toolchain version: %s' % exc)
- bb.error('Make sure that MACHINE is set correctly in your local.conf and the toolchain supports %s.' % d.getVar("TARGET_ARCH", True))
- return 'UNKNOWN'
- else:
- last_line = stderr.splitlines()[-1]
- return last_line
-
-def csl_get_main_version(d):
- version = csl_get_version(d)
- if version != 'UNKNOWN':
- return version.split()[-1].rstrip(')')
- else:
- return version
-
-def csl_get_gcc_version(d):
- version = csl_get_version(d)
- if version != 'UNKNOWN':
- return version.split()[2]
- else:
- return version
-
-def csl_get_libc_version(d):
- syspath = d.expand('${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}')
- if not syspath:
- return 'UNKNOWN'
-
- libpath = syspath + '/libc/lib/'
- if not os.path.exists(libpath):
- libpath = syspath + '/libc/sgxx-glibc/lib/'
-
- if os.path.exists(libpath):
- for file in os.listdir(libpath):
- if file.find('libc-') == 0:
- return file[5:-3]
- return 'UNKNOWN'
-
-def csl_get_kernel_version(d):
- syspath = d.expand('${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}')
- if not syspath:
- return 'UNKNOWN'
-
- vf = syspath + '/libc/usr/include/linux/version.h'
- if not os.path.exists(vf):
- vf = syspath + '/libc/sgxx-glibc/usr/include/linux/version.h'
-
- try:
- f = open(vf, 'r')
- except (OSError, IOError):
- return 'UNKNOWN'
-
- l = f.readlines();
- f.close();
- for s in l:
- if s.find('LINUX_VERSION_CODE') > 0:
- ver = int(s.split()[2])
- maj = ver / 65536
- ver = ver % 65536
- min = ver / 256
- ver = ver % 256
- return str(maj)+'.'+str(min)+'.'+str(ver)
- return 'UNKNOWN'
-
-def csl_get_gdb_version(d):
- try:
- stdout, stderr = csl_run(d, 'gdb', '-v')
- except bb.process.CmdError:
- return 'UNKNOWN'
- else:
- first_line = stdout.splitlines()[0]
- return first_line.split()[-1]
-
-python csl_version_handler () {
- d = e.data
- ld = d.createCopy()
- ld.finalize()
-
- d.setVar('CSL_VER_MAIN', csl_get_main_version(ld))
- d.setVar('CSL_VER_GCC', csl_get_gcc_version(ld))
- d.setVar('CSL_VER_LIBC', csl_get_libc_version(ld))
- d.setVar('CSL_VER_KERNEL', csl_get_kernel_version(ld))
- d.setVar('CSL_VER_GDB', csl_get_gdb_version(ld))
-}
-addhandler csl_version_handler
-csl_version_handler[eventmask] = "bb.event.ConfigParsed"
-
-# Ensure that any variable which includes the --sysroot (CC, CXX, etc) also
-# depends on the toolchain version
-TOOLCHAIN_OPTIONS[vardeps] += "CSL_VER_MAIN CSL_VER_GCC"
diff --git a/meta/conf/distro/include/tcmode-external-csl.inc b/meta/conf/distro/include/tcmode-external-csl.inc
deleted file mode 100644
index 9e530ab1e7..0000000000
--- a/meta/conf/distro/include/tcmode-external-csl.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-TCMODE = "external-sourcery"
-require conf/distro/include/tcmode-${TCMODE}.inc
diff --git a/meta/conf/distro/include/tcmode-external-sourcery.inc b/meta/conf/distro/include/tcmode-external-sourcery.inc
deleted file mode 100644
index 5590f7a1e9..0000000000
--- a/meta/conf/distro/include/tcmode-external-sourcery.inc
+++ /dev/null
@@ -1,128 +0,0 @@
-#
-# Configuration to use external Sourcery G++ toolchain
-#
-
-EXTERNAL_TOOLCHAIN ?= "/usr/local/csl/${TARGET_ARCH}"
-
-TOOLCHAIN_PATH_ADD = "${EXTERNAL_TOOLCHAIN}/bin:"
-PATH =. "${TOOLCHAIN_PATH_ADD}"
-
-CSL_TARGET_SYS_powerpc ?= "powerpc-linux-gnu"
-CSL_TARGET_SYS_powerpc64 ?= "powerpc-linux-gnu"
-CSL_TARGET_SYS_arm ?= "arm-none-linux-gnueabi"
-CSL_TARGET_SYS_mips ?= "mips-linux-gnu"
-CSL_TARGET_SYS_mipsel ?= "mips-linux-gnu"
-CSL_TARGET_SYS_mips64 ?= "mips-linux-gnu"
-CSL_TARGET_SYS_i686 ?= "i686-pc-linux-gnu"
-CSL_TARGET_SYS_i586 ?= "i686-pc-linux-gnu"
-CSL_TARGET_SYS = "${TARGET_SYS}"
-
-TARGET_PREFIX = "${CSL_TARGET_SYS}-"
-
-PREFERRED_PROVIDER_linux-libc-headers = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_linux-libc-headers-dev = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-intermediate = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_libgcc = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_eglibc = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/libc = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/libintl = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/libiconv = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_glibc-thread-db = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_virtual/linux-libc-headers-dev = "external-sourcery-toolchain"
-PREFERRED_PROVIDER_gdbserver ??= "external-sourcery-toolchain"
-
-# No need to re-compile the locale files
-GLIBC_INTERNAL_USE_BINARY_LOCALE = "precompiled"
-ENABLE_BINARY_LOCALE_GENERATION = ""
-
-TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}"
-
-# 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.
-TUNE_CCARGS_append_x86 = " -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
-# this bindir to our PATH, and instead add symlinks to the prefixed binaries
-# to our staging toolchain bindir.
-
-python toolchain_metadata_setup () {
- d = e.data
-
- l = d.createCopy()
- l.finalize()
- if os.path.exists(bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/gcc', l)):
- d.setVar('TOOLCHAIN_PATH_ADD', '')
-}
-addhandler toolchain_metadata_setup
-toolchain_metadata_setup[eventmask] = "bb.event.ConfigParsed"
-
-python toolchain_setup () {
- d = e.data
-
- if not d.getVar('TOOLCHAIN_PATH_ADD', True):
- populate_toolchain_links(d)
-}
-addhandler toolchain_setup
-toolchain_setup[eventmask] = "bb.event.BuildStarted"
-
-def populate_toolchain_links(d):
- import errno
- from glob import glob
-
- d = d.createCopy()
- d.finalize()
-
- pattern = d.expand('${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}*')
- files = glob(pattern)
- if not files:
- bb.fatal("Unable to populate toolchain binary symlinks in %s" % pattern)
-
- bindir = d.getVar('STAGING_BINDIR_TOOLCHAIN', True)
- bb.utils.mkdirhier(bindir)
- for f in files:
- base = os.path.basename(f)
- newpath = os.path.join(bindir, base)
- try:
- os.symlink(f, newpath)
- except OSError as exc:
- if exc.errno == errno.EEXIST:
- break
- bb.fatal("Unable to populate toolchain binary symlink for %s: %s" % (newpath, exc))
-
-require conf/distro/include/csl-versions.inc
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index a40b0b87da..c96ddd31bf 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -260,7 +260,7 @@ TARGET_OS[doc] = "Specifies the target's operating system."
TARGET_PREFIX[doc] = "The prefix for the cross compile toolchain. E.g arm-linux- ."
TARGET_SYS[doc] = "The target system is composed out of TARGET_ARCH,TARGET_VENDOR and TARGET_OS."
TCLIBC[doc] = "Specifies which variant of the GNU standard C library (libc) to use during the build process. You can select eglibc or uclibc."
-TCMODE[doc] = "The toolchain selector. It selects the external toolchain built using the OpenEmbedded build system or a few supported combinations of the upstream GCC or CodeSourcery Labs toolchain."
+TCMODE[doc] = "Enables an external toolchain (where provided by an additional layer) if set to a value other than 'default'."
TEST_IMAGE[doc] = "Enable test booting of virtual machine images under the qemu emulator after any root filesystems are created and run tests against those images."
TIME[doc] = "The time the build was started HMS"
TMPDIR[doc] = "This variable is the temporary directory the OpenEmbedded build system uses when it does its work building images. By default, the TMPDIR variable is named tmp within the Build Directory."
diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/local.conf.sample.extended
index 00716f9bf2..9585432bc6 100644
--- a/meta/conf/local.conf.sample.extended
+++ b/meta/conf/local.conf.sample.extended
@@ -78,11 +78,21 @@
# TCMODE controls the characteristics of the generated packages/images by
# telling poky which toolchain 'profile' to use.
#
-# The default is "default"
-# Use "external-MODE" to use the precompiled external toolchains where MODE
-# is the type of external toolchain to use e.g. eabi. You need to ensure
-# the toolchain you want to use is included in an appropriate layer
-# TCMODE ?= "external-eabi"
+# The default is "default" which uses the internal toolchain. With
+# additional layers, it is possible to set this to use a precompiled
+# external toolchain. One example is the Sourcery G++ Toolchain, support
+# for which is now in the separate meta-sourcery layer:
+#
+# http://github.com/MentorEmbedded/meta-sourcery/
+#
+# meta-sourcery can be used as a template for adding support for other
+# external toolchains. See the link above for further details.
+#
+# TCMODE points the system to a file in conf/distro/include/tcmode-${TCMODE}.inc,
+# so for meta-sourcery which has conf/distro/include/tcmode-external-sourcery.inc
+# you would set it as follows:
+#
+# TCMODE ?= "external-sourcery"
# mklibs library size optimization is more useful to smaller images,
# and less useful for bigger images. Also mklibs library optimization