unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Make --bindir effetive
@ 2019-05-13 16:59 Adhemerval Zanella
  2019-05-13 16:59 ` [PATCH 2/3] support: Export bindir path on support_path Adhemerval Zanella
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2019-05-13 16:59 UTC (permalink / raw)
  To: libc-alpha; +Cc: Carlos O'Donell

This allows sets a path using --bindir.  Checked on x86_64-linux-gnu
with a non-default --bindir and checked resulting installed binaries
(pldd for instance).

	* config.make.in (bindir): New variable.
---
 config.make.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config.make.in b/config.make.in
index f46bfc29bb..2fed3da773 100644
--- a/config.make.in
+++ b/config.make.in
@@ -10,6 +10,7 @@ prefix = @prefix@
 exec_prefix = @exec_prefix@
 datadir = @datadir@
 libdir = @libdir@
+bindir = @bindir@
 slibdir = @libc_cv_slibdir@
 rtlddir = @libc_cv_rtlddir@
 complocaledir = @libc_cv_complocaledir@
-- 
2.17.1


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

* [PATCH 2/3] support: Export bindir path on support_path
  2019-05-13 16:59 [PATCH 1/3] Make --bindir effetive Adhemerval Zanella
@ 2019-05-13 16:59 ` Adhemerval Zanella
  2019-05-13 20:59   ` DJ Delorie
  2019-05-13 16:59 ` [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544) Adhemerval Zanella
  2019-05-13 20:57 ` [PATCH 1/3] Make --bindir effetive DJ Delorie
  2 siblings, 1 reply; 8+ messages in thread
From: Adhemerval Zanella @ 2019-05-13 16:59 UTC (permalink / raw)
  To: libc-alpha; +Cc: Carlos O'Donell

Checked on x86_64-linux-gnu.

	* support/Makefile (CFLAGS-support_paths.c): Add -DBINDIR_PATH.
	* support/support.h (support_bindir_prefix): New variable.
	* support/support_paths.c [BINDIR_PATH] (support_bindir_prefix):
---
 support/Makefile        | 3 ++-
 support/support.h       | 2 ++
 support/support_paths.c | 7 +++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/support/Makefile b/support/Makefile
index 64044f6f5c..fe416cdc5f 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -179,7 +179,8 @@ CFLAGS-support_paths.c = \
 		-DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
 		-DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
 		-DINSTDIR_PATH=\"$(prefix)\" \
-		-DLIBDIR_PATH=\"$(libdir)\"
+		-DLIBDIR_PATH=\"$(libdir)\" \
+		-DBINDIR_PATH=\"$(bindir)\"
 
 ifeq (,$(CXX))
 LINKS_DSO_PROGRAM = links-dso-program-c
diff --git a/support/support.h b/support/support.h
index 97fef2cd23..b162491be6 100644
--- a/support/support.h
+++ b/support/support.h
@@ -105,6 +105,8 @@ extern const char support_objdir_elf_ldso[];
 extern const char support_install_prefix[];
 /* Corresponds to the install's lib/ or lib64/ directory.  */
 extern const char support_libdir_prefix[];
+/* Corresponds to the install's bin/ directory.  */
+extern const char support_bindir_prefix[];
 
 extern ssize_t support_copy_file_range (int, off64_t *, int, off64_t *,
 					size_t, unsigned int);
diff --git a/support/support_paths.c b/support/support_paths.c
index 937e6e1012..75634aab9a 100644
--- a/support/support_paths.c
+++ b/support/support_paths.c
@@ -57,3 +57,10 @@ const char support_libdir_prefix[] = LIBDIR_PATH;
 #else
 # error please -DLIBDIR_PATH=something in the Makefile
 #endif
+
+#ifdef BINDIR_PATH
+/* Corresponds to the install's bin/ directory.  */
+const char support_bindir_prefix[] = BINDIR_PATH;
+#else
+# error please -DBINDIR_PATH=something in the Makefile
+#endif
-- 
2.17.1


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

* [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544)
  2019-05-13 16:59 [PATCH 1/3] Make --bindir effetive Adhemerval Zanella
  2019-05-13 16:59 ` [PATCH 2/3] support: Export bindir path on support_path Adhemerval Zanella
@ 2019-05-13 16:59 ` Adhemerval Zanella
  2019-05-13 21:02   ` DJ Delorie
  2019-05-18 19:07   ` Rafal Luzynski
  2019-05-13 20:57 ` [PATCH 1/3] Make --bindir effetive DJ Delorie
  2 siblings, 2 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2019-05-13 16:59 UTC (permalink / raw)
  To: libc-alpha; +Cc: Carlos O'Donell

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 <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <stdint.h>
 #include <stdbool.h>
@@ -28,6 +29,7 @@
 #include <support/subprocess.h>
 #include <support/capture_subprocess.h>
 #include <support/check.h>
+#include <support/support.h>
 
 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
-- 
2.17.1


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

* Re: [PATCH 1/3] Make --bindir effetive
  2019-05-13 16:59 [PATCH 1/3] Make --bindir effetive Adhemerval Zanella
  2019-05-13 16:59 ` [PATCH 2/3] support: Export bindir path on support_path Adhemerval Zanella
  2019-05-13 16:59 ` [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544) Adhemerval Zanella
