diff options
Diffstat (limited to 'recipes-extended/xen/xen.inc')
-rw-r--r-- | recipes-extended/xen/xen.inc | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc index 9e8fcad2..dcd281b5 100644 --- a/recipes-extended/xen/xen.inc +++ b/recipes-extended/xen/xen.inc @@ -1,21 +1,20 @@ HOMEPAGE = "http://xen.org" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" SECTION = "console/tools" -inherit autotools-brokensep +TOOLCHAIN = "gcc" + +inherit autotools-brokensep pkgconfig require xen-arch.inc PACKAGECONFIG ??= " \ - sdl \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ - ${@bb.utils.contains('XEN_TARGET_ARCH', 'x86_64', 'hvm', '', d)} \ " -PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,virtual/libsdl," +PACKAGECONFIG[lzo] = ",,lzo" PACKAGECONFIG[xsm] = "--enable-xsmpolicy,--disable-xsmpolicy,checkpolicy-native," PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd," -PACKAGECONFIG[hvm] = "--with-system-seabios="/usr/share/firmware/bios.bin",--disable-seabios,seabios ipxe vgabios," PACKAGECONFIG[externalblktap] = ",,," DEPENDS = " \ @@ -43,7 +42,6 @@ DEPENDS = " \ procps \ python3 \ libaio \ - lzo \ util-linux \ xz \ yajl \ @@ -90,8 +88,19 @@ export CROSS_COMPILE="${TARGET_PREFIX}" # overide LDFLAGS to allow xen to build without: "x86_64-oe-linux-ld: unrecognized option '-Wl,-O1'" export LDFLAGS="" -# Pass through the Yocto distro compiler flags via the Xen-provided variables. -# Special handling: +# No additional C flags for the main hypervisor build +EXTRA_CFLAGS_XEN_CORE ?= "" +# Add prefix maps to support buildpaths QA test and reproducibility +DEBUG_PREFIX_MAP:append = " \ + -ffile-prefix-map=${S}=${PN}-source \ + -fdebug-prefix-map=${WORKDIR}=${PN} \ + " + +# - The Xen tools build for x86 systems with HVM-mode enabled includes hvmloader +# which fails to build when "-m64" is included in flags set via the +# EXTRA_CFLAGS_XEN_TOOLS: so clear TUNE_CCARGS on x86 to prevent that. +TUNE_CCARGS:x86-64="" + # - Yocto supplies the _FORTIFY_SOURCE flag via CC/CPP/CXX but then passes the # optimization -O via C*FLAGS which is problematic when the CFLAGS are cleared # within the build because compilation fails with the compiler stating @@ -101,18 +110,15 @@ export LDFLAGS="" # It must not be compiled with SSE compiler options enabled and the Xen build # explicitly clears CFLAGS to ensure that, so such options must not be passed # in via the tool variable. hvmloader is required to run HVM-mode guest VMs. -CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" -EXTRA_CFLAGS_XEN_CORE="${HOST_CC_ARCH} ${CFLAGS}" +CC="${CCACHE}${HOST_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP} ${CC_REPRODUCIBLE_OPTIONS}" EXTRA_CFLAGS_XEN_TOOLS="${HOST_CC_ARCH} ${CFLAGS}" # 32-bit ARM needs the TUNE_CCARGS component of HOST_CC_ARCH to be passed # in CC to ensure that configure can compile binaries for the right arch. -CC_arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${CC_REPRODUCIBLE_OPTIONS}" -EXTRA_CFLAGS_XEN_CORE_arm="${SECURITY_CFLAGS} ${CFLAGS}" -EXTRA_CFLAGS_XEN_TOOLS_arm="${SECURITY_CFLAGS} ${CFLAGS}" +CC:arm="${CCACHE}${HOST_PREFIX}gcc ${TUNE_CCARGS} ${TOOLCHAIN_OPTIONS} ${DEBUG_PREFIX_MAP} ${CC_REPRODUCIBLE_OPTIONS}" # There are no Xen-provided variables for C++, so append to the tool variables: -CPP_append = " ${CPPFLAGS}" -CXX_append = " ${CXXFLAGS}" +CPP:append = " ${CPPFLAGS}" +CXX:append = " ${CXXFLAGS}" EXTRA_OECONF += " \ --exec-prefix=${prefix} \ @@ -125,10 +131,13 @@ EXTRA_OECONF += " \ --disable-rombios \ --disable-ocamltools \ --disable-qemu-traditional \ + ${@bb.utils.contains('XEN_TARGET_ARCH', 'x86_64', \ + '--enable-pvshim --with-system-seabios="/usr/share/firmware/bios.bin"', \ + '--disable-pvshim --disable-seabios', d)} \ " -EXTRA_OEMAKE += "STDVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.bin" -EXTRA_OEMAKE += "CIRRUSVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.cirrus.bin" +EXTRA_OEMAKE += "STDVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.8a.bin" +EXTRA_OEMAKE += "CIRRUSVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.8a.cirrus.bin" EXTRA_OEMAKE += "SEABIOS_ROM=${STAGING_DIR_HOST}/usr/share/firmware/bios.bin" EXTRA_OEMAKE += "ETHERBOOT_ROMS=${STAGING_DIR_HOST}/usr/share/firmware/rtl8139.rom" @@ -150,9 +159,7 @@ EXTRA_OEMAKE += "${@['', 'XEN_WHOAMI=${PF} XEN_DOMAIN=${DISTRO} XEN_BUILD_HOST=$ [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}${@get_build_time_vars(d)}" # Improve build reproducibility: compiler flags to remove filesystem differences. -CC_REPRODUCIBLE_OPTIONS = "${@['', '-gno-record-gcc-switches ' + \ - '-ffile-prefix-map=${S}=${PN}-source ' + \ - '-fdebug-prefix-map=${WORKDIR}=${PN}'] \ +CC_REPRODUCIBLE_OPTIONS = "${@['', '-gno-record-gcc-switches'] \ [d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1']}" # check for XSM in package config to allow XSM_ENABLE to be set @@ -185,12 +192,6 @@ do_post_patch() { fi } -do_post_patch_append_arm() { - # The hypervisor binary must not be built with the hard floating point ABI. - echo "CC := \$(filter-out ${TUNE_CCARGS},\$(CC))" >> ${S}/xen/arch/arm/Rules.mk - echo "CPP := \$(filter-out ${TUNE_CCARGS},\$(CPP))" >> ${S}/xen/arch/arm/Rules.mk -} - addtask post_patch after do_patch before do_configure # Allow all hypervisor settings in a defconfig @@ -221,13 +222,13 @@ do_configure_common() { PYTHON="${PYTHON}" } -do_compile_prepend() { +do_compile:prepend() { # workaround for build bug when CFLAGS is exported # https://www.mail-archive.com/xen-devel@lists.xen.org/msg67822.html unset CFLAGS } -do_install_prepend() { +do_install:prepend() { # CFLAGS is used to set PY_CFLAGS which affects the pygrub install # so also need to unset CFLAGS here: unset CFLAGS |