PROCESSORS=6
fi
+# Variables driving the build
+CC=${CROSS_COMPILE}gcc-12
+CXX=${CROSS_COMPILE}g++-12
+
+runtime_failures_docs() {
+ doc="C-runtime-failures.rst"
+ builddir="automation/eclair_analysis"
+
+ cd "${builddir}"
+ printf "/*\n\n" >"${doc}.c"
+ sed -e 's|\*/|*//*|g' "../../docs/misra/${doc}" >>"${doc}.c"
+
+ # At least a dummy decl is needed to comply with the C standard.
+ printf "\n\n*/\ntypedef int dummy_typedef;\n" >>"${doc}.c"
+
+ # The C language standard applicable to Xen is C99 (with extensions),
+ # therefore even this dummy file needs to be compiled with -std=c99.
+ # Cannot redirect to /dev/null because it would be excluded from the analysis
+ "${CC}" -std=c99 -c "${doc}.c" -o "${doc}.o"
+ cd -
+}
+
(
- cd xen
+ runtime_failures_docs
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}"
+ "CC=${CC}" \
+ "CXX=${CXX}" \
+ "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}" \
+ -C xen
)
fi
(
- cd xen
- cp "${CONFIG_FILE}" .config
+ ./configure
+ cp "${CONFIG_FILE}" xen/.config
make clean
find . -type f -name "*.safparse" -print -delete
- make -f ${script_dir}/Makefile.prepare prepare
+ cd xen
+ make -f "${script_dir}/Makefile.prepare" prepare
# Translate the /* SAF-n-safe */ comments into ECLAIR CBTs
scripts/xen-analysis.py --run-eclair --no-build --no-clean
)