Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] infra: fix striping of ld.so and libpthread
@ 2016-11-09 10:57 Jérôme Pouiller
  2016-11-09 22:18 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Jérôme Pouiller @ 2016-11-09 10:57 UTC (permalink / raw)
  To: buildroot

If 'lib' is a symlink, 'find lib' does not return correct result. So, until now,
libpthread*.so* and ld-*.so* was not stripped when 'lib' was a symlink.

We fix tit by using 'find lib/' instead of 'find lib'

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 6cf5f1c..e4f5441 100644
--- a/Makefile
+++ b/Makefile
@@ -644,7 +644,7 @@ target-finalize: $(PACKAGES)
 		$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
 		$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
 	find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
-	find $(TARGET_DIR)/lib $(TARGET_DIR)/usr/lib $(TARGET_DIR)/usr/libexec \
+	find $(TARGET_DIR)/lib/ $(TARGET_DIR)/usr/lib/ $(TARGET_DIR)/usr/libexec/ \
 		\( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
 ifneq ($(BR2_PACKAGE_GDB),y)
 	rm -rf $(TARGET_DIR)/usr/share/gdb
@@ -666,13 +666,13 @@ endif
 # besides the one in which crash occurred; or SIGTRAP kills my program when
 # I set a breakpoint"
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
-	find $(TARGET_DIR)/lib -type f -name 'libpthread*.so*' | \
+	find $(TARGET_DIR)/lib/ -type f -name 'libpthread*.so*' | \
 		xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
 endif
 
 # Valgrind needs ld.so with enough information, so only strip
 # debugging symbols.
-	find $(TARGET_DIR)/lib -type f -name 'ld-*.so*' | \
+	find $(TARGET_DIR)/lib/ -type f -name 'ld-*.so*' | \
 		xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
 	test -f $(TARGET_DIR)/etc/ld.so.conf && \
 		{ echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true
-- 
2.9.3

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

* [Buildroot] [PATCH] infra: fix striping of ld.so and libpthread
  2016-11-09 10:57 [Buildroot] [PATCH] infra: fix striping of ld.so and libpthread Jérôme Pouiller
@ 2016-11-09 22:18 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-11-09 22:18 UTC (permalink / raw)
  To: buildroot

Hello,

Thanks for contributing this patch, this was definitely buggy.

In the commit title: striping -> stripping.

On Wed,  9 Nov 2016 11:57:27 +0100, J?r?me Pouiller wrote:
> If 'lib' is a symlink, 'find lib' does not return correct result. So, until now,

return *the* correct result. Also, it would have been good to explain
that this typically occurs when the "merged /usr" option is enabled.

> libpthread*.so* and ld-*.so* was not stripped when 'lib' was a symlink.
> 
> We fix tit by using 'find lib/' instead of 'find lib'

We fix *this*.

> @@ -644,7 +644,7 @@ target-finalize: $(PACKAGES)
>  		$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
>  		$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
>  	find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
> -	find $(TARGET_DIR)/lib $(TARGET_DIR)/usr/lib $(TARGET_DIR)/usr/libexec \
> +	find $(TARGET_DIR)/lib/ $(TARGET_DIR)/usr/lib/ $(TARGET_DIR)/usr/libexec/ \

This change should have been explained in the commit log: it's just
done for consistency, but doesn't fix anything by itself.

I've applied to master with those various issues fixed.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-11-09 22:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-09 10:57 [Buildroot] [PATCH] infra: fix striping of ld.so and libpthread Jérôme Pouiller
2016-11-09 22:18 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox