Blame SOURCES/gdb-ccache-workaround.patch

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