diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes/cross-canadian.bbclass | 53 |
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 | # |
| 17 | PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" | 17 | PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" |
| 18 | CANADIANEXTRAOS = "" | 18 | CANADIANEXTRAOS = "linux-uclibc linux-musl" |
| 19 | MODIFYTOS ??= "1" | 19 | MODIFYTOS ??= "1" |
| 20 | python () { | 20 | python () { |
| 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 | } |
| 50 | MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}" | 69 | MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}" |
| 51 | 70 | ||
