From eba7c48f131d8fd5a1d840949d8ead2ecfe65edc Mon Sep 17 00:00:00 2001 From: MQueiros Date: Tue, 20 Oct 2020 16:01:37 +0100 Subject: Remove compiler arguments from CLANG_TIDY_EXE cclang-tidy doesn't process compilation flags like "-mlittle-endian" and "sysroot". The current export tries to use those flags, which makes clang-tidy fail like in the following example: > $ aarch64-poky-linux-clang-tidy fibonacci.cpp -mlittle-endian --sysroot=/opt/mgu22/sysroots/aarch64-poky-linux > LLVM ERROR: CommonOptionsParser: failed to parse command-line arguments. [CommonOptionsParser]: aarch64-poky-linux-clang-tidy: Unknown command line argument '-mlittle-endian'. Try: 'aarch64-poky-linux-clan$ > aarch64-poky-linux-clang-tidy: Did you mean '--list-checks'? > aarch64-poky-linux-clang-tidy: Unknown command line argument '--sysroot=/opt/mgu22/sysroots/aarch64-poky-linux'. Try: 'aarch64-poky-linux-clang-tidy --help' > aarch64-poky-linux-clang-tidy: Did you mean '--color=/opt/mgu22/sysroots/aarch64-poky-linux'? This change removes those compiler arguments: > $ aarch64-poky-linux-clang-tidy fibonacci.cpp > Error while trying to load a compilation database: > Could not auto-detect compilation database for file "fibonacci.cpp" > No compilation database found in /home/mqueiros/workspace/minimal-working-example/fibonacci or any parent directory > fixed-compilation-database: Error while opening fixed database: No such file or directory > json-compilation-database: Error while opening JSON database: No such file or directory > Running without flags. Signed-off-by: Mauro Queiros Backported from master to dunfell branch (cherry picked from commit 9d5fd8357d2f00a273f3d80fb37bb07cc537a155). Signed-off-by: Daniel Dittmann --- recipes-core/meta/meta-environment.bbappend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-core/meta/meta-environment.bbappend b/recipes-core/meta/meta-environment.bbappend index 725a431..d59bfd6 100644 --- a/recipes-core/meta/meta-environment.bbappend +++ b/recipes-core/meta/meta-environment.bbappend @@ -14,6 +14,6 @@ create_sdk_files_append() { echo 'export CLANGCC="${TARGET_PREFIX}clang ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script echo 'export CLANGCXX="${TARGET_PREFIX}clang++ ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script echo 'export CLANGCPP="${TARGET_PREFIX}clang -E ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script - echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script + echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy"' >> $script fi } -- cgit v1.2.3-54-g00ecf