From patchwork Mon May 13 16:59:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 32663 Received: (qmail 8350 invoked by alias); 13 May 2019 17:00:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 8270 invoked by uid 89); 13 May 2019 17:00:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=18, 6 X-HELO: mail-vs1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+HFb/MCBBnzyFoYf24Sqja3VP692/AMRNKl2QuS76Q8=; b=wbWy7IMXgggLaAvQNISnXWKgtrsd7S6QyLQ5gS0Qe35O8UZfFqFMATTPZfLhRxKDx8 pvobqv61NRDZTMUFbp4M9+IRkdEzNuyA7rz0dds5DYxkJ/cw6fPQsq20h0xpinwUNKdv sJxww15IR7lFnl8jR9R7lTpeGiKlBzrh8XXUAz1FvPq7EpOereCpMie9J+8dAdqjNMHk N3oS87I8MwmXZz3tyJXdyhw5JJZhHpOz3UUWRn9ZNa2MFsk/YcpCZIXZkK6QjSYlpIxx qrZ6z4siggW7i1g9Bo0LcUQ0HsFqDHEgJPaGcpPVcQtfF0c6+libeqFOP0G8kdPnUTEZ PMbA== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Carlos O'Donell Subject: [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544) Date: Mon, 13 May 2019 13:59:52 -0300 Message-Id: <20190513165952.28972-3-adhemerval.zanella@linaro.org> In-Reply-To: <20190513165952.28972-1-adhemerval.zanella@linaro.org> References: <20190513165952.28972-1-adhemerval.zanella@linaro.org> Use a new libsupport support_bindir_prefix instead of a hardcoded /usr/bin to create the pldd path on container directory. Checked on x86_64-linux-gnu with default and non-default --prefix and --bindir paths, as well with --enable-hardcoded-path-in-tests. [BZ #24544] * elf/tst-pldd.c (do_test): Use support_bindir_prefix instead of pre-defined value. --- elf/tst-pldd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elf/tst-pldd.c b/elf/tst-pldd.c index 2a9f58936f..6b7c94a1c0 100644 --- a/elf/tst-pldd.c +++ b/elf/tst-pldd.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -28,6 +29,7 @@ #include #include #include +#include static void target_process (void *arg) @@ -60,12 +62,14 @@ do_test (void) char pid[3 * sizeof (uint32_t) + 1]; snprintf (pid, array_length (pid), "%d", target.pid); - const char prog[] = "/usr/bin/pldd"; + char *prog = xasprintf ("%s/pldd", support_bindir_prefix); pldd = support_capture_subprogram (prog, (char *const []) { (char *) prog, pid, NULL }); support_capture_subprocess_check (&pldd, "pldd", 0, sc_allow_stdout); + + free (prog); } /* Check 'pldd' output. The test is expected to be linked against only