From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46455 invoked by alias); 12 Dec 2019 08:41:06 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 46437 invoked by uid 9299); 12 Dec 2019 08:41:06 -0000 Date: Thu, 12 Dec 2019 08:41:00 -0000 Message-ID: <20191212084106.46436.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/fw/builtin-syscalls-3] build-many-glibcs.py: Add update-syscalls command X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/fw/builtin-syscalls-3 X-Git-Oldrev: 219140e1c15ee8833d18e1dd79c424341cec3eab X-Git-Newrev: c36c2c43fe850f7bbc505bc8ca64f062a6e1a4e0 X-SW-Source: 2019-q4/txt/msg00593.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c36c2c43fe850f7bbc505bc8ca64f062a6e1a4e0 commit c36c2c43fe850f7bbc505bc8ca64f062a6e1a4e0 Author: Florian Weimer 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='*')