From patchwork Wed Dec 18 11:12:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 36939 Received: (qmail 122488 invoked by alias); 18 Dec 2019 11:12:36 -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 Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 122394 invoked by uid 89); 18 Dec 2019 11:12:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=footer, Footer X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576667552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZNZ4CNzYGT/65hZhC7Z748tDw4fyxhvK4M40EyfUufQ=; b=gU8lQqadVL3GOJ5FigsP2iBNTIfmDDjH5cihzj2TmByyOtFO/18RkpK72PRj35GDNfQeMZ M5KTou7bucLTv5EkN/SFT6lE9jUsWZoCsUceMq7f/JfwkC35Bdgw4Q20J+0WZl2IeJwrpa HEd9SBB5PSMWLcKPgDSC5zFen7dq7i0= From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] build-many-glibcs.py: Fix =?utf-8?Q?=E2=80=9Cglibcs?= i686-gnu =?utf-8?Q?--strip=E2=80=9D?= Date: Wed, 18 Dec 2019 12:12:27 +0100 Message-ID: <875zid3n1g.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 As posted, this change depends on the build-many-glibc.py for built-in system call tables, but this addresses a pre-existing issue. Verified that stripping works on x86_64-linux-gnu, i686-linux-gnu, x86_64-linux-gnu powerpc64le-linux-gnu (the installed files are actually unchanged there), and that i686-gnu now has stripped shared objects. Thanks, Florian 8<------------------------------------------------------------------8< Hurd sues an empty prefix, so the linker scripts end up in /lib, the find command picked them up, and stripping them failed because they are not ELF files. ----- scripts/build-many-glibcs.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- (Footer added to prevent Zimbra from stripping trailing whitespace.) diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index eedaa55033..4afcd5aaea 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -1480,10 +1480,15 @@ class GlibcPolicyForBuild(GlibcPolicyDefault): def extra_commands(self, cmdlist): if self.strip: - cmdlist.add_command('strip', - ['sh', '-c', - ('%s $(find %s/lib* -name "*.so")' % - (self.strip, self.installdir))]) + # Avoid picking up libc.so and libpthread.so, which are + # linker scripts stored in /lib on Hurd. libc and + # libpthread are still stripped via their libc-X.YY.so + # implementation files. + find_command = (('find %s/lib* -name "*.so"' + + r' \! -name libc.so \! -name libpthread.so') + % self.installdir) + cmdlist.add_command('strip', ['sh', '-c', ('%s $(%s)' % + (self.strip, find_command))]) cmdlist.add_command('check', ['make', 'check']) cmdlist.add_command('save-logs', [self.save_logs], always_run=True)