Pass the 'O' environment variable to the kernel build system in order to allow specifying a custom build directory. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@xxxxxxxxxxxxx> --- smatch_scripts/build_generic_data.sh | 6 ++++-- smatch_scripts/kchecker | 5 ++++- smatch_scripts/test_generic.sh | 7 +++++-- smatch_scripts/test_kernel.sh | 7 +++++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/smatch_scripts/build_generic_data.sh b/smatch_scripts/build_generic_data.sh index 938124315f64..b18ceff8320c 100755 --- a/smatch_scripts/build_generic_data.sh +++ b/smatch_scripts/build_generic_data.sh @@ -58,8 +58,11 @@ fi if [[ ! -z $CROSS_COMPILE ]] ; then KERNEL_CROSS_COMPILE="CROSS_COMPILE=$CROSS_COMPILE" fi +if [[ ! -z $O ]] ; then + KERNEL_O="O=$O" +fi -make $KERNEL_ARCH $KERNEL_CROSS_COMPILE -j${NR_CPU} CHECK="$BIN_DIR/smatch --call-tree --info --spammy --file-output" $TARGET +make $KERNEL_ARCH $KERNEL_CROSS_COMPILE $KERNEL_O -j${NR_CPU} CHECK="$BIN_DIR/smatch --call-tree --info --spammy --file-output" $TARGET find -name \*.c.smatch -exec cat \{\} \; -exec rm \{\} \; > smatch_warns.txt @@ -71,4 +74,3 @@ mkdir -p $DATA_DIR mv $PROJECT.* $DATA_DIR $SCRIPT_DIR/../smatch_data/db/create_db.sh -p=$PROJECT smatch_warns.txt - diff --git a/smatch_scripts/kchecker b/smatch_scripts/kchecker index 6aa26fb089ce..7062f454e115 100755 --- a/smatch_scripts/kchecker +++ b/smatch_scripts/kchecker @@ -76,5 +76,8 @@ fi if [[ ! -z $CROSS_COMPILE ]] ; then KERNEL_CROSS_COMPILE="CROSS_COMPILE=$CROSS_COMPILE" fi +if [[ ! -z $O ]] ; then + KERNEL_O="O=$O" +fi -make $KERNEL_CROSS_COMPILE $KERNEL_ARCH C=2 $ENDIAN CHECK="$PRE $CMD $POST" $oname +make $KERNEL_CROSS_COMPILE $KERNEL_ARCH $KERNEL_O C=2 $ENDIAN CHECK="$PRE $CMD $POST" $oname diff --git a/smatch_scripts/test_generic.sh b/smatch_scripts/test_generic.sh index 5707d7c6ae70..5006d469fa2a 100755 --- a/smatch_scripts/test_generic.sh +++ b/smatch_scripts/test_generic.sh @@ -58,10 +58,13 @@ fi if [[ ! -z $CROSS_COMPILE ]] ; then KERNEL_CROSS_COMPILE="CROSS_COMPILE=$CROSS_COMPILE" fi +if [[ ! -z $O ]] ; then + KERNEL_O="O=$O" +fi -make $KERNEL_ARCH $KERNEL_CROSS_COMPILE clean +make $KERNEL_ARCH $KERNEL_CROSS_COMPILE $KERNEL_O clean find -name \*.c.smatch -exec rm \{\} \; -make $KERNEL_ARCH $KERNEL_CROSS_COMPILE -j${NR_CPU} $ENDIAN -k CHECK="$CMD --file-output $*" \ +make $KERNEL_ARCH $KERNEL_CROSS_COMPILE $KERNEL_O -j${NR_CPU} $ENDIAN -k CHECK="$CMD --file-output $*" \ C=1 $TARGET 2>&1 | tee $LOG find -name \*.c.smatch -exec cat \{\} \; -exec rm \{\} \; > $WLOG diff --git a/smatch_scripts/test_kernel.sh b/smatch_scripts/test_kernel.sh index 5d14c42fc7ca..6ff297556b07 100755 --- a/smatch_scripts/test_kernel.sh +++ b/smatch_scripts/test_kernel.sh @@ -67,12 +67,15 @@ fi if [[ ! -z $CROSS_COMPILE ]] ; then KERNEL_CROSS_COMPILE="CROSS_COMPILE=$CROSS_COMPILE" fi +if [[ ! -z $O ]] ; then + KERNEL_O="O=$O" +fi -make $KERNEL_ARCH $KERNEL_CROSS_COMPILE clean +make $KERNEL_ARCH $KERNEL_CROSS_COMPILE $KERNEL_O clean find -name \*.c.smatch -exec rm \{\} \; find -name \*.c.smatch.sql -exec rm \{\} \; find -name \*.c.smatch.caller_info -exec rm \{\} \; -make $KERNEL_ARCH $KERNEL_CROSS_COMPILE -j${NR_CPU} $ENDIAN -k CHECK="$CMD -p=kernel --file-output --succeed $*" \ +make $KERNEL_ARCH $KERNEL_CROSS_COMPILE $KERNEL_O -j${NR_CPU} $ENDIAN -k CHECK="$CMD -p=kernel --file-output --succeed $*" \ C=1 $BUILD_PARAM $TARGET 2>&1 | tee $LOG BUILD_STATUS=${PIPESTATUS[0]} find -name \*.c.smatch -exec cat \{\} \; -exec rm \{\} \; > $WLOG -- 2.45.2