[llvmlinux] Clang Static Analyzer for Kernel ARM targets

Charlebois, Mark mcharleb at quicinc.com
Tue Nov 26 16:37:51 UTC 2013


You are not passing the -target flag to clang so it has no idea what target you are building for.

-Mark   
________________________________________
From: llvmlinux-bounces at lists.linuxfoundation.org [llvmlinux-bounces at lists.linuxfoundation.org] on behalf of hdwivedi at codeaurora.org [hdwivedi at codeaurora.org]
Sent: Tuesday, November 26, 2013 7:12 AM
To: llvmlinux at lists.linuxfoundation.org
Subject: [llvmlinux] Clang Static Analyzer for Kernel ARM targets

I was trying to run the Clang static analyzer for ARM target for kernel
and started seeing the following error:

error: unknown target CPU 'armv7-a'

warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean
'-Wno-uninitialized'? [-Wunknown-warning-option]



At the end of it I see:

scan-build: 0 bugs found.

scan-build: The analyzer encountered problems on some source files.



It looks to me that since the CPU target is not being recognized, the
analyzer is probably not running on anything at all.

To sum up, would it be possible to run the scan-build utility on a kernel
for ARM target?

Thanks,
Harsh

PS: This is the build command line I'm using:

CLANG_PATH="/../llvmlinux/toolchain/clang/install/bin/clang"
time /../llvmlinux/toolchain/clang/install/bin/scan-build -o outputdir
--use-cc $CLANG_PATH make ARCH=arm CROSS_COMPILE="arm-linux-androideabi-"
CFLAGS_KERNE\

  L="-isystem $INCLUDE_FILES" CFLAGS_MODULE="-isystem $INCLUDE_FILES"
CONFIG_DEBUG_INFO=1 CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_NO_ERROR_ON_MISMATCH=y 'CC?="$CLANG_PATH -gcc-toolchain
$GCC_TOOLCHAIN"'

_______________________________________________
LLVMLinux mailing list
LLVMLinux at lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux


More information about the LLVMLinux mailing list