blob: 17ec8986c10355c12841be1467b196897abe7ddf [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001From 2e00d0a9a809153f693659e977c1e0550665e65c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:10:06 +0400
4Subject: [PATCH 04/39] 64-bit multilib hack.
5
6GCC has internal multilib handling code but it assumes a very specific rigid directory
7layout. The build system implementation of multilib layout is very generic and allows
8complete customisation of the library directories.
9
10This patch is a partial solution to allow any custom directories to be passed into gcc
11and handled correctly. It forces gcc to use the base_libdir (which is the current
12directory, "."). We need to do this for each multilib that is configured as we don't
13know which compiler options may be being passed into the compiler. Since we have a compiler
14per mulitlib at this point that isn't an issue.
15
16The one problem is the target compiler is only going to work for the default multlilib at
17this point. Ideally we'd figure out which multilibs were being enabled with which paths
18and be able to patch these entries with a complete set of correct paths but this we
19don't have such code at this point. This is something the target gcc recipe should do
20and override these platform defaults in its build config.
21
22Do same for riscv64 and aarch64
23
24RP 15/8/11
25
26Upstream-Status: Inappropriate[OE-Specific]
27
28Signed-off-by: Khem Raj <raj.khem@gmail.com>
29Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
30Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
31---
32 gcc/config/aarch64/t-aarch64-linux | 8 ++++----
33 gcc/config/i386/t-linux64 | 6 ++----
34 gcc/config/mips/t-linux64 | 10 +++-------
35 gcc/config/riscv/t-linux | 6 ++++--
36 gcc/config/rs6000/t-linux64 | 5 ++---
37 5 files changed, 15 insertions(+), 20 deletions(-)
38
39diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
40index 5ad670ba2ce..e26019e7157 100644
41--- a/gcc/config/aarch64/t-aarch64-linux
42+++ b/gcc/config/aarch64/t-aarch64-linux
43@@ -21,8 +21,8 @@
44 LIB1ASMSRC = aarch64/lib1funcs.asm
45 LIB1ASMFUNCS = _aarch64_sync_cache_range
46
47-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
48-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
49-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
50+#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
51+#MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
52+#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
53
54-MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
55+#MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
56diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
57index c686ab2f0d2..c82b60dadcd 100644
58--- a/gcc/config/i386/t-linux64
59+++ b/gcc/config/i386/t-linux64
60@@ -32,7 +32,5 @@
61 #
62 comma=,
63 MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
64-MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
65-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
66-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
67-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
68+MULTILIB_DIRNAMES = . .
69+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
70diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
71index 3a2ff700d7d..13ef19576b5 100644
72--- a/gcc/config/mips/t-linux64
73+++ b/gcc/config/mips/t-linux64
74@@ -17,10 +17,6 @@
75 # <http://www.gnu.org/licenses/>.
76
77 MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
78-MULTILIB_DIRNAMES = n32 32 64
79-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
80-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
81-MULTILIB_OSDIRNAMES = \
82- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
83- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
84- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
85+MULTILIB_DIRNAMES = . . .
86+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
87+
88diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux
89index 216d2776a18..e4d817621fc 100644
90--- a/gcc/config/riscv/t-linux
91+++ b/gcc/config/riscv/t-linux
92@@ -1,3 +1,5 @@
93 # Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/
94-MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES)))
95-MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
96+#MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES)))
97+MULTILIB_DIRNAMES := . .
98+#MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
99+MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
100diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
101index f3c6e2be1d9..bd0393155fa 100644
102--- a/gcc/config/rs6000/t-linux64
103+++ b/gcc/config/rs6000/t-linux64
104@@ -26,10 +26,9 @@
105 # MULTILIB_OSDIRNAMES according to what is found on the target.
106
107 MULTILIB_OPTIONS := m64/m32
108-MULTILIB_DIRNAMES := 64 32
109+MULTILIB_DIRNAMES := . .
110 MULTILIB_EXTRA_OPTS :=
111-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
112-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
113+MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
114
115 rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
116 $(COMPILE) $<
117--
1182.25.1
119