summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/binutils/binutils/nativesdk-relocation.patch80
-rw-r--r--meta/recipes-devtools/binutils/binutils_2.32.bb2
2 files changed, 82 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/nativesdk-relocation.patch b/meta/recipes-devtools/binutils/binutils/nativesdk-relocation.patch
new file mode 100644
index 0000000000..408f7d18b7
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/nativesdk-relocation.patch
@@ -0,0 +1,80 @@
1We need binutils to look at our ld.so.conf file within the SDK to ensure
2we search the SDK's libdirs as well as those from the host system.
3
4We therefore pass in the directory to the code using a define, then add
5it to a section we relocate in a similar way to the way we relocate the
6gcc internal paths. This ensures that ld works correctly in our buildtools
7tarball.
8
9Standard sysroot relocation doesn't work since we're not in a sysroot,
10we want to use both the host system and SDK libs.
11
12Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
132020/1/17
14Upstream-Status: Inappropriate [OE specific tweak]
15
16Index: git/ld/Makefile.am
17===================================================================
18--- git.orig/ld/Makefile.am
19+++ git/ld/Makefile.am
20@@ -36,7 +36,8 @@ am__skipyacc =
21
22 ELF_CLFAGS=-DELF_LIST_OPTIONS=@elf_list_options@ \
23 -DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \
24- -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@
25+ -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@ \
26+ -DSYSCONFDIR="\"$(sysconfdir)\""
27 WARN_CFLAGS = @WARN_CFLAGS@
28 NO_WERROR = @NO_WERROR@
29 AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
30Index: git/ld/Makefile.in
31===================================================================
32--- git.orig/ld/Makefile.in
33+++ git/ld/Makefile.in
34@@ -546,7 +546,8 @@ am__skiplex =
35 am__skipyacc =
36 ELF_CLFAGS = -DELF_LIST_OPTIONS=@elf_list_options@ \
37 -DELF_SHLIB_LIST_OPTIONS=@elf_shlib_list_options@ \
38- -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@
39+ -DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@ \
40+ -DSYSCONFDIR="\"$(sysconfdir)\""
41
42 AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
43 @ENABLE_PLUGINS_FALSE@PLUGIN_C =
44Index: git/ld/emultempl/elf32.em
45===================================================================
46--- git.orig/ld/emultempl/elf32.em
47+++ git/ld/emultempl/elf32.em
48@@ -1024,7 +1024,7 @@ gld${EMULATION_NAME}_check_ld_so_conf (c
49
50 info.path = NULL;
51 info.len = info.alloc = 0;
52- tmppath = concat (ld_sysroot, "${prefix}/etc/ld.so.conf",
53+ tmppath = concat (ld_sysconfdir, "/ld.so.conf",
54 (const char *) NULL);
55 if (!gld${EMULATION_NAME}_parse_ld_so_conf (&info, tmppath))
56 {
57Index: git/ld/ldmain.c
58===================================================================
59--- git.orig/ld/ldmain.c
60+++ git/ld/ldmain.c
61@@ -68,6 +68,7 @@ char *program_name;
62
63 /* The prefix for system library directories. */
64 const char *ld_sysroot;
65+char ld_sysconfdir[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSCONFDIR;
66
67 /* The canonical representation of ld_sysroot. */
68 char *ld_canon_sysroot;
69Index: git/ld/ldmain.h
70===================================================================
71--- git.orig/ld/ldmain.h
72+++ git/ld/ldmain.h
73@@ -23,6 +23,7 @@
74
75 extern char *program_name;
76 extern const char *ld_sysroot;
77+extern char ld_sysconfdir[4096];
78 extern char *ld_canon_sysroot;
79 extern int ld_canon_sysroot_len;
80 extern FILE *saved_script_handle;
diff --git a/meta/recipes-devtools/binutils/binutils_2.32.bb b/meta/recipes-devtools/binutils/binutils_2.32.bb
index 51a9748906..3dcc837c78 100644
--- a/meta/recipes-devtools/binutils/binutils_2.32.bb
+++ b/meta/recipes-devtools/binutils/binutils_2.32.bb
@@ -46,4 +46,6 @@ do_install_class-native () {
46PACKAGE_BEFORE_PN += "libbfd" 46PACKAGE_BEFORE_PN += "libbfd"
47FILES_libbfd = "${libdir}/libbfd-*.so" 47FILES_libbfd = "${libdir}/libbfd-*.so"
48 48
49SRC_URI_append_class-nativesdk = "file://nativesdk-relocation.patch"
50
49BBCLASSEXTEND = "native nativesdk" 51BBCLASSEXTEND = "native nativesdk"