mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Having 3 extra hypervisor builds on the end of a full build is deeply
confusing to debug if one of them fails, because the .config file presented in
the artefacts is not the one which caused a build failure. Also, the log
tends to be truncated in the UI.
PV-only is tested as part of PV-Shim in a full build anyway, so doesn't need
repeating. HVM-only and neither appear frequently in randconfig, so drop all
the logic here to simplify things.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(cherry picked from commit 7b20009a81)
76 lines
2.1 KiB
Python
Executable File
76 lines
2.1 KiB
Python
Executable File
#!/bin/bash -ex
|
|
|
|
test -f /etc/os-release && cat "$_"
|
|
|
|
$CC --version
|
|
|
|
# Express the compiler version as an integer. e.g. GCC 4.9.2 => 0x040902
|
|
cc-ver()
|
|
{
|
|
$CC -dumpversion | awk -F. '{ printf "0x%02x%02x%02x", $1, $2, $3 }'
|
|
}
|
|
|
|
# random config or default config
|
|
if [[ "${RANDCONFIG}" == "y" ]]; then
|
|
make -j$(nproc) -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig
|
|
hypervisor_only="y"
|
|
else
|
|
make -j$(nproc) -C xen defconfig
|
|
fi
|
|
|
|
# Save the config file before building because build failure causes the script
|
|
# to exit early -- bash is invoked with -e.
|
|
cp xen/.config xen-config
|
|
|
|
# arm32 only cross-compiles the hypervisor
|
|
if [[ "${XEN_TARGET_ARCH}" = "arm32" ]]; then
|
|
hypervisor_only="y"
|
|
fi
|
|
|
|
# build up our configure options
|
|
cfgargs=()
|
|
cfgargs+=("--enable-docs")
|
|
|
|
if [[ "${CC}" == "clang"* ]]; then
|
|
# SeaBIOS cannot be built with clang
|
|
cfgargs+=("--with-system-seabios=/usr/share/seabios/bios.bin")
|
|
# iPXE cannot be built with clang
|
|
cfgargs+=("--with-system-ipxe=/usr/lib/ipxe/ipxe.pxe")
|
|
# newlib cannot be built with clang so we cannot build stubdoms
|
|
cfgargs+=("--disable-stubdom")
|
|
fi
|
|
|
|
if ! test -z "$(ldd /bin/ls|grep musl|head -1)"; then
|
|
# disable --disable-werror for QEMUU when building with MUSL
|
|
cfgargs+=("--with-extra-qemuu-configure-args=\"--disable-werror\"")
|
|
# SeaBIOS doesn't build on MUSL systems
|
|
cfgargs+=("--with-system-seabios=/bin/false")
|
|
fi
|
|
|
|
# Qemu requires Python 3.5 or later, and ninja
|
|
if ! type python3 || python3 -c "import sys; res = sys.version_info < (3, 5); exit(not(res))" \
|
|
|| ! type ninja; then
|
|
cfgargs+=("--with-system-qemu=/bin/false")
|
|
fi
|
|
|
|
# SeaBIOS requires GCC 4.6 or later
|
|
if [[ "${CC}" == "gcc" && `cc-ver` -lt 0x040600 ]]; then
|
|
cfgargs+=("--with-system-seabios=/bin/false")
|
|
fi
|
|
|
|
if [[ "${hypervisor_only}" == "y" ]]; then
|
|
make -j$(nproc) xen
|
|
else
|
|
./configure "${cfgargs[@]}"
|
|
make -j$(nproc) dist
|
|
fi
|
|
|
|
# Extract artifacts to avoid getting rewritten by customised builds
|
|
mkdir binaries
|
|
if [[ "${XEN_TARGET_ARCH}" != "x86_32" ]]; then
|
|
cp xen/xen binaries/xen
|
|
if [[ "${hypervisor_only}" != "y" ]]; then
|
|
cp -r dist binaries/
|
|
fi
|
|
fi
|