Files
xen/automation/eclair_analysis/build.sh
T
Simone Ballarin 5b251cbca0 automation: Add xen builds for the ECLAIR analyses
This patch defines an ARM64 and a X86_64 build for the
ECLAIR pipelines.

These files are used by the analyze.sh script in
automation/eclair_analysis: it initially calls prepare.sh,
then runs into an ECLAIR environment build.sh.

Only the toolchain invocations triggered by build.sh
are analyzed; the prepare.sh script is instead intended
to perform all the required operations for building xen
that are not supposed to be analyzed: e.g. dependencies
build.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2023-07-26 15:11:50 -07:00

45 lines
873 B
Bash
Executable File

#!/bin/bash
# Stop immediately if any executed command has exit status different from 0.
set -e
script_name="$(basename "$0")"
fatal() {
echo "${script_name}: $*" >&2
exit 1
}
usage() {
fatal "Usage: ${script_name} <ARM64|X86_64>"
}
if [ $# -ne 1 ]; then
usage
fi
if [ "$1" = "X86_64" ]; then
export CROSS_COMPILE=
export XEN_TARGET_ARCH=x86_64
elif [ "$1" = "ARM64" ]; then
export CROSS_COMPILE=aarch64-linux-gnu-
export XEN_TARGET_ARCH=arm64
else
fatal "Unknown configuration: $1"
fi
if [[ -f /proc/cpuinfo ]]; then
PROCESSORS=$(grep -c ^processor /proc/cpuinfo)
else
PROCESSORS=6
fi
(
cd xen
make "-j${PROCESSORS}" "-l${PROCESSORS}.0" \
"CROSS_COMPILE=${CROSS_COMPILE}" \
"CC=${CROSS_COMPILE}gcc-12" \
"CXX=${CROSS_COMPILE}g++-12" \
"XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"
)