Blame SOURCES/gdb-ccache-workaround.patch

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