This file is indexed.

/usr/share/cross-gcc/patches/gcc-8/0004-added-multi-arch-specific-install-location-patch.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
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
From af60f537bb8396605243958709edd70ada112cb1 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
Date: Mon, 15 Dec 2014 14:48:09 -0800
Subject: [PATCH 04/10] added multi-arch-specific install-location patch

Added cross-ma-install-location.diff, a multiarch analogue or the existing
cross-install-location.diff. Using this if with_deps_on_target_arch_pkgs
---
 debian/patches/cross-ma-install-location.diff | 357 ++++++++++++++++++++++++++
 debian/rules.patch                            |  10 +-
 2 files changed, 364 insertions(+), 3 deletions(-)
 create mode 100644 debian/patches/cross-ma-install-location.diff

diff --git a/debian/patches/cross-ma-install-location.diff b/debian/patches/cross-ma-install-location.diff
new file mode 100644
index 0000000..7dd01d0
--- /dev/null
+++ b/debian/patches/cross-ma-install-location.diff
@@ -0,0 +1,357 @@
+Index: b/src/libada/configure.ac
+===================================================================
+--- a/src/libada/configure.ac
++++ b/src/libada/configure.ac
+@@ -65,15 +65,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libffi/configure.ac
+===================================================================
+--- a/src/libffi/configure.ac
++++ b/src/libffi/configure.ac
+@@ -497,14 +497,9 @@
+     AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
+   fi)
+ 
+-if test -n "$with_cross_host" &&
+-   test x"$with_cross_host" != x"no"; then
+-  toolexecdir='$(exec_prefix)/$(target_alias)'
+-  toolexeclibdir='$(toolexecdir)/lib'
+-else
+-  toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-  toolexeclibdir='$(libdir)'
+-fi
++toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++toolexeclibdir='$(libdir)'
++
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+   .) ;; # Avoid trailing /.
+Index: b/src/libgcc/configure.ac
+===================================================================
+--- a/src/libgcc/configure.ac
++++ b/src/libgcc/configure.ac
+@@ -95,8 +95,6 @@
+ slibdir="$with_slibdir",
+ if test "${version_specific_libs}" = yes; then
+   slibdir='$(libsubdir)'
+-elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
+-  slibdir='$(exec_prefix)/$(host_noncanonical)/lib'
+ else
+   slibdir='$(libdir)'
+ fi)
+@@ -141,15 +139,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libgfortran/configure.ac
+===================================================================
+--- a/src/libgfortran/configure.ac
++++ b/src/libgfortran/configure.ac
+@@ -98,15 +98,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libgo/configure.ac
+===================================================================
+--- a/src/libgo/configure.ac
++++ b/src/libgo/configure.ac
+@@ -80,14 +80,8 @@
+ 
+ # Calculate glibgo_toolexecdir, glibgo_toolexeclibdir
+ # Install a library built with a cross compiler in tooldir, not libdir.
+-if test -n "$with_cross_host" &&
+-   test x"$with_cross_host" != x"no"; then
+-  nover_glibgo_toolexecdir='${exec_prefix}/${host_alias}'
+-  nover_glibgo_toolexeclibdir='${toolexecdir}/lib'
+-else
+-  nover_glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
+-  nover_glibgo_toolexeclibdir='${libdir}'
+-fi
++nover_glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
++nover_glibgo_toolexeclibdir='${libdir}'
+ multi_os_directory=`$GOC -print-multi-os-directory`
+ case $multi_os_directory in
+   .) ;; # Avoid trailing /.
+Index: b/src/libgomp/configure.ac
+===================================================================
+--- a/src/libgomp/configure.ac
++++ b/src/libgomp/configure.ac
+@@ -76,15 +76,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libitm/configure.ac
+===================================================================
+--- a/src/libitm/configure.ac
++++ b/src/libitm/configure.ac
+@@ -90,15 +90,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libobjc/configure.ac
+===================================================================
+--- a/src/libobjc/configure.ac
++++ b/src/libobjc/configure.ac
+@@ -108,15 +108,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_noncanonical)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libquadmath/configure.ac
+===================================================================
+--- a/src/libquadmath/configure.ac
++++ b/src/libquadmath/configure.ac
+@@ -93,15 +93,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libssp/configure.ac
+===================================================================
+--- a/src/libssp/configure.ac
++++ b/src/libssp/configure.ac
+@@ -170,15 +170,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libstdc++-v3/acinclude.m4
+===================================================================
+--- a/src/libstdc++-v3/acinclude.m4
++++ b/src/libstdc++-v3/acinclude.m4
+@@ -840,14 +840,8 @@
+   # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
+   # Install a library built with a cross compiler in tooldir, not libdir.
+   if test x"$glibcxx_toolexecdir" = x"no"; then
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
+-      glibcxx_toolexeclibdir='${toolexecdir}/lib'
+-    else
+-      glibcxx_toolexecdir='${libdir}/gcc/${host_alias}'
+-      glibcxx_toolexeclibdir='${libdir}'
+-    fi
++    glibcxx_toolexecdir='${libdir}/gcc/${host_alias}'
++    glibcxx_toolexeclibdir='${libdir}'
+     multi_os_directory=`$CXX -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/zlib/configure.ac
+===================================================================
+--- a/src/zlib/configure.ac
++++ b/src/zlib/configure.ac
+@@ -91,14 +91,9 @@
+ 
+ AC_CHECK_HEADERS(unistd.h)
+ 
+-if test -n "$with_cross_host" &&
+-   test x"$with_cross_host" != x"no"; then
+-  toolexecdir='$(exec_prefix)/$(target_alias)'
+-  toolexeclibdir='$(toolexecdir)/lib'
+-else
+-  toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-  toolexeclibdir='$(libdir)'
+-fi
++toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++toolexeclibdir='$(libdir)'
++
+ if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
+   multiosdir=/`$CC -print-multi-os-directory`
+   case $multiosdir in
+Index: b/src/libatomic/configure.ac
+===================================================================
+--- a/src/libatomic/configure.ac
++++ b/src/libatomic/configure.ac
+@@ -96,15 +96,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libsanitizer/configure.ac
+===================================================================
+--- a/src/libsanitizer/configure.ac
++++ b/src/libsanitizer/configure.ac
+@@ -40,15 +40,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+Index: b/src/libvtv/configure.ac
+===================================================================
+--- a/src/libvtv/configure.ac
++++ b/src/libvtv/configure.ac
+@@ -72,15 +72,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
+--- a/src/libmpx/configure.ac
++++ b/src/libmpx/configure.ac
+@@ -70,15 +70,8 @@
+     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+     ;;
+   no)
+-    if test -n "$with_cross_host" &&
+-       test x"$with_cross_host" != x"no"; then
+-      # Install a library built with a cross compiler in tooldir, not libdir.
+-      toolexecdir='$(exec_prefix)/$(target_alias)'
+-      toolexeclibdir='$(toolexecdir)/lib'
+-    else
+-      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+-      toolexeclibdir='$(libdir)'
+-    fi
++    toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
++    toolexeclibdir='$(libdir)'
+     multi_os_directory=`$CC -print-multi-os-directory`
+     case $multi_os_directory in
+       .) ;; # Avoid trailing /.
diff --git a/debian/rules.patch b/debian/rules.patch
index c97aa14..67c08d8 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -222,9 +222,13 @@ debian_patches += arm-multilib-defaults
 
 ifeq ($(DEB_CROSS),yes)
   debian_patches += cross-fixes
-  debian_patches += cross-install-location
-  ifeq ($(with_d),yes)
-    debian_patches += gdc-cross-install-location
+  ifeq ($(with_deps_on_target_arch_pkgs),yes)
+    debian_patches += cross-ma-install-location
+  else
+    debian_patches += cross-install-location
+    ifeq ($(with_d),yes)
+      debian_patches += gdc-cross-install-location
+    endif
   endif
 endif
 
-- 
2.14.1