public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/fw/builtin-syscalls-3] build-many-glibcs.py: Add update-syscalls command
@ 2019-12-12  8:41 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2019-12-12  8:41 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c36c2c43fe850f7bbc505bc8ca64f062a6e1a4e0

commit c36c2c43fe850f7bbc505bc8ca64f062a6e1a4e0
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Dec 11 19:55:20 2019 +0100

    build-many-glibcs.py: Add update-syscalls command
    
    This command should use a temporary Linux tree as well, which is
    currently missing.

Diff:
---
 scripts/build-many-glibcs.py | 49 +++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 46 insertions(+), 3 deletions(-)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index b7edbb6..f2b940f 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -488,7 +488,10 @@ class Context(object):
             old_components = ('gmp', 'mpfr', 'mpc', 'binutils', 'gcc', 'linux',
                               'mig', 'gnumach', 'hurd')
             old_versions = self.build_state['compilers']['build-versions']
-            self.build_glibcs(configs)
+            if action == 'update-syscalls':
+                self.update_syscalls(configs)
+            else:
+                self.build_glibcs(configs)
         self.write_files()
         self.do_build()
         if configs:
@@ -679,6 +682,15 @@ class Context(object):
         for c in configs:
             self.glibc_configs[c].build()
 
+    def update_syscalls(self, configs):
+        """Update the glibc syscall lists."""
+        if not configs:
+            self.remove_dirs(os.path.join(self.builddir, 'syscalls'))
+            self.remove_dirs(os.path.join(self.logsdir, 'syscalls'))
+            configs = sorted(self.glibc_configs.keys())
+        for c in configs:
+            self.glibc_configs[c].for_syscalls().update_syscalls()
+
     def load_versions_json(self):
         """Load information about source directory versions."""
         if not os.access(self.versions_json, os.F_OK):
@@ -911,7 +923,7 @@ class Context(object):
                 self.build_state = json.load(f)
         else:
             self.build_state = {}
-        for k in ('host-libraries', 'compilers', 'glibcs'):
+        for k in ('host-libraries', 'compilers', 'glibcs', 'update-syscalls'):
             if k not in self.build_state:
                 self.build_state[k] = {}
             if 'build-time' not in self.build_state[k]:
@@ -1408,6 +1420,12 @@ class GlibcBase(abc.ABC):
             self.cfg = cfg
         self.ccopts = ccopts
 
+    def for_syscalls(self):
+        """Return the system call updater for this configuration."""
+        return GlibcForSyscalls(compiler=self.compiler, arch=self.arch,
+                                os_name=self.os, variant=self.variant,
+                                cfg=self.cfg, ccopts=self.ccopts)
+
     def tool_name(self, tool):
         """Return the name of a cross-compilation tool."""
         ctool = '%s-%s' % (self.compiler.triplet, tool)
@@ -1516,6 +1534,30 @@ class Glibc(GlibcBase):
         cmdlist.add_command('save-logs', [self.ctx.save_logs],
                             always_run=True)
 
+class GlibcForSyscalls(GlibcBase):
+    def builddir(self):
+        return self.ctx.component_builddir('syscalls', self.name, 'glibc')
+
+    def installdir(self):
+        raise RuntimeError("Installation not supported")
+
+    def update_syscalls(self):
+        """Run make update-syscall-lists for this glibc configuraton."""
+        logsdir = os.path.join(self.ctx.logsdir, 'syscalls', self.name)
+        self.ctx.remove_recreate_dirs(self.builddir(), logsdir)
+        cmdlist = CommandList('syscalls-%s' % self.name, self.ctx.keep)
+        cmdlist.add_command('check-compilers',
+                            ['test', '-f',
+                             os.path.join(self.compiler.installdir, 'ok')])
+        cmdlist.use_path(self.compiler.bindir)
+
+        cmdlist.create_use_dir(self.builddir())
+        cmdlist.add_command('configure', self.configure_command())
+        cmdlist.add_command('build', ['make', 'update-syscall-lists'])
+        cmdlist.cleanup_dir()
+        self.ctx.add_makefile_cmdlist('syscalls-%s' % self.name, cmdlist,
+                                      logsdir)
+
 class Command(object):
     """A command run in the build process."""
 
@@ -1682,7 +1724,8 @@ def get_parser():
     parser.add_argument('action',
                         help='What to do',
                         choices=('checkout', 'bot-cycle', 'bot',
-                                 'host-libraries', 'compilers', 'glibcs'))
+                                 'host-libraries', 'compilers', 'glibcs',
+                                 'update-syscalls'))
     parser.add_argument('configs',
                         help='Versions to check out or configurations to build',
                         nargs='*')


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-12  8:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12  8:41 [glibc/fw/builtin-syscalls-3] build-many-glibcs.py: Add update-syscalls command Florian Weimer

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).