summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/gcc/gcc-4.5/64bithack.patch
blob: 70330145ece47caf45806a9abefcc7bebd45dcb9 (plain)
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
Upstream-Status: Inappropriate [embedded specific]

GCC has internal multilib handling code but it assumes a very specific rigid directory
layout. The build system implementation of multilib layout is very generic and allows
complete customisation of the library directories.

This patch is a partial solution to allow any custom directories to be passed into gcc
and handled correctly. It forces gcc to use the base_libdir (which is the current 
directory, "."). We need to do this for each multilib that is configured as we don't
know which compiler options may be being passed into the compiler. Since we have a compiler
per mulitlib at this point that isn't an issue.

The one problem is the target compiler is only going to work for the default multlilib at
this point. Ideally we'd figure out which multilibs were being enabled with which paths
and be able to patch these entries with a complete set of correct paths but this we
don't have such code at this point. This is something the target gcc recipe should do 
and override these platform defaults in its build config.

RP 15/8/11

Index: gcc-4_5-branch/gcc/config/i386/t-linux64
===================================================================
--- gcc-4_5-branch.orig/gcc/config/i386/t-linux64	2011-09-22 11:37:51.188913390 -0700
+++ gcc-4_5-branch/gcc/config/i386/t-linux64	2011-09-22 11:37:56.818913303 -0700
@@ -24,8 +24,8 @@
 # MULTILIB_OSDIRNAMES according to what is found on the target.
 
 MULTILIB_OPTIONS = m64/m32
-MULTILIB_DIRNAMES = 64 32 
-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
+MULTILIB_DIRNAMES = . .
+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
Index: gcc-4_5-branch/gcc/config/mips/t-linux64
===================================================================
--- gcc-4_5-branch.orig/gcc/config/mips/t-linux64	2011-06-16 17:59:02.000000000 -0700
+++ gcc-4_5-branch/gcc/config/mips/t-linux64	2011-09-22 11:37:56.838913302 -0700
@@ -17,8 +17,8 @@
 # <http://www.gnu.org/licenses/>.
 
 MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
-MULTILIB_DIRNAMES = n32 32 64
-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
+MULTILIB_DIRNAMES = . . .
+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
 
 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
 
Index: gcc-4_5-branch/gcc/config/rs6000/t-linux64
===================================================================
--- gcc-4_5-branch.orig/gcc/config/rs6000/t-linux64	2011-06-16 17:58:58.000000000 -0700
+++ gcc-4_5-branch/gcc/config/rs6000/t-linux64	2011-09-22 11:37:56.838913302 -0700
@@ -32,11 +32,11 @@ TARGET_LIBGCC2_CFLAGS += -mno-minimal-to
 # MULTILIB_OSDIRNAMES according to what is found on the target.
 
 MULTILIB_OPTIONS        = m64/m32 msoft-float
-MULTILIB_DIRNAMES       = 64 32 nof
+MULTILIB_DIRNAMES       = . . .
 MULTILIB_EXTRA_OPTS     = fPIC mstrict-align
 MULTILIB_EXCEPTIONS     = m64/msoft-float
 MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
-MULTILIB_OSDIRNAMES	= ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
+MULTILIB_OSDIRNAMES	= ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
 MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
 
 softfp_wrap_start := '\#ifndef __powerpc64__'