Blame SOURCES/gdb-ccache-workaround.patch

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