Blame SOURCES/gdb-ccache-workaround.patch

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