the following patch was just integrated into master:
commit 4ebd3d9195731721e777186d6f78531bba29497e
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat May 17 14:02:08 2014 +0200
build: kill one indirection
No need to first define X86_32 and then replace every
single use of it with its lower cased equivalent.
Just start out with the lower case versions in the first
place.
Change-Id: I1e771ef443db1b8d34018d19a64a9ee489cd8133
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/5767
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/5767 for details.
-gerrit
the following patch was just integrated into master:
commit b83f7deb78fbc440a42db47eaa0605e116d9d28e
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat May 17 14:20:11 2014 +0200
build: get rid of a special case
Don't call things in xcompile i386 and in the
buildsystem x86_32 and then bridge things so
they match. just call it the same everywhere.
Change-Id: Ieef5f03f7aafb0b0a606fbe5a2386e310d2b0e94
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/5766
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/5766 for details.
-gerrit
the following patch was just integrated into master:
commit 58f73a69cd83c46604795d728f296779c1de162c
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat May 17 14:00:12 2014 +0200
build: separate CPPFLAGS from CFLAGS
There are a couple of places where CPPFLAGS are
pasted into CFLAGS, eliminate them.
Change-Id: Ic7f568cf87a7d9c5c52e2942032a867161036bd7
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/5765
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/5765 for details.
-gerrit
the following patch was just integrated into master:
commit 98f49d28233f68aeb9dfccc6d7e633ae35449e00
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat May 17 13:53:11 2014 +0200
build: CPPFLAGS is more common than INCLUDES
Rename INCLUDES to CPPFLAGS since the latter is more
commonly used for preprocessor options.
Change-Id: I522bb01c44856d0eccf221fa43d2d644bdf01d69
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/5764
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/5764 for details.
-gerrit
the following patch was just integrated into master:
commit c2a0b7d990ff162504bbd1aef27c049ea885a38b
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat May 17 14:11:57 2014 +0200
build: reduce duplication in payload adding rules
They're all the same, so treat them that way.
Change-Id: I8e3976df1e3a0f9dbcf1d5373611f6197bc9701b
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Reviewed-on: http://review.coreboot.org/5763
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
See http://review.coreboot.org/5763 for details.
-gerrit
Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5774
-gerrit
commit 4bbf08c223b9086b3b519ecac4b093367d904832
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat May 17 18:26:38 2014 +0200
build: make scan-build work again
This drops the scan-build related Kconfig options
since it's now possible to simply run
scan-build [-o outdir] make
and get coreboot built with its report.
There's also no inner make process anymore, and the way
things work should be clearer now.
Also adapt abuild to this new reality.
Change-Id: I03e03334761ec83f718b3235ebf811834cd2e3e3
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
Makefile | 30 ----------------------------
src/Kconfig | 23 ---------------------
toolchain.inc | 16 +++++++++++++++
util/abuild/abuild | 28 ++++++++++++++++++--------
util/lint/lint-stable-002-build-dir-handling | 2 +-
5 files changed, 37 insertions(+), 62 deletions(-)
diff --git a/Makefile b/Makefile
index 5c4484a..ddacdc3 100644
--- a/Makefile
+++ b/Makefile
@@ -30,19 +30,9 @@
## SUCH DAMAGE.
##
-ifeq ($(INNER_SCANBUILD),y)
-CC_real:=$(CC)
-endif
-
$(if $(wildcard .xcompile),,$(eval $(shell bash util/xcompile/xcompile $(XGCCPATH) > .xcompile)))
include .xcompile
-ifeq ($(INNER_SCANBUILD),y)
-CC:=$(CC_real)
-HOSTCC:=$(CC_real) --hostcc
-HOSTCXX:=$(CC_real) --hostcxx
-endif
-
export top := $(CURDIR)
export src := src
export srck := $(top)/util/kconfig
@@ -119,12 +109,10 @@ include $(HAVE_DOTCONFIG)
include toolchain.inc
-ifneq ($(INNER_SCANBUILD),y)
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
CC:=clang -m32 -mno-mmx -mno-sse -no-integrated-as
HOSTCC:=clang
endif
-endif
ifeq ($(CONFIG_CCACHE),y)
CCACHE:=$(word 1,$(wildcard $(addsuffix /ccache,$(subst :, ,$(PATH)))))
@@ -143,25 +131,7 @@ strip_quotes = $(subst ",,$(subst \",,$(1)))
# The primary target needs to be here before we include the
# other files
-ifeq ($(INNER_SCANBUILD),y)
-CONFIG_SCANBUILD_ENABLE:=
-endif
-
-ifeq ($(CONFIG_SCANBUILD_ENABLE),y)
-ifneq ($(CONFIG_SCANBUILD_REPORT_LOCATION),)
-CONFIG_SCANBUILD_REPORT_LOCATION:=-o $(CONFIG_SCANBUILD_REPORT_LOCATION)
-endif
-real-all:
- echo '#!/bin/sh' > .ccwrap
- echo 'CC="$(CC)"' >> .ccwrap
- echo 'if [ "$$1" = "--hostcc" ]; then shift; CC="$(HOSTCC)"; fi' >> .ccwrap
- echo 'if [ "$$1" = "--hostcxx" ]; then shift; CC="$(HOSTCXX)"; fi' >> .ccwrap
- echo 'eval $$CC $$*' >> .ccwrap
- chmod +x .ccwrap
- scan-build $(CONFIG_SCANBUILD_REPORT_LOCATION) -analyze-headers --use-cc=$(top)/.ccwrap --use-c++=$(top)/.ccwrap $(MAKE) INNER_SCANBUILD=y
-else
real-all: real-target
-endif
# must come rather early
.SECONDEXPANSION:
diff --git a/src/Kconfig b/src/Kconfig
index 30f996d..53a23bb 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -80,29 +80,6 @@ config ANY_TOOLCHAIN
we'll have to assume that they use their distro compiler by mistake.
Make sure that using patched compilers is a conscious decision.
-config SCANBUILD_ENABLE
- bool "Build with scan-build for static code analysis"
- default n
- help
- Changes the build process to use scan-build (a utility for
- running the clang static code analyzer from the command line).
-
- Requires the scan-build utility in your system $PATH.
-
- For details see http://clang-analyzer.llvm.org/scan-build.html.
-
-config SCANBUILD_REPORT_LOCATION
- string "Directory for the scan-build report(s)"
- default ""
- depends on SCANBUILD_ENABLE
- help
- Directory where the scan-build reports should be stored in. The
- reports are stored in subdirectories of the form 'yyyy-mm-dd-*'
- in the specified directory.
-
- If this setting is left empty, the coreboot top-level directory
- will be used to store the report subdirectories.
-
config CCACHE
bool "Use ccache to speed up (re)compilation"
default n
diff --git a/toolchain.inc b/toolchain.inc
index 9417a73..bfa604b 100644
--- a/toolchain.inc
+++ b/toolchain.inc
@@ -19,6 +19,22 @@
ARCH_SUPPORTED := armv7 x86_32
+
+# scan-build integration
+ifneq ($(CCC_ANALYZER_OUTPUT_FORMAT),)
+
+ifeq ($(CCC_ANALYZER_ANALYSIS),)
+export CCC_ANALYZER_ANALYSIS := -analyzer-opt-analyze-headers
+endif
+
+$(foreach arch,$(ARCH_SUPPORTED), \
+ $(eval CC_$(arch):=CCC_CC=$(CC_$(arch)) $(CC) ))
+
+HOSTCC:=CCC_CC="$(HOSTCC)" $(CC)
+HOSTCXX:=CCC_CXX="$(HOSTCXX)" $(CXX)
+ROMCC=CCC_CC="$(ROMCC_BIN)" $(CC)
+endif
+
COREBOOT_STANDARD_STAGES := bootblock romstage ramstage
ARCHDIR-i386 := x86
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 434bcc6..d4ee752 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -238,7 +238,7 @@ function compile_target
CURR=$( pwd )
#stime=`perl -e 'print time();' 2>/dev/null || date +%s`
build_dir=$TARGET/${VENDOR}_${MAINBOARD}
- eval $MAKE $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils \
+ eval $BUILDPREFIX $MAKE $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils \
&> ${build_dir}/make.log
ret=$?
cp .xcompile ${build_dir}/xcompile.build
@@ -291,13 +291,16 @@ function build_target
stime=`perl -e 'print time();' 2>/dev/null || date +%s`
create_buildenv $VENDOR $MAINBOARD $CONFIG
if [ $? -eq 0 -a $configureonly -eq 0 ]; then
+ BUILDPREFIX=
if [ "$scanbuild" = "true" ]; then
- rm -rf $TARGET/scan-build-results-tmp
+ scanbuild_out=$TARGET/${VENDOR}_${MAINBOARD}-scanbuild
+ rm -rf ${scanbuild_out}
+ BUILDPREFIX="scan-build -o ${scanbuild_out}tmp"
fi
compile_target $VENDOR $MAINBOARD
if [ "$scanbuild" = "true" ]; then
- rm -rf $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
- mv `dirname $TARGET/scan-build-results-tmp/*/index.html` $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
+ mv ${scanbuild_out}tmp/* ${scanbuild_out}
+ rmdir ${scanbuild_out}tmp
fi
fi
# Not calculated here because we still print it in compile_target
@@ -386,7 +389,6 @@ function myhelp
printf " [-T|--test] submit image(s) to automated test system\n"
printf " [-c|--cpus <numcpus>] build on <numcpus> at the same time\n"
printf " [-s|--silent] omit compiler calls in logs\n"
- printf " [-sb|--scan-build] use clang's static analyzer\n"
printf " [-y|--ccache] use ccache\n"
printf " [-C|--config] configure-only mode\n"
printf " [-l|--loglevel <num>] set loglevel\n"
@@ -394,6 +396,7 @@ function myhelp
printf " [-P|--prefix <name>] file name prefix in CBFS\n"
printf " [-B|--blobs] Allow using binary files\n"
printf " [-L|--clang] Use clang\n"
+ printf " [--scan-build] use clang's static analyzer\n"
printf " [cbroot] absolute path to coreboot sources\n"
printf " (defaults to $ROOT)\n\n"
}
@@ -468,10 +471,9 @@ while true ; do
expr "$1" : '-\?[0-9]\+$' > /dev/null && test 0$1 -gt 1 && cpuconfig="on $1 cpus in parallel"
shift;;
-s|--silent) shift; silent="-s";;
- -sb|--scan-build) shift
+ --scan-build) shift
scanbuild=true
customizing="${customizing}, scan-build"
- configoptions="${configoptions}CONFIG_SCANBUILD_ENABLE=y\nCONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\""
;;
-y|--ccache) shift
customizing="${customizing}, ccache"
@@ -546,7 +548,17 @@ build_all_targets()
echo "CONFIG_USE_BLOBS=y" > $TMPCFG
fi
$MAKE -j $cpus DOTCONFIG=$TMPCFG obj=$TARGET/temp objutil=$TARGET/sharedutils allnoconfig
- $MAKE -j $cpus DOTCONFIG=$TMPCFG obj=$TARGET/temp objutil=$TARGET/sharedutils tools || exit 1
+ BUILDPREFIX=
+ if [ "$scanbuild" = "true" ]; then
+ scanbuild_out=$TARGET/sharedutils-scanbuild
+ rm -rf ${scanbuild_out}
+ BUILDPREFIX="scan-build -o ${scanbuild_out}tmp"
+ fi
+ $BUILDPREFIX $MAKE -j $cpus DOTCONFIG=$TMPCFG obj=$TARGET/temp objutil=$TARGET/sharedutils tools || exit 1
+ if [ "$scanbuild" = "true" ]; then
+ mv ${scanbuild_out}tmp/* ${scanbuild_out}
+ rmdir ${scanbuild_out}tmp
+ fi
rm -rf $TARGET/temp $TMPCFG
for VENDOR in $( vendors ); do
for MAINBOARD in $( mainboards $VENDOR ); do
diff --git a/util/lint/lint-stable-002-build-dir-handling b/util/lint/lint-stable-002-build-dir-handling
index 03f0b62..013d84a 100755
--- a/util/lint/lint-stable-002-build-dir-handling
+++ b/util/lint/lint-stable-002-build-dir-handling
@@ -33,7 +33,7 @@ fi
# $1: object directory
run_printall() {
-$MAKE CONFIG_USE_BLOBS=n CONFIG_CCACHE=n CONFIG_SCANBUILD_ENABLE=n NOMKDIR=1 \
+$MAKE CONFIG_USE_BLOBS=n CONFIG_CCACHE=n NOMKDIR=1 \
DOTCONFIG=$TMPCONFIG obj=$1 printall | \
sed -e "s,^ *,," -e "s,^r.mstage-objs:=,," \
-e "s,mainboard/[^/]*/[^/]*/,.../,g" | \
Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5773
-gerrit
commit 88edf5f0766e5793d69f633c405e8ef5ad01485c
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat May 17 19:05:56 2014 +0200
build: allow romcc to be wrapped
Allow ccache and scan-build to wrap romcc.
This works a bit different from the other compilers
because we only define it later.
Change-Id: I3adce91d3dde9dd50aa6a2baad5b457744f35575
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
Makefile | 2 +-
Makefile.inc | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 3404a51..5c4484a 100644
--- a/Makefile
+++ b/Makefile
@@ -135,7 +135,7 @@ CCACHE:=CCACHE_COMPILERCHECK=content CCACHE_BASEDIR=$(top) $(CCACHE)
CC := $(CCACHE) $(CC)
HOSTCC := $(CCACHE) $(HOSTCC)
HOSTCXX := $(CCACHE) $(HOSTCXX)
-ROMCC := $(CCACHE) $(ROMCC)
+ROMCC_BIN := $(CCACHE) $(ROMCC_BIN)
endif
strip_quotes = $(subst ",,$(subst \",,$(1)))
diff --git a/Makefile.inc b/Makefile.inc
index d098cff..529250d 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -280,8 +280,11 @@ ifeq ($(_WINCHECK),Cygwin)
STACK=-Wl,--stack,16384000
endif
-ROMCC:= $(objutil)/romcc/romcc
-$(ROMCC): $(top)/util/romcc/romcc.c
+# this allows ccache to prepend itself
+# (ccache handling happens first)
+ROMCC_BIN= $(objutil)/romcc/romcc
+ROMCC?=$(ROMCC_BIN)
+$(ROMCC_BIN): $(top)/util/romcc/romcc.c
@printf " HOSTCC $(subst $(obj)/,,$(@)) (this may take a while)\n"
@# Note: Adding -O2 here might cause problems. For details see:
@# http://www.coreboot.org/pipermail/coreboot/2010-February/055825.html
Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5774
-gerrit
commit e76324fd82455d7eb4ffe7e8107cd3fa4255ff30
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat May 17 18:26:38 2014 +0200
build: make scan-build work again
This drops the scan-build related Kconfig options
since it's now possible to simply run
scan-build [-o outdir] make
and get coreboot built with its report.
There's also no inner make process anymore, and the way
things work should be clearer now.
Also adapt abuild to this new reality.
Change-Id: I03e03334761ec83f718b3235ebf811834cd2e3e3
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
Makefile | 30 ----------------------------
src/Kconfig | 23 ---------------------
toolchain.inc | 16 +++++++++++++++
util/abuild/abuild | 28 ++++++++++++++++++--------
util/lint/lint-stable-002-build-dir-handling | 2 +-
5 files changed, 37 insertions(+), 62 deletions(-)
diff --git a/Makefile b/Makefile
index 3404a51..a1be172 100644
--- a/Makefile
+++ b/Makefile
@@ -30,19 +30,9 @@
## SUCH DAMAGE.
##
-ifeq ($(INNER_SCANBUILD),y)
-CC_real:=$(CC)
-endif
-
$(if $(wildcard .xcompile),,$(eval $(shell bash util/xcompile/xcompile $(XGCCPATH) > .xcompile)))
include .xcompile
-ifeq ($(INNER_SCANBUILD),y)
-CC:=$(CC_real)
-HOSTCC:=$(CC_real) --hostcc
-HOSTCXX:=$(CC_real) --hostcxx
-endif
-
export top := $(CURDIR)
export src := src
export srck := $(top)/util/kconfig
@@ -119,12 +109,10 @@ include $(HAVE_DOTCONFIG)
include toolchain.inc
-ifneq ($(INNER_SCANBUILD),y)
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
CC:=clang -m32 -mno-mmx -mno-sse -no-integrated-as
HOSTCC:=clang
endif
-endif
ifeq ($(CONFIG_CCACHE),y)
CCACHE:=$(word 1,$(wildcard $(addsuffix /ccache,$(subst :, ,$(PATH)))))
@@ -143,25 +131,7 @@ strip_quotes = $(subst ",,$(subst \",,$(1)))
# The primary target needs to be here before we include the
# other files
-ifeq ($(INNER_SCANBUILD),y)
-CONFIG_SCANBUILD_ENABLE:=
-endif
-
-ifeq ($(CONFIG_SCANBUILD_ENABLE),y)
-ifneq ($(CONFIG_SCANBUILD_REPORT_LOCATION),)
-CONFIG_SCANBUILD_REPORT_LOCATION:=-o $(CONFIG_SCANBUILD_REPORT_LOCATION)
-endif
-real-all:
- echo '#!/bin/sh' > .ccwrap
- echo 'CC="$(CC)"' >> .ccwrap
- echo 'if [ "$$1" = "--hostcc" ]; then shift; CC="$(HOSTCC)"; fi' >> .ccwrap
- echo 'if [ "$$1" = "--hostcxx" ]; then shift; CC="$(HOSTCXX)"; fi' >> .ccwrap
- echo 'eval $$CC $$*' >> .ccwrap
- chmod +x .ccwrap
- scan-build $(CONFIG_SCANBUILD_REPORT_LOCATION) -analyze-headers --use-cc=$(top)/.ccwrap --use-c++=$(top)/.ccwrap $(MAKE) INNER_SCANBUILD=y
-else
real-all: real-target
-endif
# must come rather early
.SECONDEXPANSION:
diff --git a/src/Kconfig b/src/Kconfig
index 30f996d..53a23bb 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -80,29 +80,6 @@ config ANY_TOOLCHAIN
we'll have to assume that they use their distro compiler by mistake.
Make sure that using patched compilers is a conscious decision.
-config SCANBUILD_ENABLE
- bool "Build with scan-build for static code analysis"
- default n
- help
- Changes the build process to use scan-build (a utility for
- running the clang static code analyzer from the command line).
-
- Requires the scan-build utility in your system $PATH.
-
- For details see http://clang-analyzer.llvm.org/scan-build.html.
-
-config SCANBUILD_REPORT_LOCATION
- string "Directory for the scan-build report(s)"
- default ""
- depends on SCANBUILD_ENABLE
- help
- Directory where the scan-build reports should be stored in. The
- reports are stored in subdirectories of the form 'yyyy-mm-dd-*'
- in the specified directory.
-
- If this setting is left empty, the coreboot top-level directory
- will be used to store the report subdirectories.
-
config CCACHE
bool "Use ccache to speed up (re)compilation"
default n
diff --git a/toolchain.inc b/toolchain.inc
index 9417a73..bfa604b 100644
--- a/toolchain.inc
+++ b/toolchain.inc
@@ -19,6 +19,22 @@
ARCH_SUPPORTED := armv7 x86_32
+
+# scan-build integration
+ifneq ($(CCC_ANALYZER_OUTPUT_FORMAT),)
+
+ifeq ($(CCC_ANALYZER_ANALYSIS),)
+export CCC_ANALYZER_ANALYSIS := -analyzer-opt-analyze-headers
+endif
+
+$(foreach arch,$(ARCH_SUPPORTED), \
+ $(eval CC_$(arch):=CCC_CC=$(CC_$(arch)) $(CC) ))
+
+HOSTCC:=CCC_CC="$(HOSTCC)" $(CC)
+HOSTCXX:=CCC_CXX="$(HOSTCXX)" $(CXX)
+ROMCC=CCC_CC="$(ROMCC_BIN)" $(CC)
+endif
+
COREBOOT_STANDARD_STAGES := bootblock romstage ramstage
ARCHDIR-i386 := x86
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 434bcc6..d4ee752 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -238,7 +238,7 @@ function compile_target
CURR=$( pwd )
#stime=`perl -e 'print time();' 2>/dev/null || date +%s`
build_dir=$TARGET/${VENDOR}_${MAINBOARD}
- eval $MAKE $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils \
+ eval $BUILDPREFIX $MAKE $silent DOTCONFIG=${build_dir}/config.build obj=${build_dir} objutil=$TARGET/sharedutils \
&> ${build_dir}/make.log
ret=$?
cp .xcompile ${build_dir}/xcompile.build
@@ -291,13 +291,16 @@ function build_target
stime=`perl -e 'print time();' 2>/dev/null || date +%s`
create_buildenv $VENDOR $MAINBOARD $CONFIG
if [ $? -eq 0 -a $configureonly -eq 0 ]; then
+ BUILDPREFIX=
if [ "$scanbuild" = "true" ]; then
- rm -rf $TARGET/scan-build-results-tmp
+ scanbuild_out=$TARGET/${VENDOR}_${MAINBOARD}-scanbuild
+ rm -rf ${scanbuild_out}
+ BUILDPREFIX="scan-build -o ${scanbuild_out}tmp"
fi
compile_target $VENDOR $MAINBOARD
if [ "$scanbuild" = "true" ]; then
- rm -rf $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
- mv `dirname $TARGET/scan-build-results-tmp/*/index.html` $TARGET/${VENDOR}_${MAINBOARD}-scanbuild
+ mv ${scanbuild_out}tmp/* ${scanbuild_out}
+ rmdir ${scanbuild_out}tmp
fi
fi
# Not calculated here because we still print it in compile_target
@@ -386,7 +389,6 @@ function myhelp
printf " [-T|--test] submit image(s) to automated test system\n"
printf " [-c|--cpus <numcpus>] build on <numcpus> at the same time\n"
printf " [-s|--silent] omit compiler calls in logs\n"
- printf " [-sb|--scan-build] use clang's static analyzer\n"
printf " [-y|--ccache] use ccache\n"
printf " [-C|--config] configure-only mode\n"
printf " [-l|--loglevel <num>] set loglevel\n"
@@ -394,6 +396,7 @@ function myhelp
printf " [-P|--prefix <name>] file name prefix in CBFS\n"
printf " [-B|--blobs] Allow using binary files\n"
printf " [-L|--clang] Use clang\n"
+ printf " [--scan-build] use clang's static analyzer\n"
printf " [cbroot] absolute path to coreboot sources\n"
printf " (defaults to $ROOT)\n\n"
}
@@ -468,10 +471,9 @@ while true ; do
expr "$1" : '-\?[0-9]\+$' > /dev/null && test 0$1 -gt 1 && cpuconfig="on $1 cpus in parallel"
shift;;
-s|--silent) shift; silent="-s";;
- -sb|--scan-build) shift
+ --scan-build) shift
scanbuild=true
customizing="${customizing}, scan-build"
- configoptions="${configoptions}CONFIG_SCANBUILD_ENABLE=y\nCONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\""
;;
-y|--ccache) shift
customizing="${customizing}, ccache"
@@ -546,7 +548,17 @@ build_all_targets()
echo "CONFIG_USE_BLOBS=y" > $TMPCFG
fi
$MAKE -j $cpus DOTCONFIG=$TMPCFG obj=$TARGET/temp objutil=$TARGET/sharedutils allnoconfig
- $MAKE -j $cpus DOTCONFIG=$TMPCFG obj=$TARGET/temp objutil=$TARGET/sharedutils tools || exit 1
+ BUILDPREFIX=
+ if [ "$scanbuild" = "true" ]; then
+ scanbuild_out=$TARGET/sharedutils-scanbuild
+ rm -rf ${scanbuild_out}
+ BUILDPREFIX="scan-build -o ${scanbuild_out}tmp"
+ fi
+ $BUILDPREFIX $MAKE -j $cpus DOTCONFIG=$TMPCFG obj=$TARGET/temp objutil=$TARGET/sharedutils tools || exit 1
+ if [ "$scanbuild" = "true" ]; then
+ mv ${scanbuild_out}tmp/* ${scanbuild_out}
+ rmdir ${scanbuild_out}tmp
+ fi
rm -rf $TARGET/temp $TMPCFG
for VENDOR in $( vendors ); do
for MAINBOARD in $( mainboards $VENDOR ); do
diff --git a/util/lint/lint-stable-002-build-dir-handling b/util/lint/lint-stable-002-build-dir-handling
index 03f0b62..013d84a 100755
--- a/util/lint/lint-stable-002-build-dir-handling
+++ b/util/lint/lint-stable-002-build-dir-handling
@@ -33,7 +33,7 @@ fi
# $1: object directory
run_printall() {
-$MAKE CONFIG_USE_BLOBS=n CONFIG_CCACHE=n CONFIG_SCANBUILD_ENABLE=n NOMKDIR=1 \
+$MAKE CONFIG_USE_BLOBS=n CONFIG_CCACHE=n NOMKDIR=1 \
DOTCONFIG=$TMPCONFIG obj=$1 printall | \
sed -e "s,^ *,," -e "s,^r.mstage-objs:=,," \
-e "s,mainboard/[^/]*/[^/]*/,.../,g" | \