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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Florian Weimer-5
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.)

Reply | Threaded
Open this post in threaded view
|

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

Joseph Myers
On Wed, 18 Dec 2019, Florian Weimer wrote:

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

This is OK (with s/sues/uses/ in the log message).

--
Joseph S. Myers
[hidden email]