Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] Makefile: respect strip exclusions for special libraries
Date: Mon, 2 Jul 2018 23:04:11 +0200	[thread overview]
Message-ID: <20180702210411.GF2604@scaer> (raw)
In-Reply-To: <20180702222516.5467cc60@windsurf.home>

Thomas, John, All,

On 2018-07-02 22:25 +0200, Thomas Petazzoni spake thusly:
> [...] I find this whole thing pretty complex/noisy. Can we do
> better ?
> 
> Here is some untested initial proposal:
> 
> # When stripping, obey to BR2_STRIP_EXCLUDE_DIRS and
> # BR2_STRIP_EXCLUDE_FILES
> STRIP_FIND_COMMON_CMD = \
> 	find $(TARGET_DIR) \
> 	$(if $(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)),, \
> 		\( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o
> 	) \
> 	-not $(call findfileclauses,$(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) \
> 	-print0
> 
> # Regular stripping for everything, except libpthread, ld-*.so and
> # kernel modules.
> STRIP_FIND_CMD = \
> 	$(STRIP_FIND_COMMON_CMD) \
> 	-type f \( -perm /111 -o -name '*.so*' \) \
> 	-not \( $(call findfileclauses,libpthread*.so* ld-*.so* *.ko) \)
> 
> # Special stripping (only debugging symbols) for libpthread and ld-*.so.
> STRIP_FIND_SPECIAL_LIBS_CMD = \
> 	$(STRIP_FIND_COMMON_CMD) \
> 	\( -name 'ld-*.so*' -o -name 'libpthread*.so*' \)
> 
> And then:
> 
> 	$(STRIP_FIND_CMD) | xargs -0 $(STRIPCMD) 2>/dev/null || true
> 	$(STRIP_FIND_SPECIAL_LIBS_CMD) | xargs -0 $(STRIPCMD) $(STRIP_STRIP_DEBUG) || true
> 
> Thoughts ?

Not tested, but it really looks nice.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2018-07-02 21:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 16:00 [Buildroot] [PATCH] Makefile: respect strip exclusions for special libraries John Keeping
2018-07-02 16:40 ` Yann E. MORIN
2018-07-02 16:57   ` [Buildroot] [PATCH v2] " John Keeping
2018-07-02 20:25     ` Thomas Petazzoni
2018-07-02 21:04       ` Yann E. MORIN [this message]
2018-07-03 10:06       ` [Buildroot] [PATCH v3] " John Keeping
2018-07-10 15:56         ` Matthew Weber
2019-02-04 15:57         ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180702210411.GF2604@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox