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