]> sourceware.org Git - glibc.git/commitdiff
Adjust name of ld.so in test-container.c.
authorStefan Liebler <stli@linux.ibm.com>
Thu, 4 Oct 2018 11:07:29 +0000 (13:07 +0200)
committerStefan Liebler <stli@linux.ibm.com>
Thu, 4 Oct 2018 11:07:29 +0000 (13:07 +0200)
The test-container.c file assumes that ld.so is always named
something like /elf/ld-linux-*.
But e.g. on s390x it is named ld64.so.1 or ld.so.1 on s390.
There are other architectures like power or mips with similar names.

This patch introduces the new global variable support_objdir_elf_ldso
which contains the absolute path to the runtime linker used by the
testsuite, e.g. OBJDIR_PATH/elf/ld-linux-x86-64.so.2.
The check in test-container.c is now comparing against this path.
Without this patch, test-container.c is searching invalid files / directories
and fails to find glibc/nss/tst-nss-test3.root/tst-nss-test3.script.
Then the test tst-nss-test3 fails!

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
ChangeLog:

* support/support.h (support_objdir_elf_ldso): New variable.
* support/support_paths.c (support_objdir_elf_ldso): Likewise.
* support/Makefile (CFLAGS-support_paths.c): Add definition
for OBJDIR_ELF_LDSO_PATH.
* support/test-container.c (main): Search for the ld.so
which is also used by the testsuite.

ChangeLog
support/Makefile
support/support.h
support/support_paths.c
support/test-container.c

index 955ebc070ad47c54a518a1732007d20a37d1a1f7..f770e14e746537246953d53a0c882a14e64a9a7e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-10-04  Stefan Liebler  <stli@linux.ibm.com>
+
+       * support/support.h (support_objdir_elf_ldso): New variable.
+       * support/support_paths.c (support_objdir_elf_ldso): Likewise.
+       * support/Makefile (CFLAGS-support_paths.c): Add definition
+       for OBJDIR_ELF_LDSO_PATH.
+       * support/test-container.c (main): Search for the ld.so
+       which is also used by the testsuite.
+
 2018-10-02  Rafal Luzynski  <digitalfreak@lingonborough.com>
 
        [BZ #20209]
index 545bfa272799f6f114a999745663356fe02c8519..8b4a7bf8c59a36079fbb19a2b4cd41c0bbd6e97b 100644 (file)
@@ -160,6 +160,7 @@ endif
 CFLAGS-support_paths.c = \
                -DSRCDIR_PATH=\"`cd .. ; pwd`\" \
                -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
+               -DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
                -DINSTDIR_PATH=\"$(prefix)\" \
                -DLIBDIR_PATH=\"$(libdir)\"
 
index d0e15bca1da212e568449127fc03d810c7fd9350..9418cd11ef6e684d1e18bd923d7449c8cf2d970b 100644 (file)
@@ -91,6 +91,10 @@ char *xstrndup (const char *, size_t);
 extern const char support_srcdir_root[];
 extern const char support_objdir_root[];
 
+/* Corresponds to the path to the runtime linker used by the testsuite,
+   e.g. OBJDIR_PATH/elf/ld-linux-x86-64.so.2  */
+extern const char support_objdir_elf_ldso[];
+
 /* Corresponds to the --prefix= passed to configure.  */
 extern const char support_install_prefix[];
 /* Corresponds to the install's lib/ or lib64/ directory.  */
index a1c22315bdb399127e3c972e80e75b31468e2d83..6d0beb102c9b4bedaf197d2c89b65b6b2e0fcb16 100644 (file)
@@ -36,6 +36,14 @@ const char support_objdir_root[] = OBJDIR_PATH;
 # error please -DOBJDIR_PATH=something in the Makefile
 #endif
 
+#ifdef OBJDIR_ELF_LDSO_PATH
+/* Corresponds to the path to the runtime linker used by the testsuite,
+   e.g. OBJDIR_PATH/elf/ld-linux-x86-64.so.2  */
+const char support_objdir_elf_ldso[] = OBJDIR_ELF_LDSO_PATH;
+#else
+# error please -DOBJDIR_ELF_LDSO_PATH=something in the Makefile
+#endif
+
 #ifdef INSTDIR_PATH
 /* Corresponds to the --prefix= passed to configure.  */
 const char support_install_prefix[] = INSTDIR_PATH;
index c56b53ed81b73a84238d771d59d25b9a7988133e..fbdfb4a06aff03583896edee15dab4b05272ffd2 100644 (file)
@@ -674,8 +674,7 @@ main (int argc, char **argv)
        }
     }
 
-  if (strncmp (argv[1], concat (support_objdir_root, "/elf/ld-linux-", NULL),
-              strlen (support_objdir_root) + 14) == 0)
+  if (strcmp (argv[1], support_objdir_elf_ldso) == 0)
     {
       ++argv;
       --argc;
This page took 0.075741 seconds and 5 git commands to generate.