Blame SOURCES/gdb-ccache-workaround.patch

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