public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] build-many-glibcs.py: Fix “glibcs i686-gnu --strip”
@ 2019-12-18 11:12 Florian Weimer
  2019-12-18 17:54 ` Joseph Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2019-12-18 11:12 UTC (permalink / raw)
  To: libc-alpha

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

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)
 
--
(Footer added to prevent Zimbra from stripping trailing whitespace.)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-18 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 11:12 [PATCH] build-many-glibcs.py: Fix “glibcs i686-gnu --strip” Florian Weimer
2019-12-18 17:54 ` Joseph Myers

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