diff options
| author | Christopher Clark <christopher.w.clark@gmail.com> | 2020-02-25 16:16:01 -0800 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-02-27 16:59:23 -0500 |
| commit | ea94bfc3441cb33b17f4eeac06ff23d450465baf (patch) | |
| tree | 23785e65bad8e3e0b428a66dbbcbae964158bb98 | |
| parent | a0964e2044cb1ccdd4f64173658ce7602257ff48 (diff) | |
| download | meta-virtualization-ea94bfc3441cb33b17f4eeac06ff23d450465baf.tar.gz | |
xen, xen-tools: remove stubs task and use multilib when necessary
The stubs task was MACHINE-specific due to the OE variables it accessed
which had forced unnecessary rebuild work in OpenXT's multi-MACHINE
builds.
The stubs task was generating a 32-bit header file to satisfy the Xen
tools firmware build to generate the hvmloader binary, which is only
needed on x86-64 targets where HVM-mode guests are enabled.
Remove this header file generation logic and similar in the configure
task, and in the cases where hvmloader is to be built use multilib to
provide a 32-bit sysroot and allow the build to obtain the needed 32-bit
materials from their source: glibc.
Building Xen tools for x86-64 with HVM-guest support enabled now
requires the following to be added to a build conf file
(eg. distro.conf, or local.conf) :
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | recipes-extended/xen/xen-tools.inc | 48 | ||||
| -rw-r--r-- | recipes-extended/xen/xen.inc | 4 |
2 files changed, 35 insertions, 17 deletions
diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc index 00843ca5..864c40cd 100644 --- a/recipes-extended/xen/xen-tools.inc +++ b/recipes-extended/xen/xen-tools.inc | |||
| @@ -6,6 +6,29 @@ COMPATIBLE_HOST = 'i686-oe-linux|(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux | |||
| 6 | inherit setuptools3 update-rc.d systemd deploy | 6 | inherit setuptools3 update-rc.d systemd deploy |
| 7 | require xen-blktap.inc | 7 | require xen-blktap.inc |
| 8 | 8 | ||
| 9 | # To build hvmloader, which is needed on x86-64 targets when 'hvm' is enabled | ||
| 10 | # in PACKAGECONFIG, to support running HVM-mode guest VMs, some files from | ||
| 11 | # 32-bit glibc are needed. | ||
| 12 | # Add the multilib 32-bit glibc to DEPENDS only when necessary. | ||
| 13 | # | ||
| 14 | # To enable multilib, please add the following to your local.conf -: | ||
| 15 | # | ||
| 16 | # require conf/multilib.conf | ||
| 17 | # MULTILIBS = "multilib:lib32" | ||
| 18 | # DEFAULTTUNE_virtclass-multilib-lib32 = "x86" | ||
| 19 | |||
| 20 | # Use this multilib prefix for x86 32-bit to match local.conf: | ||
| 21 | MLPREFIX32 = "lib32-" | ||
| 22 | |||
| 23 | # The DEPENDS on a multilib 32-bit glibc is only added when target is x86-64 | ||
| 24 | # and 'hvm' is enabled in PACKAGECONFIG. | ||
| 25 | # This x86-64 override is never intended for native use, so clear that. | ||
| 26 | GLIBC32 = "" | ||
| 27 | GLIBC32_x86-64 = \ | ||
| 28 | "${@bb.utils.contains('PACKAGECONFIG', 'hvm', '${MLPREFIX32}glibc', '', d)}" | ||
| 29 | GLIBC32_class-native = "" | ||
| 30 | DEPENDS += "${GLIBC32}" | ||
| 31 | |||
| 9 | RDEPENDS_${PN} = "\ | 32 | RDEPENDS_${PN} = "\ |
| 10 | bash perl xz \ | 33 | bash perl xz \ |
| 11 | ${PN}-console \ | 34 | ${PN}-console \ |
| @@ -656,25 +679,24 @@ SYSTEMD_SERVICE_${PN}-xencommons = " \ | |||
| 656 | " | 679 | " |
| 657 | SYSTEMD_SERVICE_${PN}-xendomains = "xendomains.service" | 680 | SYSTEMD_SERVICE_${PN}-xendomains = "xendomains.service" |
| 658 | 681 | ||
| 682 | # To build hvmloader, which is needed on x86-64 targets when 'hvm' is enabled | ||
| 683 | # in PACKAGECONFIG, additional CFLAGS are needed to set the 32-bit sysroot. | ||
| 684 | RECIPE_SYSROOT32 = "${WORKDIR}/${MLPREFIX32}recipe-sysroot" | ||
| 685 | ADD_SYSROOT32_CFLAGS = "" | ||
| 686 | ADD_SYSROOT32_CFLAGS_x86-64 = \ | ||
| 687 | "${@bb.utils.contains('PACKAGECONFIG', 'hvm', \ | ||
| 688 | 'CFLAGS += "--sysroot=${RECIPE_SYSROOT32}"', '', d)}" | ||
| 689 | # This x86-64 override is never intended for native use, so clear that. | ||
| 690 | ADD_SYSROOT32_CFLAGS_class-native = "" | ||
| 691 | |||
| 659 | do_configure() { | 692 | do_configure() { |
| 660 | do_configure_common | 693 | do_configure_common |
| 661 | } | ||
| 662 | 694 | ||
| 663 | do_stubs() { | 695 | if [ -n '${ADD_SYSROOT32_CFLAGS}' ] ; then |
| 664 | # no stubs-32.h in our 64-bit sysroot - hack it into tools/include/gnu | 696 | echo '${ADD_SYSROOT32_CFLAGS}' >>"${S}/tools/firmware/Rules.mk" |
| 665 | if ! test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-32.h ; then | ||
| 666 | if test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h ; then | ||
| 667 | test -d ${S}/tools/include/gnu || mkdir ${S}/tools/include/gnu | ||
| 668 | cat ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h | grep -v stub_bdflush | grep -v stub_getmsg | grep -v stub_putmsg > ${S}/tools/include/gnu/stubs-32.h | ||
| 669 | echo \#define __stub___kernel_cosl >> ${S}/tools/include/gnu/stubs-32.h | ||
| 670 | echo \#define __stub___kernel_sinl >> ${S}/tools/include/gnu/stubs-32.h | ||
| 671 | echo \#define __stub___kernel_tanl >> ${S}/tools/include/gnu/stubs-32.h | ||
| 672 | fi | ||
| 673 | fi | 697 | fi |
| 674 | } | 698 | } |
| 675 | 699 | ||
| 676 | addtask stubs after do_configure before do_compile | ||
| 677 | |||
| 678 | do_compile() { | 700 | do_compile() { |
| 679 | cd ${S} | 701 | cd ${S} |
| 680 | oe_runmake tools PYTHON="${PYTHON}" | 702 | oe_runmake tools PYTHON="${PYTHON}" |
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc index 1ac131ed..32e836a9 100644 --- a/recipes-extended/xen/xen.inc +++ b/recipes-extended/xen/xen.inc | |||
| @@ -223,10 +223,6 @@ do_configure_common() { | |||
| 223 | oe_runconf EXTRA_CFLAGS_XEN_CORE="${EXTRA_CFLAGS_XEN_CORE}" \ | 223 | oe_runconf EXTRA_CFLAGS_XEN_CORE="${EXTRA_CFLAGS_XEN_CORE}" \ |
| 224 | EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}" \ | 224 | EXTRA_CFLAGS_XEN_TOOLS="${EXTRA_CFLAGS_XEN_TOOLS}" \ |
| 225 | PYTHON="${PYTHON}" | 225 | PYTHON="${PYTHON}" |
| 226 | |||
| 227 | if [ ! -e ${STAGING_INCDIR}/bits/long-double-32.h ]; then | ||
| 228 | cp ${STAGING_INCDIR}/bits/long-double-64.h ${STAGING_INCDIR}/bits/long-double-32.h | ||
| 229 | fi | ||
| 230 | } | 226 | } |
| 231 | 227 | ||
| 232 | do_compile_prepend() { | 228 | do_compile_prepend() { |
