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
|
# DP: - Remaining multiarch patches, not yet submitted upstream.
# DP: - Add MULTIARCH_DIRNAME definitions for multilib configurations,
# DP: which are used for the non-multilib builds.
2013-06-12 Matthias Klose <doko@ubuntu.com>
* config/i386/t-linux64: Set MULTIARCH_DIRNAME.
* config/i386/t-kfreebsd: Set MULTIARCH_DIRNAME.
* config.gcc (i[34567]86-*-linux* | x86_64-*-linux*): Prepend
i386/t-linux to $tmake_file;
set default ABI to N64 for mips64el.
* config/mips/t-linux64: Set MULTIARCH_DIRNAME.
* config/rs6000/t-linux64: Set MULTIARCH_DIRNAME.
* config/s390/t-linux64: Set MULTIARCH_DIRNAME.
* config/sparc/t-linux64: Set MULTIARCH_DIRNAME.
* src/gcc/config/mips/mips.h: (/usr)/lib as default path.
Index: b/src/gcc/config/sh/t-linux
===================================================================
--- a/src/gcc/config/sh/t-linux
+++ b/src/gcc/config/sh/t-linux
@@ -1,2 +1,4 @@
MULTILIB_DIRNAMES=
MULTILIB_MATCHES =
+
+MULTILIB_OSDIRNAMES = sh4-linux-gnu:sh4-linux-gnu sh4_nofpu-linux-gnu:sh4-linux-gnu
Index: b/src/gcc/config/sparc/t-linux64
===================================================================
--- a/src/gcc/config/sparc/t-linux64
+++ b/src/gcc/config/sparc/t-linux64
@@ -27,3 +27,5 @@ MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:sparc64-linux-gnu)
MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:sparc-linux-gnu)
+
+MULTIARCH_DIRNAME = $(call if_multiarch,sparc$(if $(findstring 64,$(target)),64)-linux-gnu)
Index: b/src/gcc/config/s390/t-linux64
===================================================================
--- a/src/gcc/config/s390/t-linux64
+++ b/src/gcc/config/s390/t-linux64
@@ -9,3 +9,5 @@ MULTILIB_OPTIONS = m64/m31
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+
+MULTIARCH_DIRNAME = $(call if_multiarch,s390$(if $(findstring s390x,$(target)),x)-linux-gnu)
Index: b/src/gcc/config/rs6000/t-linux64
===================================================================
--- a/src/gcc/config/rs6000/t-linux64
+++ b/src/gcc/config/rs6000/t-linux64
@@ -31,6 +31,8 @@ MULTILIB_EXTRA_OPTS :=
MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
+MULTIARCH_DIRNAME = $(call if_multiarch,powerpc$(if $(findstring 64,$(target)),64)-linux-gnu)
+
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
$(COMPILE) $<
$(POSTCOMPILE)
Index: b/src/gcc/config/i386/t-linux64
===================================================================
--- a/src/gcc/config/i386/t-linux64
+++ b/src/gcc/config/i386/t-linux64
@@ -36,3 +36,13 @@ MULTILIB_DIRNAMES = $(patsubst m%, %,
MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
+
+ifneq (,$(findstring x86_64,$(target)))
+ ifneq (,$(findstring biarchx32.h,$(tm_include_list)))
+ MULTIARCH_DIRNAME = $(call if_multiarch,x86_64-linux-gnux32)
+ else
+ MULTIARCH_DIRNAME = $(call if_multiarch,x86_64-linux-gnu)
+ endif
+else
+ MULTIARCH_DIRNAME = $(call if_multiarch,i386-linux-gnu)
+endif
Index: b/src/gcc/config/i386/t-kfreebsd
===================================================================
--- a/src/gcc/config/i386/t-kfreebsd
+++ b/src/gcc/config/i386/t-kfreebsd
@@ -1,5 +1,9 @@
-MULTIARCH_DIRNAME = $(call if_multiarch,i386-kfreebsd-gnu)
+ifeq (,$(MULTIARCH_DIRNAME))
+ MULTIARCH_DIRNAME = $(call if_multiarch,i386-kfreebsd-gnu)
+endif
# MULTILIB_OSDIRNAMES are set in t-linux64.
KFREEBSD_OS = $(filter kfreebsd%, $(word 3, $(subst -, ,$(target))))
MULTILIB_OSDIRNAMES := $(filter-out mx32=%,$(subst linux,$(KFREEBSD_OS),$(MULTILIB_OSDIRNAMES)))
+
+MULTIARCH_DIRNAME := $(subst linux,$(KFREEBSD_OS),$(MULTIARCH_DIRNAME))
Index: b/src/gcc/config/mips/t-linux64
===================================================================
--- a/src/gcc/config/mips/t-linux64
+++ b/src/gcc/config/mips/t-linux64
@@ -24,3 +24,13 @@ MULTILIB_OSDIRNAMES = \
../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+
+ifneq (,$(findstring abin32,$(target)))
+MULTIARCH_DIRNAME = $(call if_multiarch,mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT))
+else
+ifneq (,$(findstring abi64,$(target)))
+MULTIARCH_DIRNAME = $(call if_multiarch,mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+else
+MULTIARCH_DIRNAME = $(call if_multiarch,mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT))
+endif
+endif
Index: b/src/gcc/config.gcc
===================================================================
--- a/src/gcc/config.gcc
+++ b/src/gcc/config.gcc
@@ -2032,6 +2032,10 @@ mips*-*-linux*) # Linux MIPS, either
default_mips_arch=mips64r2
enable_mips_multilibs="yes"
;;
+ mips64*-*-linux-gnuabi64 | mipsisa64*-*-linux-gnuabi64)
+ default_mips_abi=64
+ enable_mips_multilibs="yes"
+ ;;
mips64*-*-linux* | mipsisa64*-*-linux*)
default_mips_abi=n32
enable_mips_multilibs="yes"
@@ -4241,7 +4245,7 @@ case ${target} in
i[34567]86-*-darwin* | x86_64-*-darwin*)
;;
i[34567]86-*-linux* | x86_64-*-linux*)
- tmake_file="$tmake_file i386/t-linux"
+ tmake_file="i386/t-linux $tmake_file"
;;
i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
tmake_file="$tmake_file i386/t-kfreebsd"
Index: b/src/gcc/config/aarch64/t-aarch64-linux
===================================================================
--- a/src/gcc/config/aarch64/t-aarch64-linux
+++ b/src/gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
LIB1ASMFUNCS = _aarch64_sync_cache_range
AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+MULTILIB_OSDIRNAMES = mabi.lp64=../lib$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)_ilp32-linux-gnu)
-MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
+MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
Index: b/src/gcc/config/mips/mips.h
===================================================================
--- a/src/gcc/config/mips/mips.h
+++ b/src/gcc/config/mips/mips.h
@@ -3185,13 +3185,3 @@ extern GTY(()) struct target_globals *mi
with arguments ARGS. */
#define PMODE_INSN(NAME, ARGS) \
(Pmode == SImode ? NAME ## _si ARGS : NAME ## _di ARGS)
-
-/* If we are *not* using multilibs and the default ABI is not ABI_32 we
- need to change these from /lib and /usr/lib. */
-#if MIPS_ABI_DEFAULT == ABI_N32
-#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
-#elif MIPS_ABI_DEFAULT == ABI_64
-#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
-#endif
|