Blame SOURCES/gdb-ccache-workaround.patch

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