mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl's ldd - don't exit immidately even if some libraries was not found
@ 2012-06-19 16:42 orc
  2012-06-20  0:53 ` Isaac Dunham
  0 siblings, 1 reply; 4+ messages in thread
From: orc @ 2012-06-19 16:42 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

Patch to make ldd not to exit immidately after unsolved dependencies.

[-- Attachment #2: musl-0.9.1-ldd-dontfail.patch --]
[-- Type: application/octet-stream, Size: 998 bytes --]

diff -Naur musl-0.9.1.o/src/ldso/dynlink.c musl-0.9.1/src/ldso/dynlink.c
--- musl-0.9.1.o/src/ldso/dynlink.c	2012-06-04 04:32:05.000000000 +0800
+++ musl-0.9.1/src/ldso/dynlink.c	2012-06-20 00:32:52.332607400 +0800
@@ -430,12 +430,16 @@
 			if (p->dynv[i] != DT_NEEDED) continue;
 			dep = load_library(p->strings + p->dynv[i+1]);
 			if (!dep) {
-				snprintf(errbuf, sizeof errbuf,
-					"Error loading shared library %s: %m (needed by %s)",
-					p->strings + p->dynv[i+1], p->name);
-				if (runtime) longjmp(rtld_fail, 1);
-				dprintf(2, "%s\n", errbuf);
-				_exit(127);
+				if (!ldd_mode) {
+					snprintf(errbuf, sizeof errbuf,
+						"Error loading shared library %s: %m (needed by %s)",
+						p->strings + p->dynv[i+1], p->name);
+					if (runtime) longjmp(rtld_fail, 1);
+					dprintf(2, "%s\n", errbuf);
+					_exit(127);
+				}
+				else
+					dprintf(1, "\t%s => not found\n", p->strings + p->dynv[i+1]);
 			}
 			if (runtime) {
 				tmp = realloc(*deps, sizeof(*tmp)*(ndeps+2));

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-20  7:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-19 16:42 musl's ldd - don't exit immidately even if some libraries was not found orc
2012-06-20  0:53 ` Isaac Dunham
2012-06-20  1:17   ` Rich Felker
2012-06-20  7:40     ` orc

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).