summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/GLIBC_DYNAMIC_LINKER.patch165
-rw-r--r--meta/recipes-devtools/gcc/gcc-common.inc18
3 files changed, 166 insertions, 18 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.7.inc b/meta/recipes-devtools/gcc/gcc-4.7.inc
index a2e9ae0994..7a0d231bd8 100644
--- a/meta/recipes-devtools/gcc/gcc-4.7.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.7.inc
@@ -65,6 +65,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};protocol=http \
65 file://libgcc-sjlj-check.patch \ 65 file://libgcc-sjlj-check.patch \
66 file://cpp-honor-sysroot.patch \ 66 file://cpp-honor-sysroot.patch \
67 file://mips64-default-n64.patch \ 67 file://mips64-default-n64.patch \
68 file://GLIBC_DYNAMIC_LINKER.patch \
68 file://arm-hard-float-loader.patch \ 69 file://arm-hard-float-loader.patch \
69 file://gcc-argument-list-too-long.patch \ 70 file://gcc-argument-list-too-long.patch \
70 file://fix-g++-sysroot.patch \ 71 file://fix-g++-sysroot.patch \
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/GLIBC_DYNAMIC_LINKER.patch b/meta/recipes-devtools/gcc/gcc-4.7/GLIBC_DYNAMIC_LINKER.patch
new file mode 100644
index 0000000000..38c361e085
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.7/GLIBC_DYNAMIC_LINKER.patch
@@ -0,0 +1,165 @@
1This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
2relative to SYSTEMLIBS_DIR which can be set in generated headers
3This breaks the assumption of hardcoded multilib in gcc
4Change is only for the supported architectures in OE including
5SH, spart, alpha for possible future support (if any)
6
7Removes the do_headerfix task in metadata
8
9Signed-off-by: Khem Raj
10Upstream-Status: Inappropriate [OE configuration]
11
12Index: git/gcc/config/alpha/linux-elf.h
13===================================================================
14--- git.orig/gcc/config/alpha/linux-elf.h 2012-07-08 11:16:26.199320624 -0700
15+++ git/gcc/config/alpha/linux-elf.h 2012-07-08 11:19:51.059330624 -0700
16@@ -24,8 +24,8 @@
17 #define EXTRA_SPECS \
18 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
19
20-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
21-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
22+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
23+#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
24 #if DEFAULT_LIBC == LIBC_UCLIBC
25 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
26 #elif DEFAULT_LIBC == LIBC_GLIBC
27Index: git/gcc/config/arm/linux-eabi.h
28===================================================================
29--- git.orig/gcc/config/arm/linux-eabi.h 2012-07-08 11:16:26.000000000 -0700
30+++ git/gcc/config/arm/linux-eabi.h 2012-07-08 11:20:40.947333288 -0700
31@@ -62,7 +62,7 @@
32 /* Use ld-linux.so.3 so that it will be possible to run "classic"
33 GNU/Linux binaries on an EABI system. */
34 #undef GLIBC_DYNAMIC_LINKER
35-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
36+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.3"
37
38 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
39 use the GNU/Linux version, not the generic BPABI version. */
40Index: git/gcc/config/arm/linux-elf.h
41===================================================================
42--- git.orig/gcc/config/arm/linux-elf.h 2012-07-08 11:16:31.903320900 -0700
43+++ git/gcc/config/arm/linux-elf.h 2012-07-08 11:21:37.619335646 -0700
44@@ -59,7 +59,7 @@
45
46 #define LIBGCC_SPEC "-lgcc"
47
48-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
49+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
50
51 #define LINUX_TARGET_LINK_SPEC "%{h*} \
52 %{static:-Bstatic} \
53Index: git/gcc/config/i386/linux.h
54===================================================================
55--- git.orig/gcc/config/i386/linux.h 2012-07-08 11:16:26.267320627 -0700
56+++ git/gcc/config/i386/linux.h 2012-07-08 11:23:26.727340361 -0700
57@@ -21,4 +21,4 @@
58 <http://www.gnu.org/licenses/>. */
59
60 #define GNU_USER_LINK_EMULATION "elf_i386"
61-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
62+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
63Index: git/gcc/config/i386/linux64.h
64===================================================================
65--- git.orig/gcc/config/i386/linux64.h 2012-07-08 11:16:26.267320627 -0700
66+++ git/gcc/config/i386/linux64.h 2012-07-08 11:23:13.255340316 -0700
67@@ -28,6 +28,6 @@
68 #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
69 #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
70
71-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
72-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
73-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
74+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
75+#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
76+#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
77Index: git/gcc/config/mips/linux.h
78===================================================================
79--- git.orig/gcc/config/mips/linux.h 2012-07-08 11:16:26.307320629 -0700
80+++ git/gcc/config/mips/linux.h 2012-07-08 11:23:56.063342214 -0700
81@@ -18,4 +18,4 @@
82 along with GCC; see the file COPYING3. If not see
83 <http://www.gnu.org/licenses/>. */
84
85-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
86+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld.so.1"
87Index: git/gcc/config/mips/linux64.h
88===================================================================
89--- git.orig/gcc/config/mips/linux64.h 2012-07-08 11:16:26.307320629 -0700
90+++ git/gcc/config/mips/linux64.h 2012-07-08 11:24:52.207345073 -0700
91@@ -23,10 +23,10 @@
92 #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip"
93 #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
94
95-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
96-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
97-#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
98-#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
99+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
100+#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld.so.1"
101+#define GLIBC_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld.so.1"
102+#define UCLIBC_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
103 #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
104 #define GNU_USER_DYNAMIC_LINKERN32 \
105 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
106Index: git/gcc/config/rs6000/linux64.h
107===================================================================
108--- git.orig/gcc/config/rs6000/linux64.h 2012-07-08 11:16:26.335320630 -0700
109+++ git/gcc/config/rs6000/linux64.h 2012-07-08 11:26:05.867348369 -0700
110@@ -358,10 +358,10 @@
111 #undef LINK_OS_DEFAULT_SPEC
112 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
113
114-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
115-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
116-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
117-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
118+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
119+#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64.so.1"
120+#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
121+#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
122 #if DEFAULT_LIBC == LIBC_UCLIBC
123 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
124 #elif DEFAULT_LIBC == LIBC_GLIBC
125Index: git/gcc/config/sh/linux.h
126===================================================================
127--- git.orig/gcc/config/sh/linux.h 2012-07-08 11:16:26.363320632 -0700
128+++ git/gcc/config/sh/linux.h 2012-07-08 11:26:29.375350165 -0700
129@@ -45,7 +45,7 @@
130
131 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
132
133-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
134+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
135
136 #undef SUBTARGET_LINK_EMUL_SUFFIX
137 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
138Index: git/gcc/config/sparc/linux.h
139===================================================================
140--- git.orig/gcc/config/sparc/linux.h 2012-07-08 11:16:26.371320632 -0700
141+++ git/gcc/config/sparc/linux.h 2012-07-08 11:27:00.439351163 -0700
142@@ -84,7 +84,7 @@
143 When the -shared link option is used a final link is not being
144 done. */
145
146-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
147+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
148
149 #undef LINK_SPEC
150 #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
151Index: git/gcc/config/sparc/linux64.h
152===================================================================
153--- git.orig/gcc/config/sparc/linux64.h 2012-07-08 11:16:26.371320632 -0700
154+++ git/gcc/config/sparc/linux64.h 2012-07-08 11:27:23.571352396 -0700
155@@ -93,8 +93,8 @@
156 When the -shared link option is used a final link is not being
157 done. */
158
159-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
160-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
161+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
162+#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2"
163
164 #ifdef SPARC_BI_ARCH
165
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 0a9324aa3c..72180db2a8 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -62,7 +62,6 @@ B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
62SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}-${PR}" 62SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}-${PR}"
63do_fetch[stamp-base] = "${SS}" 63do_fetch[stamp-base] = "${SS}"
64do_unpack[stamp-base] = "${SS}" 64do_unpack[stamp-base] = "${SS}"
65do_headerfix[stamp-base] = "${SS}"
66do_patch[stamp-base] = "${SS}" 65do_patch[stamp-base] = "${SS}"
67 66
68# SW means Shared Work directory 67# SW means Shared Work directory
@@ -91,23 +90,6 @@ python workshared_clean () {
91 oe.path.remove(dir) 90 oe.path.remove(dir)
92} 91}
93 92
94do_headerfix () {
95 # Change the default dynamic linker path, in case $base_liddir is non-standard
96 # (e.g. in multilib or sdk cases)
97 #
98 # We want something like the following:
99 # #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
100 # becomes
101 # #define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
102 #
103 sed -i ${S}/gcc/config/*/linux*.h -e \
104 's#\(GLIBC_DYNAMIC_LINKER[^ ]*\) \( *"/lib.*\)/\(.*\)#\1 SYSTEMLIBS_DIR "\3#'
105}
106
107addtask headerfix after do_unpack before do_patch
108
109do_headerfix[vardepvalue] = "PATH"
110
111# We need to ensure that for the shared work directory, the do_patch singatures match 93# We need to ensure that for the shared work directory, the do_patch singatures match
112# The real WORKDIR location isn't a dependency for the shared workdir. 94# The real WORKDIR location isn't a dependency for the shared workdir.
113src_patches[vardepsexclude] = "WORKDIR" 95src_patches[vardepsexclude] = "WORKDIR"