aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-12-11 19:55:20 +0100
committerFlorian Weimer <fweimer@redhat.com>2019-12-11 19:55:20 +0100
commitc36c2c43fe850f7bbc505bc8ca64f062a6e1a4e0 (patch)
tree7245c7ed4fbe02c69feb94e8fd5d223d81087682
parent219140e1c15ee8833d18e1dd79c424341cec3eab (diff)
build-many-glibcs.py: Add update-syscalls commandfw/builtin-syscalls-3
This command should use a temporary Linux tree as well, which is currently missing.
-rwxr-xr-xscripts/build-many-glibcs.py49
1 files changed, 46 insertions, 3 deletions
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index b7edbb6b7e..f2b940f82c 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='*')