Skip to contentSkip to conversation

core: remove lkegacy BR2_STRIP_none

PATCH New Yann E. MORIN 2 participants 5 messages Jul 1, 2017

lore
Share & tools
lore
#0 lore raw

cover core: remove lkegacy BR2_STRIP_none

Hello All!

This is a legacy option that dates back to when we had support for three different kond of stripping: none, strip and sstrip.

We now have only strip or none, which is semantically just a boolean, rather than a choice.

But choices are not randomised, so having the stripping option a real boolean rather than a choice will allow us to test it in the autobuilders.

Regards,
Yann E. MORIN.

The following changes since commit 967ef5af9e570419145849a50915ac4c2573b31b

boot/syslinux: drop patch 0008, not needed after gnu-efi update (2017-06-30 23:55:39 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 02528111029d67c8e42a098a1f836806e05c4a49

core: change the stipr command from a choice to a boolean (2017-07-01 14:47:02 +0200)

----------------------------------------------------------------
Yann E. MORIN (3):
core: use positive logic for unstripped files/dirs
core: simplify the condition to set the strip command
core: change the stipr command from a choice to a boolean

 Config.in              | 17 ++++-------------
 Config.in.legacy       |  8 ++++++++
 boot/grub2/grub2.mk    |  2 +-
 package/Makefile.in    |  3 +--
 package/kexec/kexec.mk |  2 +-
 5 files changed, 15 insertions(+), 17 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/3 core: use positive logic for unstripped files/dirs

Cc Arnout Vandecappelle <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 Config.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Config.in +2 -2
index bd8f0d1a10..86e10bbe15 100644
@@ -436,7 +436,7 @@ endchoice
 
 config BR2_STRIP_EXCLUDE_FILES
 	string "executables that should not be stripped"
-	depends on !BR2_STRIP_none
+	depends on BR2_STRIP_strip
 	default ""
 	help
 	  You may specify a space-separated list of binaries and
@@ -444,7 +444,7 @@ config BR2_STRIP_EXCLUDE_FILES
 
 config BR2_STRIP_EXCLUDE_DIRS
 	string "directories that should be skipped when stripping"
-	depends on !BR2_STRIP_none
+	depends on BR2_STRIP_strip
 	default ""
 	help
 	  You may specify a space-separated list of directories that
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/3 core: simplify the condition to set the strip command

In reply to Yann E. MORIN

Since BR2_STRIP_strip and BR2_STRIP_noine are mutually exclusive (being part of a choice), we can simplify the logic.

Cc Arnout Vandecappelle <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/Makefile.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
package/Makefile.in +1 -2
index 4a3eb26963..9566567fbf 100644
@@ -205,8 +205,7 @@ ifeq ($(BR2_STRIP_strip),y)
 STRIP_STRIP_DEBUG := --strip-debug
 TARGET_STRIP = $(TARGET_CROSS)strip
 STRIPCMD = $(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
-endif
-ifeq ($(BR2_STRIP_none),y)
+else
 TARGET_STRIP = true
 STRIPCMD = $(TARGET_STRIP)
 endif
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/3 core: change the stipr command from a choice to a boolean

In reply to Yann E. MORIN

Curently, we have a choice to select between stripping and not stripping. This is legacy code from back when we had a third option, sstrip (super-strip).

Since we removed sstrip, stripping or not stripping is now just a boolean rather than a choice.

Make it so.

We make BR2_STRIP_Strip default to 'y' to keep the current behaviour of defaulting to stripping.

Move BR2_STIP_none to legacy, and instruct the user to review the new setting.

Drop any reference to BR2_STRIP_none in comments.

Cc Arnout Vandecappelle <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 Config.in              | 13 ++-----------
 Config.in.legacy       |  8 ++++++++
 boot/grub2/grub2.mk    |  2 +-
 package/kexec/kexec.mk |  2 +-
 4 files changed, 12 insertions(+), 13 deletions(-)
Config.in +2 -11
index 86e10bbe15..72ceadfde6 100644
@@ -414,13 +414,10 @@ config BR2_DEBUG_3
 endchoice
 endif
 
-choice
-	prompt "strip command for binaries on target"
-	default BR2_STRIP_strip
-
 config BR2_STRIP_strip
-	bool "strip"
+	bool "strip target binaries"
 	depends on !BR2_PACKAGE_HOST_ELF2FLT
+	default y
 	help
 	  Binaries and libraries in the target filesystem will be
 	  stripped using the normal 'strip' command. This allows to save
@@ -428,12 +425,6 @@ config BR2_STRIP_strip
 	  on the target are needed for native debugging, but not when
 	  remote debugging is used.
 
-config BR2_STRIP_none
-	bool "none"
-	help
-	  Do not strip binaries and libraries in the target filesystem.
-endchoice
-
 config BR2_STRIP_EXCLUDE_FILES
 	string "executables that should not be stripped"
 	depends on BR2_STRIP_strip
Config.in.legacy +8 -0
index ec28da3a2a..453c5eb8b8 100644
@@ -145,6 +145,14 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2017.08"
 
+config BR2_STRIP_none
+	bool "Strip command 'none' has been removed"
+	select BR2_LEGACY
+	help
+	  The strip command choice has been changed into a single
+	  boolean option. Please check that the new setting is
+	  correct (in the "Build options" sub-menu)
+
 config BR2_PACKAGE_BEECRYPT_CPP
 	bool "C++ support removed in beecrypt"
 	select BR2_LEGACY
boot/grub2/grub2.mk +1 -1
index dc019835ab..aa3f4dd8cb 100644
@@ -46,7 +46,7 @@ endif
 # bootloader itself; none of these are used to build the native
 # tools.
 #
-# NOTE: TARGET_STRIP is overridden by BR2_STRIP_none, so always
+# NOTE: TARGET_STRIP is overridden by !BR2_STRIP_strip, so always
 # use the cross compile variant to ensure grub2 builds
 
 GRUB2_CONF_ENV = \
package/kexec/kexec.mk +1 -1
index 7564103bfc..dd67eab0ca 100644
@@ -10,7 +10,7 @@ KEXEC_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/kernel/kexec
 KEXEC_LICENSE = GPL-2.0
 KEXEC_LICENSE_FILES = COPYING
 
-# Makefile expects $STRIP -o to work, so needed for BR2_STRIP_none
+# Makefile expects $STRIP -o to work, so needed for !BR2_STRIP_strip
 KEXEC_MAKE_OPTS = STRIP="$(TARGET_CROSS)strip"
 
 ifeq ($(BR2_PACKAGE_KEXEC_ZLIB),y)
Signature · 1 line
2.11.0
#4 lore raw

cover core: remove lkegacy BR2_STRIP_none

In reply to Yann E. MORIN

Hello,

Quoted 9 lines · Yann E. MORIN

This is a legacy option that dates back to when we had support for three different kond of stripping: none, strip and sstrip.

We now have only strip or none, which is semantically just a boolean, rather than a choice.

But choices are not randomised, so having the stripping option a real boolean rather than a choice will allow us to test it in the autobuilders.

As discussed IRL, autobuilders use randpackageconfig, so such options will not be randomized. But anyway, I think your changes make sense, so I've applied.

Thanks!

Thomas

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