@ 2019-05-13 20:57 ` DJ Delorie
  2 siblings, 0 replies; 8+ messages in thread
From: DJ Delorie @ 2019-05-13 20:57 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, codonell


LGTM.

Reviewed-by: DJ Delorie <dj@redhat.com>

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

* Re: [PATCH 2/3] support: Export bindir path on support_path
  2019-05-13 16:59 ` [PATCH 2/3] support: Export bindir path on support_path Adhemerval Zanella
@ 2019-05-13 20:59   ` DJ Delorie
  0 siblings, 0 replies; 8+ messages in thread
From: DJ Delorie @ 2019-05-13 20:59 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, codonell

Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> 	* support/Makefile (CFLAGS-support_paths.c): Add -DBINDIR_PATH.
> 	* support/support.h (support_bindir_prefix): New variable.
> 	* support/support_paths.c [BINDIR_PATH] (support_bindir_prefix):

LGTM

Reviewed-by: DJ Delorie <dj@redhat.com>

>  		-DINSTDIR_PATH=\"$(prefix)\" \
> -		-DLIBDIR_PATH=\"$(libdir)\"
> +		-DLIBDIR_PATH=\"$(libdir)\" \
> +		-DBINDIR_PATH=\"$(bindir)\"

Ok.

>  /* Corresponds to the install's lib/ or lib64/ directory.  */
>  extern const char support_libdir_prefix[];
> +/* Corresponds to the install's bin/ directory.  */
> +extern const char support_bindir_prefix[];

Ok.

> +
> +#ifdef BINDIR_PATH
> +/* Corresponds to the install's bin/ directory.  */
> +const char support_bindir_prefix[] = BINDIR_PATH;
> +#else
> +# error please -DBINDIR_PATH=something in the Makefile
> +#endif

Ok.

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

* Re: [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544)
  2019-05-13 16:59 ` [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544) Adhemerval Zanella
@ 2019-05-13 21:02   ` DJ Delorie
  2019-05-18 19:07   ` Rafal Luzynski
  1 sibling, 0 replies; 8+ messages in thread
From: DJ Delorie @ 2019-05-13 21:02 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, codonell

Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> 	[BZ #24544]
> 	* elf/tst-pldd.c (do_test): Use support_bindir_prefix instead of
> 	pre-defined value.

LGTM.

Reviewed-by: DJ Delorie <dj@redhat.com>

> +#include <stdlib.h>

For free(), Ok.

> +#include <support/support.h>

For paths, ok.

> -    const char prog[] = "/usr/bin/pldd";
> +    char *prog = xasprintf ("%s/pldd", support_bindir_prefix);

Ok.  Results must be free'd.

> +    free (prog);

And free'd.  Ok.

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

* Re: [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544)
  2019-05-13 16:59 ` [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544) Adhemerval Zanella
  2019-05-13 21:02   ` DJ Delorie
@ 2019-05-18 19:07   ` Rafal Luzynski
  2019-05-20  9:12     ` Florian Weimer
  1 sibling, 1 reply; 8+ messages in thread
From: Rafal Luzynski @ 2019-05-18 19:07 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

13.05.2019 18:59 Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
> 
> 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.

Thank you for this fix Adhemerval.  I'd like to say that thanks to this
fix the testsuite passes again on my older machine and fixes the problem
which I complained about the other day.  So if anybody (Florian?) wants
to backport the pldd fix to 2.27 *with* the test cases it is possible now.

(Disclaimer: Before changing anything it must be verified that it's really
this patch which fixes the problem and that whether it requires some other
patches.  I have not verified every single commit.)

Regards,

Rafal

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

* Re: [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544)
  2019-05-18 19:07   ` Rafal Luzynski
@ 2019-05-20  9:12     ` Florian Weimer
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Weimer @ 2019-05-20  9:12 UTC (permalink / raw)
  To: Rafal Luzynski; +Cc: Adhemerval Zanella, libc-alpha

* Rafal Luzynski:

> 13.05.2019 18:59 Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
>> 
>> 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.
>
> Thank you for this fix Adhemerval.  I'd like to say that thanks to this
> fix the testsuite passes again on my older machine and fixes the problem
> which I complained about the other day.  So if anybody (Florian?) wants
> to backport the pldd fix to 2.27 *with* the test cases it is possible
> now.

The other blocker for the test backport is the lack of the
test-in-container framework.  I'm not sure if we should backport that.

Thanks,
Florian

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

end of thread, other threads:[~2019-05-20  9:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 16:59 [PATCH 1/3] Make --bindir effetive Adhemerval Zanella
2019-05-13 16:59 ` [PATCH 2/3] support: Export bindir path on support_path Adhemerval Zanella
2019-05-13 20:59   ` DJ Delorie
2019-05-13 16:59 ` [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544) Adhemerval Zanella
2019-05-13 21:02   ` DJ Delorie
2019-05-18 19:07   ` Rafal Luzynski
2019-05-20  9:12     ` Florian Weimer
2019-05-13 20:57 ` [PATCH 1/3] Make --bindir effetive DJ Delorie

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 read-only IMAP folder(s) and NNTP newsgroup(s).