build: replace SSTRIP_ARGS with SSTRIP_DISCARD_TRAILING_ZEROES
authorAndre Heider <a.heider@gmail.com>
Sat, 28 Jan 2023 20:16:16 +0000 (21:16 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 4 Jul 2023 18:25:40 +0000 (20:25 +0200)
sstrip only has one functional arg. Make that a bool option, which can
easily depend on other knobs then.

This is required to be disabled for the mold linker.

Signed-off-by: Andre Heider <a.heider@gmail.com>
config/Config-build.in
rules.mk

index df2d9101ca99c91fc8cf727f81bd636f67994fa1..f8d0f8e0bd238d2cdbef263b1539ee6aeed0647a 100644 (file)
@@ -182,7 +182,6 @@ menu "Global build settings"
                        help
                          This will install binaries stripped using strip from binutils.
 
-
                config USE_SSTRIP
                        bool "sstrip"
                        depends on !USE_GLIBC
@@ -199,13 +198,12 @@ menu "Global build settings"
                help
                  Specifies arguments passed to the strip command when stripping binaries.
 
-       config SSTRIP_ARGS
-               string
-               prompt "Sstrip arguments"
+       config SSTRIP_DISCARD_TRAILING_ZEROES
+               bool "Strip trailing zero bytes"
                depends on USE_SSTRIP
-               default "-z"
+               default y
                help
-                 Specifies arguments passed to the sstrip command when stripping binaries.
+                 Use sstrip's -z option to discard trailing zero bytes
 
        config STRIP_KERNEL_EXPORTS
                bool "Strip unnecessary exports from the kernel image"
index 1cedd91aa8df23d7b0cf35ccae57dc7f82a8b2b1..ca27583d27ee2678ccc62443c74d3782492790b0 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -330,7 +330,7 @@ else
     STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
   else
     ifneq ($(CONFIG_USE_SSTRIP),)
-      STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(call qstrip,$(CONFIG_SSTRIP_ARGS))
+      STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(if $(CONFIG_SSTRIP_DISCARD_TRAILING_ZEROES),-z)
     endif
   endif
   RSTRIP= \