From 96e8f697eeac55f745c784aed7e0179bf2d26ff2 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 16 Apr 2019 10:51:19 -0400 Subject: [PATCH] jjb: fix coverity on gcc >= 7 Signed-off-by: Michael Jeanson --- jobs/lttng-modules.yaml | 8 +++++++- jobs/lttng-tools.yaml | 3 +++ scripts/common/coverity.sh | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/jobs/lttng-modules.yaml b/jobs/lttng-modules.yaml index 5867d30..c18c01a 100644 --- a/jobs/lttng-modules.yaml +++ b/jobs/lttng-modules.yaml @@ -431,7 +431,7 @@ builders: - shell: | - git clone --depth=1 -b v4.10 --reference $HOME/gitcache/linux-stable.git/ git://git-mirror.internal.efficios.com/kernel/stable/linux-stable.git src/linux + git clone --depth=1 -b v4.20 --reference $HOME/gitcache/linux-stable.git/ git://git-mirror.internal.efficios.com/kernel/stable/linux-stable.git src/linux cd src/linux make defconfig sed -i "s/# CONFIG_KALLSYMS_ALL is not set/CONFIG_KALLSYMS_ALL=y/g" .config @@ -439,6 +439,12 @@ - shell: !include-raw-escape: scripts/common/coverity.sh + publishers: + - archive: + artifacts: 'analysis-results.tgz,cov-int/**' + allow-empty: false + - workspace-cleanup + - job-template: name: lttng-modules_{mversion}_cppcheck defaults: lttng-modules diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml index 6084266..3e4d895 100644 --- a/jobs/lttng-tools.yaml +++ b/jobs/lttng-tools.yaml @@ -611,6 +611,9 @@ !include-raw-escape: scripts/common/coverity.sh publishers: + - archive: + artifacts: 'analysis-results.tgz,cov-int/**' + allow-empty: false - workspace-cleanup # TODO diff --git a/scripts/common/coverity.sh b/scripts/common/coverity.sh index c0476c2..7b06f55 100755 --- a/scripts/common/coverity.sh +++ b/scripts/common/coverity.sh @@ -112,6 +112,28 @@ if [ -d "$WORKSPACE/src/linux" ]; then export KERNELDIR="$WORKSPACE/src/linux" fi +# Hack to get coverity with gcc >= 7 +# +# We have to define the _Float* types as those are not defined by coverity and as result +# the codes linking agains those (pretty much anything linking against stdlib.h and math.h) +# won't be covered. +echo " +#ifdef __cplusplus +extern "C" { +#endif + +#define _Float128 long double +#define _Float64x long double +#define _Float64 double +#define _Float32x double +#define _Float32 float + +#ifdef __cplusplus +} +#endif" >> /tmp/coverity.h + +export CPPFLAGS="-include /tmp/coverity.h ${CPPFLAGS:-}" + # Verify upload is permitted set +x -- 2.34.1