Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3] Makefile: respect strip exclusions for special libraries
Date: Mon, 4 Feb 2019 16:57:05 +0100	[thread overview]
Message-ID: <20190204165705.12e5f49a@windsurf> (raw)
In-Reply-To: <20180703110614.59009bdb@donbot>

Hello,

On Tue, 3 Jul 2018 11:06:14 +0100
John Keeping <john@metanate.com> wrote:

> ld-*.so and libpthread*.so* are not stripped in the same way as other
> binaries because some applications need symbols in these libraries in
> order to operate correctly.
> 
> However, the special handling for these binaries ignores the usual
> BR2_STRIP_EXCLUDE_* rules so it is not possible to build an image which
> has debugging symbols in these binaries.
> 
> Pull out the common find functionality so that we can build two find
> commands that re-use the common exclusion rules.
> 
> Fix-suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: John Keeping <john@metanate.com>

I've applied to master, with a very minor change (see below).

> -STRIP_FIND_CMD = find $(TARGET_DIR)
> -ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)))
> -STRIP_FIND_CMD += \( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o
> -endif
> -STRIP_FIND_CMD += -type f \( -perm /111 -o -name '*.so*' \)

So the permission check used to be here.

> -# file exclusions:
> +# 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 \
> +	) \
> +	$(if $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES)), \
> +		-not \( $(call findfileclauses,$(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) )
> +
> +# Regular stripping for everything, except libpthread, ld-*.so and
> +# kernel modules:
>  # - libpthread.so: a non-stripped libpthread shared library is needed for
>  #   proper debugging of pthread programs using gdb.
>  # - ld.so: a non-stripped dynamic linker library is needed for valgrind
>  # - kernel modules (*.ko): do not function properly when stripped like normal
>  #   applications and libraries. Normally kernel modules are already excluded
>  #   by the executable permission check above, so the explicit exclusion is only

... but it's not below that comment so the "executable permission check
above" is no longer true. I just deleted the "above" :)

>  #   done for kernel modules with incorrect permissions.
> -STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* ld-*.so* *.ko $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print0
> +STRIP_FIND_CMD = \
> +	$(STRIP_FIND_COMMON_CMD) \
> +	-type f \( -perm /111 -o -name '*.so*' \) \

The executable permission check is now here.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      parent reply	other threads:[~2019-02-04 15:57 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
2018-07-03 10:06       ` [Buildroot] [PATCH v3] " John Keeping
2018-07-10 15:56         ` Matthew Weber
2019-02-04 15:57         ` Thomas Petazzoni [this message]

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=20190204165705.12e5f49a@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --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