1
# DP: Add multiarch support to GCC.
3
# DP: Convert the multilib option to a target triplet,
4
# DP: add multiarch include directories and libraries path:
5
# DP: /usr/local/include/<arch>-linux-gnu
6
# DP: /usr/include/<arch>-linux-gnu
7
# DP: /usr/lib/<arch>-linux-gnu
8
# DP: to the system paths.
10
2011-08-18 Matthias Klose <doko@ubuntu.com>
12
* doc/invoke.texi: Document -print-multiarch.
13
* Makefile.in (s-mlib): Pass MULTIARCH_DIRNAME to genmultilib.
14
* genmultilib: Add new option for the multiarch name.
15
* gcc.c (multiarch_dir): Define.
16
(for_each_path): Search for multiarch suffixes.
17
(driver_handle_option): Handle multiarch option.
18
(do_spec_1): Pass -imultiarch if defined.
19
(main): Print multiarch.
20
(set_multilib_dir): Separate multilib and multiarch names
22
(print_multilib_info): Ignore multiarch names in multilib_select.
23
* incpath.c (add_standard_paths): Search the multiarch include dirs.
24
* cppdeault.h (default_include): Document multiarch in multilib
26
* cppdefault.c: [LOCAL_INCLUDE_DIR, STANDARD_INCLUDE_DIR] Add an
27
include directory for multiarch directories.
28
* common.opt: New options --print-multiarch and -imultilib.
29
* config/s390/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES.
30
* config/sparc/t-linux64: Likewise.
31
* config/powerpc/t-linux64: Likewise.
32
* config/i386/t-linux64: Likewise.
33
* config/mips/t-linux64: Likewise.
34
* config/alpha/t-linux: Define MULTIARCH_DIRNAME.
35
* config/arm/t-linux: Likewise.
36
* config/i386/t-linux: Likewise.
37
* config/pa/t-linux: Likewise.
38
* config/sparc/t-linux: Likewise.
39
* config/ia64/t-glibc: Define MULTIARCH_DIRNAME for linux target.
42
--- a/src/gcc/incpath.c (revision 182390)
43
+++ b/src/gcc/incpath.c (working copy)
45
if (!filename_ncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
47
char *str = concat (iprefix, p->fname + len, NULL);
48
- if (p->multilib && imultilib)
49
+ if (p->multilib == 1 && imultilib)
50
str = concat (str, dir_separator_str, imultilib, NULL);
51
+ else if (p->multilib == 2)
55
+ str = concat (str, dir_separator_str, imultiarch, NULL);
57
add_path (str, SYSTEM, p->cxx_aware, false);
62
str = update_path (p->fname, p->component);
64
- if (p->multilib && imultilib)
65
+ if (p->multilib == 1 && imultilib)
66
str = concat (str, dir_separator_str, imultilib, NULL);
67
+ else if (p->multilib == 2)
71
+ str = concat (str, dir_separator_str, imultiarch, NULL);
74
add_path (str, SYSTEM, p->cxx_aware, false);
76
--- a/src/gcc/gcc.c (revision 182390)
77
+++ b/src/gcc/gcc.c (working copy)
78
@@ -1147,6 +1147,11 @@
79
set_multilib_dir based on the compilation options. */
81
static const char *multilib_os_dir;
83
+/* Subdirectory to use for locating libraries in multiarch conventions. Set by
84
+ set_multilib_dir based on the compilation options. */
86
+static const char *multiarch_dir;
88
/* Structure to keep track of the specs that have been defined so far.
89
These are accessed using %(specname) in a compiler or link
91
struct prefix_list *pl;
92
const char *multi_dir = NULL;
93
const char *multi_os_dir = NULL;
94
+ const char *multiarch_suffix = NULL;
95
const char *multi_suffix;
96
const char *just_multi_suffix;
98
@@ -2089,11 +2095,14 @@
100
if (do_multi && multilib_os_dir && strcmp (multilib_os_dir, ".") != 0)
101
multi_os_dir = concat (multilib_os_dir, dir_separator_str, NULL);
103
+ multiarch_suffix = concat (multiarch_dir, dir_separator_str, NULL);
107
size_t multi_dir_len = 0;
108
size_t multi_os_dir_len = 0;
109
+ size_t multiarch_len = 0;
111
size_t just_suffix_len;
113
@@ -2102,16 +2111,15 @@
114
multi_dir_len = strlen (multi_dir);
116
multi_os_dir_len = strlen (multi_os_dir);
117
+ if (multiarch_suffix)
118
+ multiarch_len = strlen (multiarch_suffix);
119
suffix_len = strlen (multi_suffix);
120
just_suffix_len = strlen (just_multi_suffix);
124
len = paths->max_len + extra_space + 1;
125
- if (suffix_len > multi_os_dir_len)
128
- len += multi_os_dir_len;
129
+ len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
130
path = XNEWVEC (char, len);
133
@@ -2140,6 +2148,16 @@
137
+ /* Now try the multiarch path. */
138
+ if (!skip_multi_dir
139
+ && !pl->require_machine_suffix && multiarch_dir)
141
+ memcpy (path + len, multiarch_suffix, multiarch_len + 1);
142
+ ret = callback (path, callback_info);
147
/* Now try the base path. */
148
if (!pl->require_machine_suffix
149
&& !(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
150
@@ -3228,6 +3246,7 @@
151
case OPT_print_multi_directory:
152
case OPT_print_sysroot:
153
case OPT_print_multi_os_directory:
154
+ case OPT_print_multiarch:
155
case OPT_print_sysroot_headers_suffix:
158
@@ -4880,6 +4899,15 @@
159
do_spec_1 (" ", 0, NULL);
164
+ do_spec_1 ("-imultiarch", 1, NULL);
165
+ /* Make this a separate argument. */
166
+ do_spec_1 (" ", 0, NULL);
167
+ do_spec_1 (multiarch_dir, 1, NULL);
168
+ do_spec_1 (" ", 0, NULL);
173
do_spec_1 ("-iprefix", 1, NULL);
174
@@ -6497,6 +6525,15 @@
178
+ if (print_multiarch)
180
+ if (multiarch_dir == NULL)
183
+ printf ("%s\n", multiarch_dir);
189
if (target_system_root)
190
@@ -7472,10 +7509,26 @@
194
- char *new_multilib_os_dir = XNEWVEC (char, end - q);
195
+ const char *q2 = q + 1;
196
+ char *new_multilib_os_dir;
198
+ while (q2 < end && *q2 != ':')
202
+ new_multilib_os_dir = XNEWVEC (char, end - q);
203
memcpy (new_multilib_os_dir, q + 1, end - q - 1);
204
new_multilib_os_dir[end - q - 1] = '\0';
205
- multilib_os_dir = new_multilib_os_dir;
206
+ multilib_os_dir = *new_multilib_os_dir ? new_multilib_os_dir : ".";
208
+ end = this_path + this_path_len;
209
+ if (q2 < end && *q2 == ':')
211
+ char *new_multiarch_dir = XNEWVEC (char, end - q2);
212
+ memcpy (new_multiarch_dir, q2 + 1, end - q2 - 1);
213
+ new_multiarch_dir[end - q2 - 1] = '\0';
214
+ multiarch_dir = new_multiarch_dir;
219
@@ -7537,7 +7590,7 @@
220
/* When --disable-multilib was used but target defines
221
MULTILIB_OSDIRNAMES, entries starting with .: are there just
222
to find multilib_os_dir, so skip them from output. */
223
- if (this_path[0] == '.' && this_path[1] == ':')
224
+ if (this_path[0] == '.' && this_path[1] == ':' && this_path[2] != ':')
227
/* Check for matches with the multilib_exclusions. We don't bother
228
--- a/src/gcc/genmultilib (revision 182390)
229
+++ b/src/gcc/genmultilib (working copy)
231
# the os directory names are used exclusively. Use the mapping when
232
# there is no one-to-one equivalence between GCC levels and the OS.
234
+# The optional eight argument is the multiarch name.
236
# The last option should be "yes" if multilibs are enabled. If it is not
237
# "yes", all GCC multilib dir names will be ".".
247
echo "static const char *const multilib_raw[] = {"
253
+if [ -n "${multiarch}" ]; then
254
+ defaultosdirname=::${multiarch}
256
if [ -n "${osdirnames}" ]; then
262
defaultosdirname=`echo $1 | sed 's|^.=|:|'`
263
+ if [ -n "${multiarch}" ]; then
264
+ defaultosdirname=${defaultosdirname}:${multiarch}
269
@@ -314,13 +323,13 @@
270
dirout=`echo ${combo} | sed -e 's/=/-/g'`
272
# Remove the leading and trailing slashes.
273
- dirout=`echo ${dirout} | sed -e 's|^/||' -e 's|/$||g'`
274
+ dirout=`echo ${dirout} | sed -e 's|^/||' -e 's|/*:/*|:|' -e 's|/$||g'`
276
# Use the OS directory names rather than the option names.
277
if [ -n "${toosdirnames}" ]; then
278
osdirout=`echo ${combo} | sed ${toosdirnames}`
279
# Remove the leading and trailing slashes.
280
- osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/$||g'`
281
+ osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/*:/*|:|' -e 's|/$||g'`
282
if [ "x${enable_multilib}" != xyes ]; then
283
dirout=".:${osdirout}"
285
--- a/src/gcc/configure.ac (revision 182390)
286
+++ b/src/gcc/configure.ac (working copy)
288
[], [enable_multilib=yes])
289
AC_SUBST(enable_multilib)
291
+# Determine whether or not multiarch is enabled.
292
+AC_ARG_ENABLE(multiarch,
293
+[AS_HELP_STRING([--enable-multiarch],
294
+ [enable support for multiarch paths])],
295
+[case "${withval}" in
296
+yes|no|auto-detect) enable_multiarch=$withval;;
297
+*) AC_MSG_ERROR(bad value ${withval} given for --enable-multiarch option) ;;
298
+esac], [enable_multiarch=auto-detect])
299
+AC_MSG_CHECKING(for multiarch configuration)
300
+AC_SUBST(enable_multiarch)
301
+AC_MSG_RESULT($enable_multiarch)
303
+# needed for setting the multiarch name on ARM
304
+AC_SUBST(with_float)
306
# Enable __cxa_atexit for C++.
307
AC_ARG_ENABLE(__cxa_atexit,
308
[AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])],
309
--- a/src/gcc/cppdefault.c (revision 182390)
310
+++ b/src/gcc/cppdefault.c (working copy)
313
#ifdef LOCAL_INCLUDE_DIR
314
/* /usr/local/include comes before the fixincluded header files. */
315
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
316
{ LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
318
#ifdef PREFIX_INCLUDE_DIR
321
#ifdef NATIVE_SYSTEM_HEADER_DIR
322
/* /usr/include comes dead last. */
323
+ { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
324
{ NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
327
--- a/src/gcc/cppdefault.h (revision 182390)
328
+++ b/src/gcc/cppdefault.h (working copy)
331
const char add_sysroot; /* FNAME should be prefixed by
333
- const char multilib; /* FNAME should have the multilib path
334
- specified with -imultilib
336
+ const char multilib; /* FNAME should have appended
337
+ - the multilib path specified with -imultilib
339
+ - the multiarch path specified with
340
+ -imultiarch, when 2 is passed. */
343
extern const struct default_include cpp_include_defaults[];
344
--- a/src/gcc/common.opt (revision 182390)
345
+++ b/src/gcc/common.opt (working copy)
347
-print-multi-os-directory
348
Driver Alias(print-multi-os-directory)
351
+Driver Alias(print-multiarch)
354
Driver Separate Alias(print-prog-name=)
356
@@ -2268,6 +2271,10 @@
357
Common Joined Var(plugindir_string) Init(0)
358
-iplugindir=<dir> Set <dir> to be the default plugin directory
361
+Common Joined Separate RejectDriver Var(imultiarch) Init(0)
362
+-imultiarch <dir> Set <dir> to be the multiarch include subdirectory
365
Driver Joined Separate
367
@@ -2325,6 +2332,9 @@
369
print-multi-os-directory
370
Driver Var(print_multi_os_directory)
373
+Driver Var(print_multiarch)
376
Driver JoinedOrMissing Var(print_prog_name)
377
--- a/src/gcc/config.gcc (revision 182390)
378
+++ b/src/gcc/config.gcc (working copy)
379
@@ -1508,7 +1508,7 @@
382
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
383
- tmake_file="${tmake_file} ia64/t-ia64 t-libunwind"
384
+ tmake_file="${tmake_file} ia64/t-ia64 ia64/t-glibc t-libunwind"
385
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
388
@@ -2012,6 +2012,7 @@
391
tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
392
+ tmake_file="$tmake_file rs6000/t-linux"
396
@@ -3467,10 +3468,14 @@
398
i[34567]86-*-darwin* | x86_64-*-darwin*)
400
- i[34567]86-*-linux* | x86_64-*-linux* | \
401
- i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
403
+ i[34567]86-*-linux* | x86_64-*-linux*)
405
+ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
406
+ tmake_file="${tmake_file} i386/t-linux i386/t-kfreebsd"
409
+ tmake_file="${tmake_file} i386/t-linux i386/t-gnu"
411
i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
413
i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
414
--- a/src/gcc/Makefile.in (revision 182390)
415
+++ b/src/gcc/Makefile.in (working copy)
418
enable_plugin = @enable_plugin@
421
+enable_multiarch = @enable_multiarch@
422
+with_float = @with_float@
423
+ifeq ($(enable_multiarch),yes)
424
+ if_multiarch = $(1)
425
+else ifeq ($(enable_multiarch),auto-detect)
426
+ if_multiarch = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
431
CPPLIB = ../libcpp/libcpp.a
432
CPPINC = -I$(srcdir)/../libcpp/include
434
@@ -1832,10 +1843,11 @@
435
"$(MULTILIB_EXTRA_OPTS)" \
436
"$(MULTILIB_EXCLUSIONS)" \
437
"$(MULTILIB_OSDIRNAMES)" \
438
+ "$(MULTIARCH_DIRNAME)" \
439
"@enable_multilib@" \
442
- $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' no \
443
+ $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' "$(MULTIARCH_DIRNAME)" no \
446
$(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
447
--- a/src/gcc/config/alpha/t-linux (revision 0)
448
+++ b/src/gcc/config/alpha/t-linux (revision 0)
450
+MULTIARCH_DIRNAME = $(call if_multiarch,alpha-linux-gnu)
451
--- a/src/gcc/config/s390/t-linux64 (revision 182390)
452
+++ b/src/gcc/config/s390/t-linux64 (working copy)
455
MULTILIB_OPTIONS = m64/m31
456
MULTILIB_DIRNAMES = 64 32
457
-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
458
+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
459
+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
460
--- a/src/gcc/config/sparc/t-linux64 (revision 182390)
461
+++ b/src/gcc/config/sparc/t-linux64 (working copy)
464
MULTILIB_OPTIONS = m64/m32
465
MULTILIB_DIRNAMES = 64 32
466
-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
467
+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:sparc64-linux-gnu)
468
+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:sparc-linux-gnu)
469
--- a/src/gcc/config/sparc/t-linux (revision 0)
470
+++ b/src/gcc/config/sparc/t-linux (revision 0)
472
+MULTIARCH_DIRNAME = $(call if_multiarch,sparc-linux-gnu)
473
--- a/src/gcc/config/i386/t-kfreebsd (revision 0)
474
+++ b/src/gcc/config/i386/t-kfreebsd (revision 0)
476
+MULTIARCH_DIRNAME = $(call if_multiarch,i386-kfreebsd-gnu)
478
+# MULTILIB_OSDIRNAMES are set in t-linux64.
479
+KFREEBSD_OS = $(filter kfreebsd%, $(word 3, $(subst -, ,$(target))))
480
+MULTILIB_OSDIRNAMES := $(subst linux,$(KFREEBSD_OS),$(MULTILIB_OSDIRNAMES))
481
--- a/src/gcc/config/i386/t-gnu (revision 0)
482
+++ b/src/gcc/config/i386/t-gnu (revision 0)
484
+MULTIARCH_DIRNAME = $(call if_multiarch,i386-gnu)
485
--- a/src/gcc/config/i386/t-linux (revision 0)
486
+++ b/src/gcc/config/i386/t-linux (revision 0)
488
+MULTIARCH_DIRNAME = $(call if_multiarch,i386-linux-gnu)
489
--- a/src/gcc/config/i386/t-linux64 (revision 182390)
490
+++ b/src/gcc/config/i386/t-linux64 (working copy)
493
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
494
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
495
-MULTILIB_OSDIRNAMES = m64=../lib64
496
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
497
+MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
498
+MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
499
MULTILIB_OSDIRNAMES+= mx32=../libx32
500
--- a/src/gcc/config/ia64/t-glibc (revision 0)
501
+++ b/src/gcc/config/ia64/t-glibc (revision 0)
503
+ifneq (,$(findstring linux, $(target)))
504
+MULTIARCH_DIRNAME = $(call if_multiarch,ia64-linux-gnu)
506
--- a/src/gcc/config/m68k/t-linux (revision 182390)
507
+++ b/src/gcc/config/m68k/t-linux (working copy)
509
# Only include multilibs for 680x0 and ColdFire CPUs with an MMU.
510
M68K_MLIB_CPU += && ((CPU ~ "^m680") || (CPU ~ "^mcf")) && (FLAGS ~ "FL_MMU")
512
+MULTIARCH_DIRNAME = $(call if_multiarch,m68k-linux-gnu)
514
# This rule uses MULTILIB_MATCHES to generate a definition of
515
# SYSROOT_SUFFIX_SPEC.
516
sysroot-suffix.h: $(srcdir)/config/m68k/print-sysroot-suffix.sh
517
--- a/src/gcc/config/rs6000/t-spe (revision 182390)
518
+++ b/src/gcc/config/rs6000/t-spe (working copy)
520
mabi=altivec/mlittle \
522
maltivec/mabi=altivec/mlittle
524
+MULTIARCH_DIRNAME = powerpc-linux-gnuspe$(if $(findstring rs6000/e500-double.h, $(tm_file)),,v1)
526
--- a/src/gcc/config/rs6000/t-linux64 (revision 182390)
527
+++ b/src/gcc/config/rs6000/t-linux64 (working copy)
529
MULTILIB_EXTRA_OPTS = fPIC mstrict-align
530
MULTILIB_EXCEPTIONS = m64/msoft-float
531
MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
532
-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
533
+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:powerpc64-linux-gnu)
534
+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
535
+MULTILIB_OSDIRNAMES += nof
536
MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
537
--- a/src/gcc/config/rs6000/t-linux (revision 0)
538
+++ b/src/gcc/config/rs6000/t-linux (revision 0)
540
+MULTIARCH_DIRNAME = powerpc-linux-gnu
541
--- a/src/gcc/config/arm/t-linux-eabi (revision 182390)
542
+++ b/src/gcc/config/arm/t-linux-eabi (working copy)
544
#MULTILIB_OPTIONS += mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
545
#MULTILIB_DIRNAMES += fa606te fa626te fmp626 fa726te
546
#MULTILIB_EXCEPTIONS += *mthumb/*mcpu=fa606te *mthumb/*mcpu=fa626te *mthumb/*mcpu=fmp626 *mthumb/*mcpu=fa726te*
548
+ARM_EB = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),eb)
549
+MULTIARCH_DIRNAME = $(call if_multiarch,arm$(ARM_EB)-linux-gnueabi$(if $(filter hard,$(with_float)),hf))
550
--- a/src/gcc/config/pa/t-linux (revision 0)
551
+++ b/src/gcc/config/pa/t-linux (revision 0)
553
+MULTIARCH_DIRNAME = $(call if_multiarch,hppa-linux-gnu)
554
--- a/src/gcc/config/mips/t-linux64 (revision 182390)
555
+++ b/src/gcc/config/mips/t-linux64 (working copy)
558
MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
559
MULTILIB_DIRNAMES = n32 32 64
560
-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
561
+MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
562
+MIPS_SOFT = $(if $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)),soft)
563
+MULTILIB_OSDIRNAMES = \
564
+ ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
565
+ ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
566
+ ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
567
--- a/src/libstdc++-v3/python/hook.in
568
+++ b/src/libstdc++-v3/python/hook.in
570
libdir = libdir[len (prefix):]
572
# Compute the ".."s needed to get from libdir to the prefix.
573
- dotdots = ('..' + os.sep) * len (libdir.split (os.sep))
574
+ backdirs = len (libdir.split (os.sep))
575
+ if not os.path.basename(os.path.dirname(__file__)).startswith('lib'):
576
+ backdirs += 1 # multiarch subdir
577
+ dotdots = ('..' + os.sep) * backdirs
579
objfile = gdb.current_objfile ().filename
580
dir_ = os.path.join (os.path.dirname (objfile), dotdots, pythondir)