mailing list of musl libc
 help / color / mirror / code / Atom feed
From: orc <orc@sibserver.ru>
To: musl@lists.openwall.com
Subject: musl's ldd - don't exit immidately even if some libraries was not found
Date: Wed, 20 Jun 2012 00:42:10 +0800	[thread overview]
Message-ID: <20120620004210.07666644@sibserver.ru> (raw)

[-- 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));

             reply	other threads:[~2012-06-19 16:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19 16:42 orc [this message]
2012-06-20  0:53 ` Isaac Dunham
2012-06-20  1:17   ` Rich Felker
2012-06-20  7:40     ` orc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120620004210.07666644@sibserver.ru \
    --to=orc@sibserver.ru \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).