summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-12-20 15:40:20 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-19 13:24:38 +0000
commit2b5cf2a067cb6d9ca32d851dacdc1aff0cbfe904 (patch)
treeb19c049d43c8b2f1a2eefcc1f257eeef03a62c62 /meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
parentc7a903aaa10eadae4ec7f4af3f3fa30763c144fc (diff)
downloadpoky-2b5cf2a067cb6d9ca32d851dacdc1aff0cbfe904.tar.gz
glibc: Upgrade to 2.31
License-Update: Prefer https to http for gnu.org and fsf.org URLs [1] [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=5a82c74822d3272df2f5929133680478c0cfb4bd (From OE-Core rev: b22626d996e153d6094e1f76ed33ee1bb3eea751) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch')
-rw-r--r--meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
new file mode 100644
index 0000000000..e1c3512e4e
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
@@ -0,0 +1,65 @@
1From 14ddf13b7fc2e39a1ae657ceb3963e35731e95d0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 18 Mar 2015 01:48:24 +0000
4Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well
5
6Upstream-Status: Inappropriate [embedded specific]
7
8The default lib search path order is:
9
10 1) LD_LIBRARY_PATH
11 2) RPATH from the binary
12 3) ld.so.cache
13 4) default search paths embedded in the linker
14
15For nativesdk binaries which are being used alongside binaries on a host system, we
16need the search paths to firstly search the shipped nativesdk libs but then also
17cover the host system. For example we want the host system's libGL and this may be
18in a non-standard location like /usr/lib/mesa. The only place the location is know
19about is in the ld.so.cache of the host system.
20
21Since nativesdk has a simple structure and doesn't need to use a cache itself, we
22repurpose the cache for use as a last resort in finding host system binaries. This
23means we need to switch the order of 3 and 4 above to make this work effectively.
24
25RP 14/10/2010
26
27Signed-off-by: Khem Raj <raj.khem@gmail.com>
28---
29 elf/dl-load.c | 16 ++++++++--------
30 1 file changed, 8 insertions(+), 8 deletions(-)
31
32diff --git a/elf/dl-load.c b/elf/dl-load.c
33index a6b80f9395..3226f2e531 100644
34--- a/elf/dl-load.c
35+++ b/elf/dl-load.c
36@@ -2073,6 +2073,14 @@ _dl_map_object (struct link_map *loader, const char *name,
37 }
38 }
39
40+ /* try the default path. */
41+ if (fd == -1
42+ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
43+ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
44+ && rtld_search_dirs.dirs != (void *) -1)
45+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
46+ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
47+ /* Finally try ld.so.cache */
48 #ifdef USE_LDCONFIG
49 if (fd == -1
50 && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
51@@ -2131,14 +2139,6 @@ _dl_map_object (struct link_map *loader, const char *name,
52 }
53 #endif
54
55- /* Finally, try the default path. */
56- if (fd == -1
57- && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
58- || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB)))
59- && rtld_search_dirs.dirs != (void *) -1)
60- fd = open_path (name, namelen, mode, &rtld_search_dirs,
61- &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
62-
63 /* Add another newline when we are tracing the library loading. */
64 if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
65 _dl_debug_printf ("\n");