From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 00E0B1F463 for ; Mon, 6 Jan 2020 15:58:17 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=tXyQKxJKkcX4kJFAqhsYhkkNDucqS8nVr+WYvadWx/l ZlqyMdiBHrLBK35ZvsQer6T9f6mx1dYNVfISPhGmjkhF0HuihYLfznZpJ0oBn7nX EKDaCReJxIg7OvBnGvtnDodkjBbJk+zHM/HS7kxvk7yt/I6pqC8c7Ow0c3GkKlgo = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; s=default; bh=2SwQZ3/Eso+JwFD2OovXrbsmtaM=; b=dvl0L16i06VCEU0RA np9v1kbtcbK2LY9UqlEllnifegsgFlZA4wPP0hsLYpE5cs/8murs0CLnk5/w1qtP TPjVtnxUPgj4agqp6KUcvbHdp767Ybagz9VPqEfO47W+OLLSr1EJ2nNlfwFS7b0V 9s7mulcHiEY1FWTYo5/vrlu0oY= Received: (qmail 95307 invoked by alias); 6 Jan 2020 15:57:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 95229 invoked by uid 89); 6 Jan 2020 15:57:31 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 7116A1EA1CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326241; bh=S35KlLadx2UHOqn4tYNFcqiGB5ep8U8QNNZ8P0gAjQQ=; h=From:To:Date:Message-Id:MIME-Version; b=Zba9TCsa4ikRbk43yhoU1lriFFzCvgGIJEE8F58XRR6fTvH9L0IBAkqcdnzc3kiZ/ XVcymMcqSqApVUo8pZfhZ3QAW1f8ZAv9OrdQn6BCobWpwPbAnSzlSROT6qfdnOGLyK 0m65YDyOsgsvk7ZgnBMo3SQI+g2d9EAzIdgrdpiU4WzAkRjs1RwTCxzhQGeVxmavD2 6a4Gk/FVZkR+L6MyYftx3+fBYJ/zlS/OXjQa/JXQPjrqKBB+lWfClCYMcloXOcn+RL ofD6KZGNWmxzwXjmXCvnAnKtHL0EdY9YKudCblfJAIxgUTDuj6DbXK+oyZDgL0Lot9 LKZAg3092CzwQ== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 08/13] build-many-glibcs.py: Implement update-syscalls command Date: Mon, 6 Jan 2020 10:57:08 -0500 Message-Id: <20200106155713.397-9-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Florian Weimer This command uses pre-built compilers to re-install the Linux headers from the current sources into a temporary location and runs glibc's =E2=80=9Cmake update-syscalls-lists=E2=80=9D against that. This updates = the glibc source tree with the current system call numbers. --- scripts/build-many-glibcs.py | 65 ++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index 58f2409b1d..eedaa55033 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -498,7 +498,10 @@ class Context(object): old_components =3D ('gmp', 'mpfr', 'mpc', 'binutils', 'gcc',= 'linux', 'mig', 'gnumach', 'hurd') old_versions =3D self.build_state['compilers']['build-versio= ns'] - self.build_glibcs(configs) + if action =3D=3D 'update-syscalls': + self.update_syscalls(configs) + else: + self.build_glibcs(configs) self.write_files() self.do_build() if configs: @@ -689,6 +692,15 @@ class Context(object): for c in configs: self.glibc_configs[c].build() =20 + def update_syscalls(self, configs): + """Update the glibc syscall lists.""" + if not configs: + self.remove_dirs(os.path.join(self.builddir, 'update-syscall= s')) + self.remove_dirs(os.path.join(self.logsdir, 'update-syscalls= ')) + configs =3D sorted(self.glibc_configs.keys()) + for c in configs: + self.glibc_configs[c].update_syscalls() + def load_versions_json(self): """Load information about source directory versions.""" if not os.access(self.versions_json, os.F_OK): @@ -921,7 +933,7 @@ class Context(object): self.build_state =3D json.load(f) else: self.build_state =3D {} - for k in ('host-libraries', 'compilers', 'glibcs'): + for k in ('host-libraries', 'compilers', 'glibcs', 'update-sysca= lls'): if k not in self.build_state: self.build_state[k] =3D {} if 'build-time' not in self.build_state[k]: @@ -1169,6 +1181,16 @@ class LinuxHeadersPolicyForBuild(object): self.builddir =3D config.component_builddir('linux') self.headers_dir =3D os.path.join(config.sysroot, 'usr') =20 +class LinuxHeadersPolicyForUpdateSyscalls(object): + """Names and directories for Linux headers. update-syscalls variant= .""" + + def __init__(self, glibc, headers_dir): + self.arch =3D glibc.compiler.arch + self.srcdir =3D glibc.compiler.ctx.component_srcdir('linux') + self.builddir =3D glibc.ctx.component_builddir( + 'update-syscalls', glibc.name, 'build-linux') + self.headers_dir =3D headers_dir + def install_linux_headers(policy, cmdlist): """Install Linux kernel headers.""" arch_map =3D {'aarch64': 'arm64', @@ -1465,6 +1487,20 @@ class GlibcPolicyForBuild(GlibcPolicyDefault): cmdlist.add_command('check', ['make', 'check']) cmdlist.add_command('save-logs', [self.save_logs], always_run=3D= True) =20 +class GlibcPolicyForUpdateSyscalls(GlibcPolicyDefault): + """Build policy for glibc during update-syscalls.""" + + def __init__(self, glibc): + super().__init__(glibc) + self.builddir =3D glibc.ctx.component_builddir( + 'update-syscalls', glibc.name, 'glibc') + self.linuxdir =3D glibc.ctx.component_builddir( + 'update-syscalls', glibc.name, 'linux') + self.linux_policy =3D LinuxHeadersPolicyForUpdateSyscalls( + glibc, self.linuxdir) + self.configure_args.insert( + 0, '--with-headers=3D%s' % os.path.join(self.linuxdir, 'incl= ude')) + # self.installdir not set because installation is not supported =20 class Glibc(object): """A configuration for building glibc.""" @@ -1535,6 +1571,28 @@ class Glibc(object): policy.extra_commands(cmdlist) cmdlist.cleanup_dir() =20 + def update_syscalls(self): + if self.os =3D=3D 'gnu': + # Hurd does not have system call tables that need updating. + return + + policy =3D GlibcPolicyForUpdateSyscalls(self) + logsdir =3D os.path.join(self.ctx.logsdir, 'update-syscalls', se= lf.name) + self.ctx.remove_recreate_dirs(policy.builddir, logsdir) + cmdlist =3D CommandList('update-syscalls-%s' % self.name, self.c= tx.keep) + cmdlist.add_command('check-compilers', + ['test', '-f', + os.path.join(self.compiler.installdir, 'ok'= )]) + cmdlist.use_path(self.compiler.bindir) + + install_linux_headers(policy.linux_policy, cmdlist) + + cmdlist.create_use_dir(policy.builddir) + policy.configure(cmdlist) + cmdlist.add_command('build', ['make', 'update-syscall-lists']) + cmdlist.cleanup_dir() + self.ctx.add_makefile_cmdlist('update-syscalls-%s' % self.name, + cmdlist, logsdir) =20 class Command(object): """A command run in the build process.""" @@ -1702,7 +1760,8 @@ def get_parser(): parser.add_argument('action', help=3D'What to do', choices=3D('checkout', 'bot-cycle', 'bot', - 'host-libraries', 'compilers', 'glibcs'= )) + 'host-libraries', 'compilers', 'glibcs'= , + 'update-syscalls')) parser.add_argument('configs', help=3D'Versions to check out or configurations = to build', nargs=3D'*') --=20 2.17.1