Blame SOURCES/gdb-ccache-workaround.patch

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