summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-25 14:47:52 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-27 23:29:16 +0100
commit5981ccff2e963928834c0e47094c62038945472d (patch)
tree3c1ef8156ee2eebdf1d64dadb217e91271e6874c
parent72777f4f2f66f4bb644b7513cc12bc1d284b51d1 (diff)
downloadpoky-5981ccff2e963928834c0e47094c62038945472d.tar.gz
cross-canadian: Put links in place for uclibc and musl
gcc-cross-canadian-<arch> is only built once. It needs to target all the different libcs, not just the currently selected one. This change ensures that if another libc is used, symlinks are present such that the compiler can be found. The base version is always assumed to be "glibc" with symlinks from musl and uclibc compiler names. This means gcc-cross-canadian is consistent regardless of which libc is selected when its build in multimachine builds. [YOCTO #8025] (From OE-Core rev: 83ead626c0da75edec2833ffb1a29011ec7b83d2) (From OE-Core rev: ee16cb0a3f40384f509083f0ef3f36b68f73b7cf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/cross-canadian.bbclass53
1 files changed, 36 insertions, 17 deletions
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index a8565e91e3..a4ce5c7b98 100644
--- a/meta/classes/cross-canadian.bbclass
+++ b/meta/classes/cross-canadian.bbclass
@@ -15,7 +15,7 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S
15# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS 15# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
16# 16#
17PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" 17PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
18CANADIANEXTRAOS = "" 18CANADIANEXTRAOS = "linux-uclibc linux-musl"
19MODIFYTOS ??= "1" 19MODIFYTOS ??= "1"
20python () { 20python () {
21 archs = d.getVar('PACKAGE_ARCHS', True).split() 21 archs = d.getVar('PACKAGE_ARCHS', True).split()
@@ -27,25 +27,44 @@ python () {
27 # Allow the following code segment to be disabled, e.g. meta-environment 27 # Allow the following code segment to be disabled, e.g. meta-environment
28 if d.getVar("MODIFYTOS", True) != "1": 28 if d.getVar("MODIFYTOS", True) != "1":
29 return 29 return
30 # PowerPC can build "linux" and "linux-gnuspe"
31 tarch = d.getVar("TARGET_ARCH", True)
32 if tarch == "powerpc":
33 tos = d.getVar("TARGET_OS", True)
34 if (tos != "linux" and tos != "linux-gnuspe"
35 and tos != "linux-uclibc" and tos != "linux-uclibcspe"
36 and tos != "linux-musl" and tos != "linux-muslspe"):
37 bb.fatal("Building cross-candian powerpc for an unknown TARGET_SYS (%s), please update cross-canadian.bbclass" % d.getVar("TARGET_SYS", True))
38 # This is a bit ugly. We need to zero LIBC/ABI extension which will change TARGET_OS
39 # however we need the old value in some variables. We expand those here first.
40 d.setVar("DEPENDS", d.getVar("DEPENDS", True))
41 d.setVar("STAGING_BINDIR_TOOLCHAIN", d.getVar("STAGING_BINDIR_TOOLCHAIN", True))
42 for prefix in ["AR", "AS", "DLLTOOL", "CC", "CXX", "GCC", "LD", "LIPO", "NM", "OBJDUMP", "RANLIB", "STRIP", "WINDRES"]:
43 n = prefix + "_FOR_TARGET"
44 d.setVar(n, d.getVar(n, True))
45 30
31 tos = d.getVar("TARGET_OS", True)
32 whitelist = []
33 for variant in ["", "spe", "x32", "eabi"]:
34 for libc in ["", "uclibc", "musl"]:
35 entry = "linux"
36 if variant and libc:
37 entry = entry + "-" + libc + variant
38 elif variant:
39 entry = entry + "-gnu" + variant
40 elif libc:
41 entry = entry + "-" + libc
42 whitelist.append(entry)
43 if tos not in whitelist:
44 bb.fatal("Building cross-candian for an unknown TARGET_SYS (%s), please update cross-canadian.bbclass" % d.getVar("TARGET_SYS", True))
45
46 for n in ["PROVIDES", "DEPENDS"]:
47 d.setVar(n, d.getVar(n, True))
48 d.setVar("STAGING_BINDIR_TOOLCHAIN", d.getVar("STAGING_BINDIR_TOOLCHAIN", True))
49 for prefix in ["AR", "AS", "DLLTOOL", "CC", "CXX", "GCC", "LD", "LIPO", "NM", "OBJDUMP", "RANLIB", "STRIP", "WINDRES"]:
50 n = prefix + "_FOR_TARGET"
51 d.setVar(n, d.getVar(n, True))
52 # This is a bit ugly. We need to zero LIBC/ABI extension which will change TARGET_OS
53 # however we need the old value in some variables. We expand those here first.
54 tarch = d.getVar("TARGET_ARCH", True)
55 if tarch == "x86_64":
56 d.setVar("LIBCEXTENSION", "")
57 d.setVar("ABIEXTENSION", "")
58 d.appendVar("CANADIANEXTRAOS", " linux-gnux32 linux-uclibcx32 linux-muslx32")
59 elif tarch == "powerpc":
60 # PowerPC can build "linux" and "linux-gnuspe"
46 d.setVar("LIBCEXTENSION", "") 61 d.setVar("LIBCEXTENSION", "")
47 d.setVar("ABIEXTENSION", "") 62 d.setVar("ABIEXTENSION", "")
48 d.setVar("CANADIANEXTRAOS", "linux-gnuspe") 63 d.appendVar("CANADIANEXTRAOS", " linux-gnuspe linux-uclibcspe linux-muslspe")
64 if tarch == "arm":
65 d.setVar("TARGET_OS", "linux-gnueabi")
66 else:
67 d.setVar("TARGET_OS", "linux")
49} 68}
50MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}" 69MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
51 70