Blame SOURCES/gdb-ccache-workaround.patch

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