From c2eb9e6e81d1ca1236d36ae240f67f3727a202c3 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 24 Mar 2022 11:35:33 +0100 Subject: [PATCH] abuild: Build with clang only when supported This changes the behavior of '-L/--clang' to only buildtest when a target has ARCH_SUPPORTS_CLANG set. Change-Id: I362fcd0f795d27f13dde793a79774f08c497bd38 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/63084 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- util/abuild/abuild | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/util/abuild/abuild b/util/abuild/abuild index cc149a8a2d..2632aaa176 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -456,6 +456,14 @@ function build_config local FORCE_ENABLED_CROS=0 fi + if [ "$clang" = true ]; then + check_config "$build_dir" "clang" "CONFIG_COMPILER_LLVM_CLANG=y" + if [ $? -ne 0 ]; then + echo "${MAINBOARD} doesn't support clang, skipping." + return + fi + fi + if [ $BUILDENV_CREATED -ne 0 ] || [ $MAINBOARD_OK -ne 0 ] || [ $VENDOR_OK -ne 0 ] || [ $FORCE_ENABLED_CROS -eq 1 ]; then junit " " @@ -587,7 +595,7 @@ Options:\n" [-J|--junit] Write JUnit formatted xml log file [-K|--kconfig ] Prepend file to generated Kconfig [-l|--loglevel ] Set loglevel - [-L|--clang] Use clang + [-L|--clang] Use clang on supported arch [-o|--outdir ] Store build results in path (defaults to $TARGET) [-p|--payloads ] Use payloads in to build images @@ -671,6 +679,7 @@ if [ $retval != 0 ]; then fi chromeos=false +clang=false clean_work=false clean_objs=false verboseopt='V=0' @@ -738,6 +747,7 @@ while true ; do configoptions="${configoptions}CONFIG_ANY_TOOLCHAIN=y\n" ;; -L|--clang) shift + clang=true customizing="${customizing}, clang" configoptions="${configoptions}CONFIG_COMPILER_LLVM_CLANG=y\n# CONFIG_COMPILER_GCC is not set\n" ;;