summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Config.in19
-rw-r--r--Makefile10
2 files changed, 27 insertions, 2 deletions
diff --git a/Config.in b/Config.in
index 95c2e8ca3..83f64bb67 100644
--- a/Config.in
+++ b/Config.in
@@ -283,6 +283,25 @@ config BR2_STRIP_none
filesystem.
endchoice
+config BR2_STRIP_EXCLUDE_FILES
+ string "executables that should not be stripped"
+ depends on !BR2_STRIP_none
+ default ""
+ help
+ You may specify a space-separated list of binaries and libraries
+ here that should not be stripped on the target.
+
+config BR2_STRIP_EXCLUDE_DIRS
+ string "directories that should be skipped when stripping"
+ depends on !BR2_STRIP_none
+ default ""
+ help
+ You may specify a space-separated list of directories that should
+ be skipped when stripping. Binaries and libraries in these
+ directories will not be touched.
+ The directories should be specified relative to the target directory,
+ without leading slash.
+
choice
prompt "gcc optimization level"
default BR2_OPTIMIZE_S
diff --git a/Makefile b/Makefile
index 9a9634d54..c69176731 100644
--- a/Makefile
+++ b/Makefile
@@ -386,6 +386,13 @@ $(BUILD_DIR)/.root:
$(TARGET_DIR): $(BUILD_DIR)/.root
+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
+STRIP_FIND_CMD += -not \( $(call findfileclauses,libthread_db*.so* $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print
+
target-finalize:
ifeq ($(BR2_HAVE_DEVFILES),y)
( support/scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
@@ -410,8 +417,7 @@ endif
ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f
endif
- find $(TARGET_DIR) -type f -perm +111 '!' -name 'libthread_db*.so*' | \
- xargs $(STRIPCMD) 2>/dev/null || true
+ $(STRIP_FIND_CMD) | xargs $(STRIPCMD) 2>/dev/null || true
find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
xargs -r $(KSTRIPCMD) || true