Blame SOURCES/gdb-ccache-workaround.patch

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