summaryrefslogtreecommitdiffstats
path: root/meta/conf/distro/include/tcmode-external-sourcery.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/conf/distro/include/tcmode-external-sourcery.inc')
-rw-r--r--meta/conf/distro/include/tcmode-external-sourcery.inc128
1 files changed, 0 insertions, 128 deletions
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 @@
1#
2# Configuration to use external Sourcery G++ toolchain
3#
4
5EXTERNAL_TOOLCHAIN ?= "/usr/local/csl/${TARGET_ARCH}"
6
7TOOLCHAIN_PATH_ADD = "${EXTERNAL_TOOLCHAIN}/bin:"
8PATH =. "${TOOLCHAIN_PATH_ADD}"
9
10CSL_TARGET_SYS_powerpc ?= "powerpc-linux-gnu"
11CSL_TARGET_SYS_powerpc64 ?= "powerpc-linux-gnu"
12CSL_TARGET_SYS_arm ?= "arm-none-linux-gnueabi"
13CSL_TARGET_SYS_mips ?= "mips-linux-gnu"
14CSL_TARGET_SYS_mipsel ?= "mips-linux-gnu"
15CSL_TARGET_SYS_mips64 ?= "mips-linux-gnu"
16CSL_TARGET_SYS_i686 ?= "i686-pc-linux-gnu"
17CSL_TARGET_SYS_i586 ?= "i686-pc-linux-gnu"
18CSL_TARGET_SYS = "${TARGET_SYS}"
19
20TARGET_PREFIX = "${CSL_TARGET_SYS}-"
21
22PREFERRED_PROVIDER_linux-libc-headers = "external-sourcery-toolchain"
23PREFERRED_PROVIDER_linux-libc-headers-dev = "external-sourcery-toolchain"
24PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "external-sourcery-toolchain"
25PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "external-sourcery-toolchain"
26PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-intermediate = "external-sourcery-toolchain"
27PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "external-sourcery-toolchain"
28PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "external-sourcery-toolchain"
29PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "external-sourcery-toolchain"
30PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "external-sourcery-toolchain"
31PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "external-sourcery-toolchain"
32PREFERRED_PROVIDER_libgcc = "external-sourcery-toolchain"
33PREFERRED_PROVIDER_eglibc = "external-sourcery-toolchain"
34PREFERRED_PROVIDER_virtual/libc = "external-sourcery-toolchain"
35PREFERRED_PROVIDER_virtual/libintl = "external-sourcery-toolchain"
36PREFERRED_PROVIDER_virtual/libiconv = "external-sourcery-toolchain"
37PREFERRED_PROVIDER_glibc-thread-db = "external-sourcery-toolchain"
38PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-sourcery-toolchain"
39PREFERRED_PROVIDER_virtual/linux-libc-headers-dev = "external-sourcery-toolchain"
40PREFERRED_PROVIDER_gdbserver ??= "external-sourcery-toolchain"
41
42# No need to re-compile the locale files
43GLIBC_INTERNAL_USE_BINARY_LOCALE = "precompiled"
44ENABLE_BINARY_LOCALE_GENERATION = ""
45
46TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_HOST}"
47
48# Point to the appropriate multilib sysroot from the external toolchain, whose
49# files will be extracted into the OE sysroot
50def exttc_run(d, cmd):
51 try:
52 return bb.process.run(cmd, shell=True, env={'PATH': d.getVar('PATH', True)})[0].rstrip()
53 except (OSError, bb.process.CmdError):
54 return ''
55
56EXTERNAL_TOOLCHAIN_SYSROOT_CMD = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} -print-sysroot"
57EXTERNAL_TOOLCHAIN_SYSROOT ??= "${@exttc_run(d, EXTERNAL_TOOLCHAIN_SYSROOT_CMD)}"
58
59# These bits are here temporarily to sidestep the need to use a separate set
60# of tune files to pass the appropriate multilib selection arguments to the
61# sourcery toolchain, as is needed to extract the sysroot content.
62TUNE_CCARGS_append_x86 = " -msgxx-glibc"
63
64CSL_MULTILIB_ARGS[ppce500] ?= "-te500v1"
65CSL_MULTILIB_ARGS[ppce500mc] ?= "-te500mc"
66CSL_MULTILIB_ARGS[ppce500v2] ?= "-te500v2"
67CSL_MULTILIB_ARGS[ppce600] ?= "-te600"
68
69def 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
76EXTERNAL_TOOLCHAIN_SYSROOT_CMD += "${@csl_multilib_arg(d)}"
77
78
79# Unfortunately, the CSL ia32 toolchain has non-prefixed binaries in its
80# bindir (e.g. gcc, ld). To avoid this messing up our build, we avoid adding
81# this bindir to our PATH, and instead add symlinks to the prefixed binaries
82# to our staging toolchain bindir.
83
84python toolchain_metadata_setup () {
85 d = e.data
86
87 l = d.createCopy()
88 l.finalize()
89 if os.path.exists(bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/gcc', l)):
90 d.setVar('TOOLCHAIN_PATH_ADD', '')
91}
92addhandler toolchain_metadata_setup
93toolchain_metadata_setup[eventmask] = "bb.event.ConfigParsed"
94
95python toolchain_setup () {
96 d = e.data
97
98 if not d.getVar('TOOLCHAIN_PATH_ADD', True):
99 populate_toolchain_links(d)
100}
101addhandler toolchain_setup
102toolchain_setup[eventmask] = "bb.event.BuildStarted"
103
104def populate_toolchain_links(d):
105 import errno
106 from glob import glob
107
108 d = d.createCopy()
109 d.finalize()
110
111 pattern = d.expand('${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}*')
112 files = glob(pattern)
113 if not files:
114 bb.fatal("Unable to populate toolchain binary symlinks in %s" % pattern)
115
116 bindir = d.getVar('STAGING_BINDIR_TOOLCHAIN', True)
117 bb.utils.mkdirhier(bindir)
118 for f in files:
119 base = os.path.basename(f)
120 newpath = os.path.join(bindir, base)
121 try:
122 os.symlink(f, newpath)
123 except OSError as exc:
124 if exc.errno == errno.EEXIST:
125 break
126 bb.fatal("Unable to populate toolchain binary symlink for %s: %s" % (newpath, exc))
127
128require conf/distro/include/csl-versions.inc