summaryrefslogtreecommitdiff
path: root/patches/uClibc-ng/1.0.22/600-prefer-multilib.patch
blob: 4338f9fd4b6651c77f24b89ea0cff5bb1fe82b3f (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
diff -urpN uClibc-ng-1.0.22.orig/ldso/ldso/dl-elf.c uClibc-ng-1.0.22/ldso/ldso/dl-elf.c
--- uClibc-ng-1.0.22.orig/ldso/ldso/dl-elf.c	2017-03-14 12:17:57.754063532 -0700
+++ uClibc-ng-1.0.22/ldso/ldso/dl-elf.c	2017-03-14 17:14:21.846398236 -0700
@@ -307,6 +307,19 @@ struct elf_resolve *_dl_load_shared_libr
 		}
 	}
 #endif
+
+#ifdef LDSO_MULTILIB_DIR
+	/* If multilib directory is selected, search it before falling back to
+	   standard lib directories. */
+	_dl_if_debug_dprint("\tsearching multilib lib path list\n");
+	tpnt1 = search_for_named_library(libname, rflags,
+					UCLIBC_RUNTIME_PREFIX LDSO_MULTILIB_DIR ":"
+					UCLIBC_RUNTIME_PREFIX "usr" LDSO_MULTILIB_DIR,
+					rpnt, NULL);
+	if (tpnt1 != NULL)
+		return tpnt1;
+#endif
+
 #if defined SHARED && defined __LDSO_SEARCH_INTERP_PATH__
 	/* Look for libraries wherever the shared library loader
 	 * was installed */
@@ -315,6 +328,7 @@ struct elf_resolve *_dl_load_shared_libr
 	if (tpnt1 != NULL)
 		return tpnt1;
 #endif
+
 	/* Lastly, search the standard list of paths for the library.
 	   This list must exactly match the list in uClibc/ldso/util/ldd.c */
 	_dl_if_debug_dprint("\tsearching full lib path list\n");
diff -urpN uClibc-ng-1.0.22.orig/ldso/ldso/Makefile.in uClibc-ng-1.0.22/ldso/ldso/Makefile.in
--- uClibc-ng-1.0.22.orig/ldso/ldso/Makefile.in	2017-03-14 12:17:57.754063532 -0700
+++ uClibc-ng-1.0.22/ldso/ldso/Makefile.in	2017-03-14 15:35:35.277104175 -0700
@@ -34,6 +34,11 @@ CFLAGS-$(DODEBUG)-ldso/ldso := -O2 -g
 
 CFLAGS-ldso.c := -DLDSO_ELFINTERP=\"$(TARGET_ARCH)/elfinterp.c\"
 
+# Search non-default multilib directories
+ifneq ($(MULTILIB_DIR),lib)
+CFLAGS-ldso.c	+= -DLDSO_MULTILIB_DIR=\"$(MULTILIB_DIR)\"
+endif
+
 ifeq ($(TARGET_ARCH),arc)
 CFLAGS-ldso.c += -mno-long-calls
 endif