Blame SOURCES/gdb-ccache-workaround.patch

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