summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2020-02-24 12:14:48 -0800
committerMark Hatle <mark.hatle@xilinx.com>2020-02-27 08:36:00 -0800
commit4f3edb6da405ffff957d6f194bc7db7bdd9f1463 (patch)
tree50895bd7e0126620749adff252f5eb6b9da84540
parentc6fc0f9a034a3a3c8748e0a650f8728f8c044065 (diff)
downloadmeta-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>
-rw-r--r--meta-xilinx-standalone/classes/esw.bbclass5
-rw-r--r--meta-xilinx-standalone/classes/xlnx-compatible-os.bbclass16
-rw-r--r--meta-xilinx-standalone/conf/distro/xilinx-standalone.inc8
-rw-r--r--meta-xilinx-standalone/recipes-bsp/device-tree/device-tree.bbappend2
-rw-r--r--meta-xilinx-standalone/recipes-bsp/hdf/external-hdf.bbappend1
-rw-r--r--meta-xilinx-standalone/recipes-core/meta/meta-toolchain.bbappend2
-rw-r--r--meta-xilinx-standalone/recipes-core/newlib/libgloss_3.1.0.bbappend3
-rw-r--r--meta-xilinx-standalone/recipes-core/newlib/newlib_3.1.0.bbappend2
-rw-r--r--meta-xilinx-standalone/recipes-core/packagegroups/packagegroup-newlib-standalone-sdk-target.bb2
-rw-r--r--meta-xilinx-standalone/recipes-devtools/gcc/gcc-runtime_%.bbappend2
-rw-r--r--meta-xilinx-standalone/recipes-devtools/gcc/gcc-source_9.%.bbappend2
-rw-r--r--meta-xilinx-standalone/recipes-devtools/gcc/libgcc_%.bbappend2
-rw-r--r--meta-xilinx-standalone/recipes-devtools/qemu/qemuwrapper-cross_1.0.bbappend1
-rw-r--r--meta-xilinx-standalone/recipes-kernel/linux/linux-dummy.bbappend1
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 @@
1inherit pkgconfig cmake yocto-cmake-translation 1inherit pkgconfig cmake
2 2
3LICENSE = "Proprietary" 3LICENSE = "Proprietary"
4LICFILENAME = "license.txt" 4LICFILENAME = "license.txt"
@@ -37,6 +37,9 @@ COMPATIBLE_MACHINE_cortexr5-zynqmp = "cortexr5-zynqmp"
37COMPATIBLE_HOST_cortexa72-versal = "aarch64.*-elf" 37COMPATIBLE_HOST_cortexa72-versal = "aarch64.*-elf"
38COMPATIBLE_MACHINE_cortexa72-versal = "cortexa72-versal" 38COMPATIBLE_MACHINE_cortexa72-versal = "cortexa72-versal"
39 39
40COMPATIBLE_OS = "elf"
41COMPATIBLE_OS_arm = "eabi"
42
40DTBFILE_microblaze-pmu ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" 43DTBFILE_microblaze-pmu ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb"
41DTBFILE_microblaze-plm ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" 44DTBFILE_microblaze-plm ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb"
42DTBFILE_cortexa53-zynqmp ?= "${RECIPE_SYSROOT}/boot/devicetree/system-top.dtb" 45DTBFILE_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
3COMPATIBLE_OS ?= "linux${LIBCEXTENSION}${ABIEXTENSION}"
4
5python() {
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
25TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexr5', ' -DARMR5', '', d)}" 25TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexr5', ' -DARMR5', '', d)}"
26
27INHERIT += "xlnx-compatible-os"
28
29# Clear defaults
30DISTRO_FEATURES_BACKFILL_xilinx-standalone = ""
31VIRTUAL-RUNTIME_init_manager_xilinx-standalone = ""
32
33PREFERRED_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 = ".*"
4COMPATIBLE_MACHINE_microblaze-plm = ".*" 4COMPATIBLE_MACHINE_microblaze-plm = ".*"
5COMPATIBLE_MACHINE_cortexa72-versal = ".*" 5COMPATIBLE_MACHINE_cortexa72-versal = ".*"
6 6
7COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}"
8
7REPO_cortexa53-zynqmp = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" 9REPO_cortexa53-zynqmp = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https"
8REPO_cortexr5-zynqmp = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" 10REPO_cortexr5-zynqmp = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https"
9REPO_microblaze-pmu = "git://gitenterprise.xilinx.com/decoupling/device-tree-xlnx;protocol=https" 11REPO_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 @@
1COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}"
2
1TOOLCHAIN_TARGET_TASK_xilinx-standalone = "${@multilib_pkg_extend(d, 'packagegroup-newlib-standalone-sdk-target')}" 3TOOLCHAIN_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 @@
1COMPATIBLE_OS_xilinx-standalone = "elf"
2COMPATIBLE_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
2DEPENDS_append_xilinx-standalone = " ${MLPREFIX}newlib" 5DEPENDS_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 @@
1COMPATIBLE_OS_xilinx-standalone = "elf"
2COMPATIBLE_OS_arm_xilinx-standalone = "eabi"
1 3
2EXTRA_OECONF_append_xilinx-standalone = " \ 4EXTRA_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 @@
1COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}"
2
1SUMMARY = "Target packages for the standalone SDK" 3SUMMARY = "Target packages for the standalone SDK"
2 4
3PACKAGE_ARCH = "${TUNE_PKGARCH}" 5PACKAGE_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 @@
1COMPATIBLE_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
2LINKER_HASH_STYLE_xilinx-standalone_class-target = "" 4LINKER_HASH_STYLE_xilinx-standalone_class-target = ""
3SYMVERS_CONF_xilinx-standalone_class-target = "" 5SYMVERS_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 @@
1COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}"
2
1# Add MicroBlaze Patches (only when using MicroBlaze) 3# Add MicroBlaze Patches (only when using MicroBlaze)
2FILESEXTRAPATHS_append_microblaze_xilinx-standalone := "${THISDIR}/gcc-9:" 4FILESEXTRAPATHS_append_microblaze_xilinx-standalone := "${THISDIR}/gcc-9:"
3SRC_URI_append_microblaze_xilinx-standalone = " \ 5SRC_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 @@
1COMPATIBLE_OS_xilinx-standalone = "${TARGET_OS}"
2
1python do_multilib_install_xilinx-standalone_class-target () { 3python 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}"