Blame SOURCES/gdb-ccache-workaround.patch

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