summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutil/twister_launcher.py4
-rw-r--r--zephyr/cmake/compiler/clang/compiler_flags.cmake3
-rw-r--r--zephyr/cmake/compiler/gcc/compiler_flags.cmake3
-rw-r--r--zephyr/cmake/linker/ld/clang/linker_flags.cmake7
-rw-r--r--zephyr/cmake/linker/ld/gcc/linker_flags.cmake4
-rw-r--r--zephyr/cmake/toolchain/llvm/target.cmake1
6 files changed, 21 insertions, 1 deletions
diff --git a/util/twister_launcher.py b/util/twister_launcher.py
index ef41b7621b..11202f9343 100755
--- a/util/twister_launcher.py
+++ b/util/twister_launcher.py
@@ -37,6 +37,10 @@ parameters that may be used, please consult the Twister documentation.
# version: "version:5.8.0.chromium.3"
# >
# wheel: <
+# name: "infra/python/wheels/pyelftools-py2_py3"
+# version: "version:0.29"
+# >
+# wheel: <
# name: "infra/python/wheels/pykwalify-py2_py3"
# version: "version:1.8.0"
# >
diff --git a/zephyr/cmake/compiler/clang/compiler_flags.cmake b/zephyr/cmake/compiler/clang/compiler_flags.cmake
index 536540eb1e..f24e1f1f4c 100644
--- a/zephyr/cmake/compiler/clang/compiler_flags.cmake
+++ b/zephyr/cmake/compiler/clang/compiler_flags.cmake
@@ -21,3 +21,6 @@ check_set_compiler_property(APPEND PROPERTY warning_extended -Wunused-variable
-Werror=unused-variable -Werror=missing-braces
-Werror=sometimes-uninitialized -Werror=unused-function
-Werror=array-bounds)
+
+# clang flags for coverage generation
+set_property(TARGET compiler PROPERTY coverage --coverage -fno-inline)
diff --git a/zephyr/cmake/compiler/gcc/compiler_flags.cmake b/zephyr/cmake/compiler/gcc/compiler_flags.cmake
index adc111835e..fbc7ca1d61 100644
--- a/zephyr/cmake/compiler/gcc/compiler_flags.cmake
+++ b/zephyr/cmake/compiler/gcc/compiler_flags.cmake
@@ -8,3 +8,6 @@ include("${ZEPHYR_BASE}/cmake/compiler/gcc/compiler_flags.cmake")
# Disable position independent code.
add_compile_options(-fno-PIC)
+
+# gcc flags for coverage generation
+set_compiler_property(PROPERTY coverage -fprofile-arcs -ftest-coverage -fno-inline)
diff --git a/zephyr/cmake/linker/ld/clang/linker_flags.cmake b/zephyr/cmake/linker/ld/clang/linker_flags.cmake
new file mode 100644
index 0000000000..38f5428d13
--- /dev/null
+++ b/zephyr/cmake/linker/ld/clang/linker_flags.cmake
@@ -0,0 +1,7 @@
+# Copyright 2022 The ChromiumOS Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+if (NOT CONFIG_COVERAGE_GCOV)
+ set_property(TARGET linker PROPERTY coverage --coverage)
+endif()
diff --git a/zephyr/cmake/linker/ld/gcc/linker_flags.cmake b/zephyr/cmake/linker/ld/gcc/linker_flags.cmake
index f71793c431..b5ec8b05ca 100644
--- a/zephyr/cmake/linker/ld/gcc/linker_flags.cmake
+++ b/zephyr/cmake/linker/ld/gcc/linker_flags.cmake
@@ -2,6 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+if (NOT CONFIG_COVERAGE_GCOV)
+ set_property(TARGET linker PROPERTY coverage -lgcov)
+endif()
+
# GCC 11 by default emits DWARF version 5 which cannot be parsed by
# pyelftools. Can be removed once pyelftools supports v5.
add_link_options(-gdwarf-4)
diff --git a/zephyr/cmake/toolchain/llvm/target.cmake b/zephyr/cmake/toolchain/llvm/target.cmake
index 00669a590b..e8e5df7be1 100644
--- a/zephyr/cmake/toolchain/llvm/target.cmake
+++ b/zephyr/cmake/toolchain/llvm/target.cmake
@@ -7,7 +7,6 @@ set(LINKER lld)
set(BINTOOLS llvm)
# Mapping of Zephyr architecture -> toolchain triple
-# Note only "posix" is supported at the moment.
set(CROSS_COMPILE_TARGET_posix x86_64-pc-linux-gnu)
set(CROSS_COMPILE_TARGET_unit_testing x86_64-pc-linux-gnu)