Blame SOURCES/gdb-ccache-workaround.patch

6240d7
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
6240d7
From: Fedora GDB patches <invalid@email.com>
6240d7
Date: Fri, 27 Oct 2017 21:07:50 +0200
6240d7
Subject: gdb-ccache-workaround.patch
6240d7
6240d7
;; Workaround ccache making lineno non-zero for command-line definitions.
6240d7
;;=fedoratest: ccache is rarely used and it is even fixed now.
6240d7
6240d7
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
6240d7
--- a/gdb/testsuite/gdb.base/macscp.exp
6240d7
+++ b/gdb/testsuite/gdb.base/macscp.exp
6240d7
@@ -25,6 +25,14 @@ if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
6240d7
     lappend options additional_flags=-g3
6240d7
 }
6240d7
 
6240d7
+# Workaround ccache making lineno non-zero for command-line definitions.
6240d7
+if {[find_gcc] == "gcc" && [file executable "/usr/bin/gcc"]} {
6240d7
+    set result [catch "exec which gcc" output]
6240d7
+    if {$result == 0 && [string first "/ccache/" $output] > -1} {
6240d7
+	lappend options "compiler=/usr/bin/gcc"
6240d7
+    }
6240d7
+}
6240d7
+
6240d7
 # Generate the intermediate object file.  This is required by Darwin to
6240d7
 # have access to the .debug_macinfo section.
6240d7
 if  {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \