[SSSD] [PATCH] CI: Workaroung for code coverage with old gcc

Lukas Slebodnik lslebodn at redhat.com
Mon Nov 9 09:16:46 UTC 2015


ehlo,

attached patch is a solution/workaround
running test in code coverage with old gcc

LS
-------------- next part --------------
>From 873d5b4fb6b7ce6d5fe249b7d80f05169fd3fddd Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Mon, 9 Nov 2015 08:56:54 +0100
Subject: [PATCH] CI: Workaroung for code coverage with old gcc

It's fixed in upstream gcc >= 4.6.0

Resolves:
https://fedorahosted.org/sssd/ticket/2819
---
 contrib/ci/run | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/contrib/ci/run b/contrib/ci/run
index a65ad8dcab31d33f3c69eb448714287c26f545e9..090751d84c7151e54a5295cc729dd9a4fc4c1ea1 100755
--- a/contrib/ci/run
+++ b/contrib/ci/run
@@ -257,9 +257,19 @@ function build_debug()
 function build_coverage()
 {
     declare -r coverage_report_dir="ci-report-coverage"
+    declare extra_CFLAGS=""
     declare test_dir
 
-    export CFLAGS="$COVERAGE_CFLAGS"
+    if [[ "$DISTRO_BRANCH" == -redhat-redhatenterprise*-6.*- ||
+          "$DISTRO_BRANCH" == -redhat-centos-6.*- ]]; then
+        # enable optimisation to avoid bug in gcc < 4.6.0
+        # gcc commit 7959b7e646b493f48a2ea7228fbf1c43f84bedea
+        # git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162384
+        #             138bc75d-0d04-0410-961f-82ee72b054a4
+        extra_CFLAGS=" -O1"
+    fi
+
+    export CFLAGS="$COVERAGE_CFLAGS $extra_CFLAGS"
 
     test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
     stage configure         "$BASE_DIR/configure" \
-- 
2.5.0



More information about the sssd-devel mailing list