Patchwork Update kernel version to 5.4 in tst-mman-consts.py

login
register
mail settings
Submitter Joseph Myers
Date Nov. 28, 2019, 11:06 p.m.
Message ID <alpine.DEB.2.21.1911282305510.9015@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/36367/
State New
Headers show

Comments

Joseph Myers - Nov. 28, 2019, 11:06 p.m.
This patch updates the kernel version in the test tst-mman-consts.py
to 5.4.  (There are no new constants covered by this test in 5.4 that
need any other header changes.)

Tested with build-many-glibcs.py.
Carlos O'Donell - Nov. 29, 2019, 4:52 a.m.
On 11/28/19 6:06 PM, Joseph Myers wrote:
> This patch updates the kernel version in the test tst-mman-consts.py
> to 5.4.  (There are no new constants covered by this test in 5.4 that
> need any other header changes.)
> 
> Tested with build-many-glibcs.py.
> 
> diff --git a/sysdeps/unix/sysv/linux/tst-mman-consts.py b/sysdeps/unix/sysv/linux/tst-mman-consts.py
> index c11e2ea4ac..3aaf2218f5 100644
> --- a/sysdeps/unix/sysv/linux/tst-mman-consts.py
> +++ b/sysdeps/unix/sysv/linux/tst-mman-consts.py
> @@ -41,7 +41,7 @@ def main():
>                          help='C compiler (including options) to use')
>      args = parser.parse_args()
>      linux_version_headers = linux_kernel_version(args.cc)
> -    linux_version_glibc = (5, 3)
> +    linux_version_glibc = (5, 4)
>      sys.exit(glibcextract.compare_macro_consts(
>          '#define _GNU_SOURCE 1\n'
>          '#include <sys/mman.h>\n',
> 

I reviewed kernel 5.4 and also found no new constants that would require
us to adjust the regexp.

I looked specifically at:
./include/linux/mman.h
./include/uapi/asm-generic/mman.h
./include/uapi/linux/mman.h

And also the arch specific mman.h.

I noticed the test doesn't appear to cover PROT_*, MS_*, MADV_*, MCL_*
or PKEY_* constants? Is that an oversight or a conscious choice?

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Joseph Myers - Nov. 29, 2019, 4:36 p.m.
On Thu, 28 Nov 2019, Carlos O'Donell wrote:

> I noticed the test doesn't appear to cover PROT_*, MS_*, MADV_*, MCL_*
> or PKEY_* constants? Is that an oversight or a conscious choice?

The idea when adding the test was to add something sufficient to be 
useful that could also be a starting point for adding more such tests 
later.  It would certainly make sense to test more such macros there.

We now have three such tests (tst-mman-consts.py tst-signal-numbers.py 
tst-socket-consts.py).  My expectation is that once we have enough, there 
will be clear common patterns that allow us to move to having a single 
Python script to run them, and text files that describe the headers, 
macros (and hopefully structure layouts as well) to compare and any 
relevant kernel version information, rather than a separate Python script 
for each test.  (Cf. how the constant extraction for assembly sources - 
which shares code used by these tests - has .sym files rather than a 
separate script for each generated header.)
Carlos O'Donell - Nov. 29, 2019, 5 p.m.
On 11/29/19 11:36 AM, Joseph Myers wrote:
> On Thu, 28 Nov 2019, Carlos O'Donell wrote:
> 
>> I noticed the test doesn't appear to cover PROT_*, MS_*, MADV_*, MCL_*
>> or PKEY_* constants? Is that an oversight or a conscious choice?
> 
> The idea when adding the test was to add something sufficient to be 
> useful that could also be a starting point for adding more such tests 
> later.  It would certainly make sense to test more such macros there.
> 
> We now have three such tests (tst-mman-consts.py tst-signal-numbers.py 
> tst-socket-consts.py).  My expectation is that once we have enough, there 
> will be clear common patterns that allow us to move to having a single 
> Python script to run them, and text files that describe the headers, 
> macros (and hopefully structure layouts as well) to compare and any 
> relevant kernel version information, rather than a separate Python script 
> for each test.  (Cf. how the constant extraction for assembly sources - 
> which shares code used by these tests - has .sym files rather than a 
> separate script for each generated header.)
 
Thanks, that makes sense, I was just curious.

Patch

diff --git a/sysdeps/unix/sysv/linux/tst-mman-consts.py b/sysdeps/unix/sysv/linux/tst-mman-consts.py
index c11e2ea4ac..3aaf2218f5 100644
--- a/sysdeps/unix/sysv/linux/tst-mman-consts.py
+++ b/sysdeps/unix/sysv/linux/tst-mman-consts.py
@@ -41,7 +41,7 @@  def main():
                         help='C compiler (including options) to use')
     args = parser.parse_args()
     linux_version_headers = linux_kernel_version(args.cc)
-    linux_version_glibc = (5, 3)
+    linux_version_glibc = (5, 4)
     sys.exit(glibcextract.compare_macro_consts(
         '#define _GNU_SOURCE 1\n'
         '#include <sys/mman.h>\n',