* [PATCH] Linux: dirent/tst-readdir64-compat can be a regular test
@ 2021-03-05 13:05 Florian Weimer
2021-03-08 13:42 ` Adhemerval Zanella
0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2021-03-05 13:05 UTC (permalink / raw)
To: libc-alpha
compat_symbol_reference works in non-internal tests now. Also
avoid building the test for unsupported configurations at all.
I verified by building with build-many-glibcs.py that GLIBC_2.1.3
works as the predecessor of GLIBC_2.2. (Symbol versions in
the early days are complex.)
---
sysdeps/unix/sysv/linux/Makefile | 6 +++++-
sysdeps/unix/sysv/linux/tst-readdir64-compat.c | 5 -----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 51e28b97ac..2dc8b1f443 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -265,8 +265,12 @@ inhibit-glue = yes
ifeq ($(subdir),dirent)
sysdep_routines += getdirentries getdirentries64
tests += tst-getdents64
-tests-internal += tst-readdir64-compat
+
+# The tested readdir64 symbol was replaced in glibc 2.2.
+ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
+tests += tst-readdir64-compat
endif
+endif # $(subdir) == dirent
ifeq ($(subdir),nis)
CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
diff --git a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
index 4a31a485b3..d04de3112b 100644
--- a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
+++ b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
@@ -37,16 +37,12 @@ struct __old_dirent64
typedef struct __old_dirent64 *(*compat_readdir64_type) (DIR *);
-#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
struct __old_dirent64 *compat_readdir64 (DIR *);
compat_symbol_reference (libc, compat_readdir64, readdir64, GLIBC_2_1);
-#endif
static int
do_test (void)
{
-#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
-
/* Directory stream using the non-compat readdir64 symbol. The test
checks against this. */
DIR *dir_reference = opendir (".");
@@ -108,7 +104,6 @@ do_test (void)
TEST_COMPARE (closedir (dir_test), 0);
TEST_COMPARE (closedir (dir_reference), 0);
-#endif
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Linux: dirent/tst-readdir64-compat can be a regular test
2021-03-05 13:05 [PATCH] Linux: dirent/tst-readdir64-compat can be a regular test Florian Weimer
@ 2021-03-08 13:42 ` Adhemerval Zanella
0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2021-03-08 13:42 UTC (permalink / raw)
To: libc-alpha
On 05/03/2021 10:05, Florian Weimer via Libc-alpha wrote:
> compat_symbol_reference works in non-internal tests now. Also
> avoid building the test for unsupported configurations at all.
> I verified by building with build-many-glibcs.py that GLIBC_2.1.3
> works as the predecessor of GLIBC_2.2. (Symbol versions in
> the early days are complex.)
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
>
> ---
> sysdeps/unix/sysv/linux/Makefile | 6 +++++-
> sysdeps/unix/sysv/linux/tst-readdir64-compat.c | 5 -----
> 2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 51e28b97ac..2dc8b1f443 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -265,8 +265,12 @@ inhibit-glue = yes
> ifeq ($(subdir),dirent)
> sysdep_routines += getdirentries getdirentries64
> tests += tst-getdents64
> -tests-internal += tst-readdir64-compat
> +
> +# The tested readdir64 symbol was replaced in glibc 2.2.
> +ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
> +tests += tst-readdir64-compat
> endif
> +endif # $(subdir) == dirent
>
> ifeq ($(subdir),nis)
> CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
Ok.
> diff --git a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
> index 4a31a485b3..d04de3112b 100644
> --- a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
> +++ b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
> @@ -37,16 +37,12 @@ struct __old_dirent64
>
> typedef struct __old_dirent64 *(*compat_readdir64_type) (DIR *);
>
> -#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
> struct __old_dirent64 *compat_readdir64 (DIR *);
> compat_symbol_reference (libc, compat_readdir64, readdir64, GLIBC_2_1);
> -#endif
>
> static int
> do_test (void)
> {
> -#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
> -
> /* Directory stream using the non-compat readdir64 symbol. The test
> checks against this. */
> DIR *dir_reference = opendir (".");
> @@ -108,7 +104,6 @@ do_test (void)
>
> TEST_COMPARE (closedir (dir_test), 0);
> TEST_COMPARE (closedir (dir_reference), 0);
> -#endif
> return 0;
> }
>
>
Ok.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-08 13:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 13:05 [PATCH] Linux: dirent/tst-readdir64-compat can be a regular test Florian Weimer
2021-03-08 13:42 ` Adhemerval Zanella
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).