This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] build-many-glibcs.py: Fix “glibcs i686-gnu --strip”


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]