summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-06 12:52:40 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-29 13:42:22 +0100
commit80f625a364ba6f390168804487fc0c0610d6d3ec (patch)
tree7c5a1b3973a98e7dcbaae8d82aa3227524bab4c7
parent978c6c00d6251c9bef4ba1c0fc8b4196bbceeaf3 (diff)
downloadpoky-80f625a364ba6f390168804487fc0c0610d6d3ec.tar.gz
gcc: Handle uclibc linker relocation for multilib support
We need to handle the UCLIBC_* linker variables in the same way as we do the GLIBC_* ones to allow uclibc multilib to work properly. (From OE-Core rev: 025ec5958b7e1fd71caa0079ec3c573126b30886) (From OE-Core rev: 6e437160ac3aa79d132e16430849e21a98fcafd1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch128
-rw-r--r--meta/recipes-devtools/gcc/gcc-multilib-config.inc11
2 files changed, 82 insertions, 57 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta/recipes-devtools/gcc/gcc-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
index 0e8fffcd8b..5755da8254 100644
--- a/meta/recipes-devtools/gcc/gcc-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -29,11 +29,11 @@ Upstream-Status: Inappropriate [OE configuration]
29 gcc/config/sparc/linux64.h | 4 ++-- 29 gcc/config/sparc/linux64.h | 4 ++--
30 11 files changed, 22 insertions(+), 22 deletions(-) 30 11 files changed, 22 insertions(+), 22 deletions(-)
31 31
32diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h 32Index: gcc-4.8.2/gcc/config/alpha/linux-elf.h
33index 84e0596..3a59d71 100644 33===================================================================
34--- a/gcc/config/alpha/linux-elf.h 34--- gcc-4.8.2.orig/gcc/config/alpha/linux-elf.h 2014-05-06 10:34:51.081657377 +0000
35+++ b/gcc/config/alpha/linux-elf.h 35+++ gcc-4.8.2/gcc/config/alpha/linux-elf.h 2014-05-06 10:34:51.073657377 +0000
36@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see 36@@ -23,8 +23,8 @@
37 #define EXTRA_SPECS \ 37 #define EXTRA_SPECS \
38 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, 38 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
39 39
@@ -44,10 +44,10 @@ index 84e0596..3a59d71 100644
44 #if DEFAULT_LIBC == LIBC_UCLIBC 44 #if DEFAULT_LIBC == LIBC_UCLIBC
45 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" 45 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
46 #elif DEFAULT_LIBC == LIBC_GLIBC 46 #elif DEFAULT_LIBC == LIBC_GLIBC
47diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h 47Index: gcc-4.8.2/gcc/config/arm/linux-eabi.h
48index 4a425c8..80f454d 100644 48===================================================================
49--- a/gcc/config/arm/linux-eabi.h 49--- gcc-4.8.2.orig/gcc/config/arm/linux-eabi.h 2014-05-06 10:34:51.081657377 +0000
50+++ b/gcc/config/arm/linux-eabi.h 50+++ gcc-4.8.2/gcc/config/arm/linux-eabi.h 2014-05-06 10:34:51.077657377 +0000
51@@ -68,8 +68,8 @@ 51@@ -68,8 +68,8 @@
52 GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ 52 GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
53 53
@@ -59,10 +59,10 @@ index 4a425c8..80f454d 100644
59 #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT 59 #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
60 60
61 #define GLIBC_DYNAMIC_LINKER \ 61 #define GLIBC_DYNAMIC_LINKER \
62diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h 62Index: gcc-4.8.2/gcc/config/arm/linux-elf.h
63index 753dc3a..d593967 100644 63===================================================================
64--- a/gcc/config/arm/linux-elf.h 64--- gcc-4.8.2.orig/gcc/config/arm/linux-elf.h 2014-05-06 10:34:51.081657377 +0000
65+++ b/gcc/config/arm/linux-elf.h 65+++ gcc-4.8.2/gcc/config/arm/linux-elf.h 2014-05-06 10:34:51.077657377 +0000
66@@ -57,7 +57,7 @@ 66@@ -57,7 +57,7 @@
67 67
68 #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" 68 #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
@@ -72,21 +72,21 @@ index 753dc3a..d593967 100644
72 72
73 #define LINUX_TARGET_LINK_SPEC "%{h*} \ 73 #define LINUX_TARGET_LINK_SPEC "%{h*} \
74 %{static:-Bstatic} \ 74 %{static:-Bstatic} \
75diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h 75Index: gcc-4.8.2/gcc/config/i386/linux.h
76index 3c95ee0..33b8acd 100644 76===================================================================
77--- a/gcc/config/i386/linux.h 77--- gcc-4.8.2.orig/gcc/config/i386/linux.h 2014-05-06 10:34:51.081657377 +0000
78+++ b/gcc/config/i386/linux.h 78+++ gcc-4.8.2/gcc/config/i386/linux.h 2014-05-06 10:34:51.077657377 +0000
79@@ -20,4 +20,4 @@ along with GCC; see the file COPYING3. If not see 79@@ -20,4 +20,4 @@
80 <http://www.gnu.org/licenses/>. */ 80 <http://www.gnu.org/licenses/>. */
81 81
82 #define GNU_USER_LINK_EMULATION "elf_i386" 82 #define GNU_USER_LINK_EMULATION "elf_i386"
83-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" 83-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
84+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2" 84+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
85diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h 85Index: gcc-4.8.2/gcc/config/i386/linux64.h
86index b793e08..da788b8 100644 86===================================================================
87--- a/gcc/config/i386/linux64.h 87--- gcc-4.8.2.orig/gcc/config/i386/linux64.h 2014-05-06 10:34:51.081657377 +0000
88+++ b/gcc/config/i386/linux64.h 88+++ gcc-4.8.2/gcc/config/i386/linux64.h 2014-05-06 10:34:51.077657377 +0000
89@@ -27,6 +27,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 89@@ -27,6 +27,6 @@
90 #define GNU_USER_LINK_EMULATION64 "elf_x86_64" 90 #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
91 #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64" 91 #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
92 92
@@ -96,21 +96,21 @@ index b793e08..da788b8 100644
96+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2" 96+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
97+#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2" 97+#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
98+#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2" 98+#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
99diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h 99Index: gcc-4.8.2/gcc/config/mips/linux.h
100index 9b4c68d..7ee5ba8 100644 100===================================================================
101--- a/gcc/config/mips/linux.h 101--- gcc-4.8.2.orig/gcc/config/mips/linux.h 2014-05-06 10:34:51.081657377 +0000
102+++ b/gcc/config/mips/linux.h 102+++ gcc-4.8.2/gcc/config/mips/linux.h 2014-05-06 10:34:51.077657377 +0000
103@@ -17,4 +17,4 @@ You should have received a copy of the GNU General Public License 103@@ -17,4 +17,4 @@
104 along with GCC; see the file COPYING3. If not see 104 along with GCC; see the file COPYING3. If not see
105 <http://www.gnu.org/licenses/>. */ 105 <http://www.gnu.org/licenses/>. */
106 106
107-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" 107-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
108+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld.so.1" 108+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld.so.1"
109diff --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h 109Index: gcc-4.8.2/gcc/config/mips/linux64.h
110index dbba47a..c7ed573 100644 110===================================================================
111--- a/gcc/config/mips/linux64.h 111--- gcc-4.8.2.orig/gcc/config/mips/linux64.h 2014-05-06 10:34:51.081657377 +0000
112+++ b/gcc/config/mips/linux64.h 112+++ gcc-4.8.2/gcc/config/mips/linux64.h 2014-05-06 10:34:51.077657377 +0000
113@@ -22,10 +22,10 @@ along with GCC; see the file COPYING3. If not see 113@@ -22,10 +22,10 @@
114 #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip" 114 #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip"
115 #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32" 115 #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
116 116
@@ -125,11 +125,11 @@ index dbba47a..c7ed573 100644
125 #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" 125 #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
126 #define GNU_USER_DYNAMIC_LINKERN32 \ 126 #define GNU_USER_DYNAMIC_LINKERN32 \
127 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ 127 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
128diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h 128Index: gcc-4.8.2/gcc/config/rs6000/linux64.h
129index dc6f67f..bc60769 100644 129===================================================================
130--- a/gcc/config/rs6000/linux64.h 130--- gcc-4.8.2.orig/gcc/config/rs6000/linux64.h 2014-05-06 10:34:51.081657377 +0000
131+++ b/gcc/config/rs6000/linux64.h 131+++ gcc-4.8.2/gcc/config/rs6000/linux64.h 2014-05-06 10:34:51.077657377 +0000
132@@ -360,10 +360,10 @@ extern int dot_symbols; 132@@ -350,10 +350,10 @@
133 #undef LINK_OS_DEFAULT_SPEC 133 #undef LINK_OS_DEFAULT_SPEC
134 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" 134 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
135 135
@@ -144,11 +144,11 @@ index dc6f67f..bc60769 100644
144 #if DEFAULT_LIBC == LIBC_UCLIBC 144 #if DEFAULT_LIBC == LIBC_UCLIBC
145 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" 145 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
146 #elif DEFAULT_LIBC == LIBC_GLIBC 146 #elif DEFAULT_LIBC == LIBC_GLIBC
147diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h 147Index: gcc-4.8.2/gcc/config/sh/linux.h
148index 9e8f32d..86bf81e 100644 148===================================================================
149--- a/gcc/config/sh/linux.h 149--- gcc-4.8.2.orig/gcc/config/sh/linux.h 2014-05-06 10:34:51.081657377 +0000
150+++ b/gcc/config/sh/linux.h 150+++ gcc-4.8.2/gcc/config/sh/linux.h 2014-05-06 10:34:51.077657377 +0000
151@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see 151@@ -43,7 +43,7 @@
152 152
153 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack 153 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
154 154
@@ -157,11 +157,11 @@ index 9e8f32d..86bf81e 100644
157 157
158 #undef SUBTARGET_LINK_EMUL_SUFFIX 158 #undef SUBTARGET_LINK_EMUL_SUFFIX
159 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" 159 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
160diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h 160Index: gcc-4.8.2/gcc/config/sparc/linux.h
161index 49283d3..6f0b03a 100644 161===================================================================
162--- a/gcc/config/sparc/linux.h 162--- gcc-4.8.2.orig/gcc/config/sparc/linux.h 2014-05-06 10:34:51.081657377 +0000
163+++ b/gcc/config/sparc/linux.h 163+++ gcc-4.8.2/gcc/config/sparc/linux.h 2014-05-06 10:34:51.077657377 +0000
164@@ -83,7 +83,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); 164@@ -83,7 +83,7 @@
165 When the -shared link option is used a final link is not being 165 When the -shared link option is used a final link is not being
166 done. */ 166 done. */
167 167
@@ -170,11 +170,11 @@ index 49283d3..6f0b03a 100644
170 170
171 #undef LINK_SPEC 171 #undef LINK_SPEC
172 #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \ 172 #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
173diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h 173Index: gcc-4.8.2/gcc/config/sparc/linux64.h
174index 7d48e96..b01993f 100644 174===================================================================
175--- a/gcc/config/sparc/linux64.h 175--- gcc-4.8.2.orig/gcc/config/sparc/linux64.h 2014-05-06 10:34:51.081657377 +0000
176+++ b/gcc/config/sparc/linux64.h 176+++ gcc-4.8.2/gcc/config/sparc/linux64.h 2014-05-06 10:34:51.077657377 +0000
177@@ -92,8 +92,8 @@ along with GCC; see the file COPYING3. If not see 177@@ -92,8 +92,8 @@
178 When the -shared link option is used a final link is not being 178 When the -shared link option is used a final link is not being
179 done. */ 179 done. */
180 180
@@ -185,6 +185,22 @@ index 7d48e96..b01993f 100644
185 185
186 #ifdef SPARC_BI_ARCH 186 #ifdef SPARC_BI_ARCH
187 187
188-- 188Index: gcc-4.8.2/gcc/config/linux.h
1891.7.10.4 189===================================================================
190 190--- gcc-4.8.2.orig/gcc/config/linux.h 2013-01-10 20:38:27.000000000 +0000
191+++ gcc-4.8.2/gcc/config/linux.h 2014-05-06 10:36:26.549656893 +0000
192@@ -73,10 +73,10 @@
193 GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
194 GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
195 supporting both 32-bit and 64-bit compilation. */
196-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
197-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
198-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
199-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
200+#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
201+#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
202+#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
203+#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0"
204 #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
205 #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
206 #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index 1eafeb4768..81d664a1b3 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -26,7 +26,8 @@ python gcc_multilib_setup() {
26 26
27 bb.utils.remove(build_conf_dir, True) 27 bb.utils.remove(build_conf_dir, True)
28 ml_globs = ('%s/*/t-linux64' % src_conf_dir, 28 ml_globs = ('%s/*/t-linux64' % src_conf_dir,
29 '%s/*/linux64.h' % src_conf_dir) 29 '%s/*/linux64.h' % src_conf_dir,
30 '%s/linux.h' % src_conf_dir)
30 31
31 # copy the target multilib config files to ${B} 32 # copy the target multilib config files to ${B}
32 for ml_glob in ml_globs: 33 for ml_glob in ml_globs:
@@ -93,6 +94,14 @@ python gcc_multilib_setup() {
93 r'\1' + wrap_libdir(libdirx32) + r'\3'), 94 r'\1' + wrap_libdir(libdirx32) + r'\3'),
94 (r'^(#define\s*GLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$', 95 (r'^(#define\s*GLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
95 r'\1' + wrap_libdir(libdirn32) + r'\3'), 96 r'\1' + wrap_libdir(libdirn32) + r'\3'),
97 (r'^(#define\s*UCLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$',
98 r'\1' + wrap_libdir(libdir32) + r'\3'),
99 (r'^(#define\s*UCLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\".*\")$',
100 r'\1' + wrap_libdir(libdir64) + r'\3'),
101 (r'^(#define\s*UCLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
102 r'\1' + wrap_libdir(libdirn32) + r'\3'),
103 (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\s*)(\S+)(\s*\".*\")$',
104 r'\1' + wrap_libdir(libdir32) + r'\3'),
96 ] 105 ]
97 106
98 for (i, line) in enumerate(filelines): 107 for (i, line) in enumerate(filelines):