diff options
author | Mark Hatle <mark.hatle@xilinx.com> | 2020-02-24 12:14:48 -0800 |
---|---|---|
committer | Mark Hatle <mark.hatle@xilinx.com> | 2020-02-27 08:36:00 -0800 |
commit | 4f3edb6da405ffff957d6f194bc7db7bdd9f1463 (patch) | |
tree | 50895bd7e0126620749adff252f5eb6b9da84540 | |
parent | c6fc0f9a034a3a3c8748e0a650f8728f8c044065 (diff) | |
download | meta-xilinx-4f3edb6da405ffff957d6f194bc7db7bdd9f1463.tar.gz |
xlnx-compatible-os.bbclass: Class to allow recipes to list OS compatibility
Following the example of base.bbclass in OE-Core, a new COMPATIBLE_OS
variable is defined. Similar to COMPATIBLE_MACHINE, it is a regex that
can be used to declare TARGET_OS string compatibility on a per-recipe
basis. Either the distro configuration or the recipes themselves will
need to inherit this class.
By default the class assumes we're building a Linux based system, and
thus any recipe who has not declared compatibility is compatible with
Linux. The default compatible field was copied from bitbake.conf to
ensure there are no surprised.
Additionally, enable the usage of this class throughout
meta-xilinx-standalone layer.
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
14 files changed, 48 insertions, 1 deletions
diff --git a/meta-xilinx-standalone/classes/esw.bbclass b/meta-xilinx-standalone/classes/esw.bbclass index 65817825..4a815eb6 100644 --- a/meta-xilinx-standalone/classes/esw.bbclass +++ b/meta-xilinx-standalone/classes/esw.bbclass | |||
@@ -1,4 +1,4 @@ | |||
1 | inherit pkgconfig cmake yocto-cmake-translation | 1 | inherit pkgconfig cmake |
2 | 2 | ||
3 | LICENSE = "Proprietary" | 3 | LICENSE = "Proprietary" |
4 | LICFILENAME = "license.txt" | 4 | LICFILENAME = "license.txt" |
@@ -37,6 +37,9 @@ COMPATIBLE_MACHINE_cortexr5-zynqmp = "cortexr5-zynqmp" | |||
37 | COMPATIBLE_HOST_cortexa72-versal = "aarch64.*-elf" | 37 | COMPATIBLE_HOST_cortexa72-versal = "aarch64.*-elf" |
38 | COMPATIBLE_MACHINE_cortexa72-versal = "cortexa72-versal" | 38 | COMPATIBLE_MACHINE_cortexa72-versal = "cortexa72-versal" |
39 | 39 | ||
40 | COMPATIBLE_OS = "elf" | ||
41 | COMPATIBLE_OS_arm = "eabi" | ||
42 | |||
40 | DTBFILE_microblaze-pmu ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" | 43 | DTBFILE_microblaze-pmu ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" |
41 | DTBFILE_microblaze-plm ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" | 44 | DTBFILE_microblaze-plm ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" |
42 | DTBFILE_cortexa53-zynqmp ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" | 45 | DTBFILE_cortexa53-zynqmp ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" |
diff --git a/meta-xilinx-standalone/classes/xlnx-compatible-os.bbclass b/meta-xilinx-standalone/classes/xlnx-compatible-os.bbclass new file mode 100644 index 00000000..4b06ddd8 --- /dev/null +++ b/meta-xilinx-standalone/classes/xlnx-compatible-os.bbclass | |||
@@ -0,0 +1,16 @@ | |||
1 | # We assume everything is Linux compatible, deviations to this | ||
2 | # must define their own compatible OS | ||
3 | COMPATIBLE_OS ?= "linux${LIBCEXTENSION}${ABIEXTENSION}" | ||
4 | |||
5 | python() { | ||
6 | # Only do this check for target recipes | ||
7 | if d.getVar('CLASSOVERRIDE') != "class-target": | ||
8 | return | ||
9 | |||
10 | need_os = d.getVar('COMPATIBLE_OS') | ||
11 | if need_os: | ||
12 | import re | ||
13 | target_os = d.getVar('TARGET_OS') | ||
14 | if not re.match(need_os, target_os): | ||
15 | raise bb.parse.SkipRecipe("incompatible with os %s (not in COMPATIBLE_OS '%s')" % (target_os, need_os)) | ||
16 | } | ||
diff --git a/meta-xilinx-standalone/conf/distro/xilinx-standalone.inc b/meta-xilinx-standalone/conf/distro/xilinx-standalone.inc index 4202bf6f..1be2b647 100644 --- a/meta-xilinx-standalone/conf/distro/xilinx-standalone.inc +++ b/meta-xilinx-standalone/conf/distro/xilinx-standalone.inc | |||
@@ -23,3 +23,11 @@ INHERIT += "buildhistory" | |||
23 | 23 | ||
24 | # Cortex R5 requires an additional cflag to be passed for compatibility with the embeddedsw | 24 | # Cortex R5 requires an additional cflag to be passed for compatibility with the embeddedsw |
25 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexr5', ' -DARMR5', '', d)}" | 25 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexr5', ' -DARMR5', '', d)}" |
26 | |||
27 | INHERIT += "xlnx-compatible-os" | ||
28 | |||
29 | # Clear defaults | ||
30 | DISTRO_FEATURES_BACKFILL_xilinx-standalone = "" | ||
31 | VIRTUAL-RUNTIME_init_manager_xilinx-standalone = "" | ||
32 | |||
33 | PREFERRED_PROVIDER_virtual/kernel = "linux-dummy" | ||
diff --git a/meta-xilinx-standalone/recipes-bsp/device-tree/device-tree.bbappend b/meta-xilinx-standalone/recipes-bsp/device-tree/device-tree.bbappend index 69b1ff5f..970f97fc 100644 --- a/meta-xilinx-standalone/recipes-bsp/device-tree/device-tree.bbappend +++ b/meta-xilinx-standalone/recipes-bsp/device-tree/device-tree.bbappend | |||
@@ -4,6 +4,8 @@ COMPATIBLE_MACHINE_microblaze-pmu = ".*" | |||
4 | COMPATIBLE_MACHINE_microblaze-plm = ".*" | 4 | COMPATIBLE_MACHINE_microblaze-plm = ".*" |
5 | COMPATIBLE_MACHINE_cortexa72-versal = ".*" | 5 | COMPATIBLE_MACHINE_cortexa72-versal = ".*" |
6 | 6 | ||
7 | COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | ||
8 | |||
7 | REPO_cortexa53-zynqmp = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" | 9 | REPO_cortexa53-zynqmp = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" |
8 | REPO_cortexr5-zynqmp = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" | 10 | REPO_cortexr5-zynqmp = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" |
9 | REPO_microblaze-pmu = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" | 11 | REPO_microblaze-pmu = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" |
diff --git a/meta-xilinx-standalone/recipes-bsp/hdf/external-hdf.bbappend b/meta-xilinx-standalone/recipes-bsp/hdf/external-hdf.bbappend new file mode 100644 index 00000000..0efa796c --- /dev/null +++ b/meta-xilinx-standalone/recipes-bsp/hdf/external-hdf.bbappend | |||
@@ -0,0 +1 @@ | |||
COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | |||
diff --git a/meta-xilinx-standalone/recipes-core/meta/meta-toolchain.bbappend b/meta-xilinx-standalone/recipes-core/meta/meta-toolchain.bbappend index 0b4812d0..cd8638ef 100644 --- a/meta-xilinx-standalone/recipes-core/meta/meta-toolchain.bbappend +++ b/meta-xilinx-standalone/recipes-core/meta/meta-toolchain.bbappend | |||
@@ -1 +1,3 @@ | |||
1 | COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | ||
2 | |||
1 | TOOLCHAIN_TARGET_TASK_xilinx-standalone = "${@multilib_pkg_extend(d, 'packagegroup-newlib-standalone-sdk-target')}" | 3 | TOOLCHAIN_TARGET_TASK_xilinx-standalone = "${@multilib_pkg_extend(d, 'packagegroup-newlib-standalone-sdk-target')}" |
diff --git a/meta-xilinx-standalone/recipes-core/newlib/libgloss_3.1.0.bbappend b/meta-xilinx-standalone/recipes-core/newlib/libgloss_3.1.0.bbappend index c5dda818..aaf4b77f 100644 --- a/meta-xilinx-standalone/recipes-core/newlib/libgloss_3.1.0.bbappend +++ b/meta-xilinx-standalone/recipes-core/newlib/libgloss_3.1.0.bbappend | |||
@@ -1,3 +1,6 @@ | |||
1 | COMPATIBLE_OS_xilinx-standalone = "elf" | ||
2 | COMPATIBLE_OS_arm_xilinx-standalone = "eabi" | ||
3 | |||
1 | # When building multiple, we need to depend on the multilib newlib | 4 | # When building multiple, we need to depend on the multilib newlib |
2 | DEPENDS_append_xilinx-standalone = " ${MLPREFIX}newlib" | 5 | DEPENDS_append_xilinx-standalone = " ${MLPREFIX}newlib" |
3 | 6 | ||
diff --git a/meta-xilinx-standalone/recipes-core/newlib/newlib_3.1.0.bbappend b/meta-xilinx-standalone/recipes-core/newlib/newlib_3.1.0.bbappend index d57f97b1..4e2533d0 100644 --- a/meta-xilinx-standalone/recipes-core/newlib/newlib_3.1.0.bbappend +++ b/meta-xilinx-standalone/recipes-core/newlib/newlib_3.1.0.bbappend | |||
@@ -1,3 +1,5 @@ | |||
1 | COMPATIBLE_OS_xilinx-standalone = "elf" | ||
2 | COMPATIBLE_OS_arm_xilinx-standalone = "eabi" | ||
1 | 3 | ||
2 | EXTRA_OECONF_append_xilinx-standalone = " \ | 4 | EXTRA_OECONF_append_xilinx-standalone = " \ |
3 | --enable-newlib-io-c99-formats \ | 5 | --enable-newlib-io-c99-formats \ |
diff --git a/meta-xilinx-standalone/recipes-core/packagegroups/packagegroup-newlib-standalone-sdk-target.bb b/meta-xilinx-standalone/recipes-core/packagegroups/packagegroup-newlib-standalone-sdk-target.bb index d943938b..6f06f61a 100644 --- a/meta-xilinx-standalone/recipes-core/packagegroups/packagegroup-newlib-standalone-sdk-target.bb +++ b/meta-xilinx-standalone/recipes-core/packagegroups/packagegroup-newlib-standalone-sdk-target.bb | |||
@@ -1,3 +1,5 @@ | |||
1 | COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | ||
2 | |||
1 | SUMMARY = "Target packages for the standalone SDK" | 3 | SUMMARY = "Target packages for the standalone SDK" |
2 | 4 | ||
3 | PACKAGE_ARCH = "${TUNE_PKGARCH}" | 5 | PACKAGE_ARCH = "${TUNE_PKGARCH}" |
diff --git a/meta-xilinx-standalone/recipes-devtools/gcc/gcc-runtime_%.bbappend b/meta-xilinx-standalone/recipes-devtools/gcc/gcc-runtime_%.bbappend index 0d25e066..d4220640 100644 --- a/meta-xilinx-standalone/recipes-devtools/gcc/gcc-runtime_%.bbappend +++ b/meta-xilinx-standalone/recipes-devtools/gcc/gcc-runtime_%.bbappend | |||
@@ -1,3 +1,5 @@ | |||
1 | COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | ||
2 | |||
1 | # Copy of gcc-xilinx-standalone.inc, but with _class-target added | 3 | # Copy of gcc-xilinx-standalone.inc, but with _class-target added |
2 | LINKER_HASH_STYLE_xilinx-standalone_class-target = "" | 4 | LINKER_HASH_STYLE_xilinx-standalone_class-target = "" |
3 | SYMVERS_CONF_xilinx-standalone_class-target = "" | 5 | SYMVERS_CONF_xilinx-standalone_class-target = "" |
diff --git a/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend b/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend index 24abdc11..284c6a88 100644 --- a/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend +++ b/meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend | |||
@@ -1,3 +1,5 @@ | |||
1 | COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | ||
2 | |||
1 | # Add MicroBlaze Patches (only when using MicroBlaze) | 3 | # Add MicroBlaze Patches (only when using MicroBlaze) |
2 | FILESEXTRAPATHS_append_microblaze_xilinx-standalone := "${THISDIR}/gcc-9:" | 4 | FILESEXTRAPATHS_append_microblaze_xilinx-standalone := "${THISDIR}/gcc-9:" |
3 | SRC_URI_append_microblaze_xilinx-standalone = " \ | 5 | SRC_URI_append_microblaze_xilinx-standalone = " \ |
diff --git a/meta-xilinx-standalone/recipes-devtools/gcc/libgcc_%.bbappend b/meta-xilinx-standalone/recipes-devtools/gcc/libgcc_%.bbappend index e6801c2f..a2062f6f 100644 --- a/meta-xilinx-standalone/recipes-devtools/gcc/libgcc_%.bbappend +++ b/meta-xilinx-standalone/recipes-devtools/gcc/libgcc_%.bbappend | |||
@@ -1,3 +1,5 @@ | |||
1 | COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | ||
2 | |||
1 | python do_multilib_install_xilinx-standalone_class-target () { | 3 | python do_multilib_install_xilinx-standalone_class-target () { |
2 | pass | 4 | pass |
3 | } | 5 | } |
diff --git a/meta-xilinx-standalone/recipes-devtools/qemu/qemuwrapper-cross_1.0.bbappend b/meta-xilinx-standalone/recipes-devtools/qemu/qemuwrapper-cross_1.0.bbappend new file mode 100644 index 00000000..0efa796c --- /dev/null +++ b/meta-xilinx-standalone/recipes-devtools/qemu/qemuwrapper-cross_1.0.bbappend | |||
@@ -0,0 +1 @@ | |||
COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | |||
diff --git a/meta-xilinx-standalone/recipes-kernel/linux/linux-dummy.bbappend b/meta-xilinx-standalone/recipes-kernel/linux/linux-dummy.bbappend new file mode 100644 index 00000000..0efa796c --- /dev/null +++ b/meta-xilinx-standalone/recipes-kernel/linux/linux-dummy.bbappend | |||
@@ -0,0 +1 @@ | |||
COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}" | |||