This file is indexed.

/usr/share/cross-gcc/patches/gcc-4.9/0006-Allow-target-selection-via-dpkg-buildpackage-target-.patch is in cross-gcc-dev 176.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
From 29c6c1bf13d1cce9312f241b07c72c1bcb12a230 Mon Sep 17 00:00:00 2001
From: Helmut Grohne <helmut@subdivi.de>
Date: Thu, 18 Dec 2014 14:39:19 -0800
Subject: [PATCH 6/7] Allow target selection via dpkg-buildpackage
 --target-arch. Closes: #773065

---
 debian/rules.defs | 52 ++++++++++++++++------------------------------------
 1 file changed, 16 insertions(+), 36 deletions(-)

diff --git a/debian/rules.defs b/debian/rules.defs
index 2a3d782..b38a576 100644
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -31,23 +31,7 @@ vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1)))
 # for rules.sonames
 vafilt_defined = 1
 
-dpkg_target_vars := $(shell (dpkg-architecture | grep -q DEB_TARGET) && echo yes)
-ifeq ($(dpkg_target_vars),yes)
-  DEB_TARGET_ARCH=
-  DEB_TARGET_ARCH_BITS=
-  DEB_TARGET_ARCH_CPU=
-  DEB_TARGET_ARCH_ENDIAN=
-  DEB_TARGET_ARCH_OS=
-  DEB_TARGET_GNU_CPU=
-  DEB_TARGET_GNU_SYSTEM=
-  DEB_TARGET_GNU_TYPE=
-  DEB_TARGET_MULTIARCH=
-endif
-
 DPKG_VARS		:= $(shell dpkg-architecture)
-ifeq ($(dpkg_target_vars),yes)
-  DPKG_VARS		:= $(filter-out DEB_TARGET_%, $(DPKG_VARS))
-endif
 DEB_BUILD_ARCH		?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH)
 DEB_BUILD_GNU_TYPE	?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE)
 DEB_BUILD_MULTIARCH	?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_MULTIARCH)
@@ -97,7 +81,7 @@ export LIBC_FATAL_STDERR_=1
 
 # ---------------------------------------------------------------------------
 # set target
-# - GNU triplet via DEB_TARGET_GNU_TYPE
+# - dpkg-buildpackage --target-arch (via DEB_TARGET_ARCH)
 # - Debian arch in debian/target
 # - Debian arch via DEB_GCC_TARGET or GCC_TARGET
 #
@@ -105,32 +89,28 @@ export LIBC_FATAL_STDERR_=1
 ifdef GCC_TARGET
   DEB_GCC_TARGET := $(GCC_TARGET)
 endif
-ifdef DEB_TARGET_GNU_TYPE
-  TARGET_VARS := $(shell dpkg-architecture -f -t$(DEB_TARGET_GNU_TYPE) 2>/dev/null)
-else
-  # allow debian/target to be used instead of DEB_GCC_TARGET - this was requested
-  # by toolchain-source maintainer
-  DEBIAN_TARGET_FILE := $(strip $(if $(wildcard debian/target),$(shell cat debian/target 2>/dev/null)))
-  ifndef DEB_TARGET_ARCH
-    ifneq (,$(DEBIAN_TARGET_FILE))
-      DEB_TARGET_ARCH := $(DEBIAN_TARGET_FILE)
-    else
-      ifdef DEB_GCC_TARGET
-        DEB_TARGET_ARCH := $(DEB_GCC_TARGET)
-      else
-        DEB_TARGET_ARCH := $(DEB_HOST_ARCH)
-      endif
+# since dpkg 1.17.14, DEB_TARGET_* default to DEB_HOST_*
+DEB_TARGET_ARCH ?= $(DEB_HOST_ARCH)
+# allow debian/target to be used instead of DEB_GCC_TARGET - this was requested
+# by toolchain-source maintainer
+DEBIAN_TARGET_FILE := $(strip $(if $(wildcard debian/target),$(shell cat debian/target 2>/dev/null)))
+# consider DEB_TARGET_* set, if it differs from DEB_HOST_*
+ifeq ($(DEB_TARGET_ARCH),$(DEB_HOST_ARCH))
+  ifneq (,$(DEBIAN_TARGET_FILE))
+    DEB_TARGET_ARCH := $(DEBIAN_TARGET_FILE)
+  else
+    ifdef DEB_GCC_TARGET
+      DEB_TARGET_ARCH := $(DEB_GCC_TARGET)
     endif
   endif
-  TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH) 2>/dev/null)
-endif
-ifeq ($(dpkg_target_vars),yes)
-  TARGET_VARS		:= $(filter-out DEB_TARGET_%, $(TARGET_VARS))
 endif
+TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH) 2>/dev/null)
 
 DEB_TARGET_ARCH		:= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH)
+DEB_TARGET_ARCH_BITS	:= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_BITS)
 DEB_TARGET_ARCH_OS	:= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_OS)
 DEB_TARGET_ARCH_CPU	:= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_CPU)
+DEB_TARGET_ARCH_ENDIAN	:= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_ENDIAN)
 DEB_TARGET_GNU_CPU	:= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_CPU)
 DEB_TARGET_GNU_TYPE	:= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_TYPE)
 DEB_TARGET_GNU_SYSTEM	:= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_SYSTEM)
-- 
2.8.1