Blame SOURCES/gdb-ccache-workaround.patch

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