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