]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
Makefile: introduce KSTRIPCMD to strip kernel modules
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Tue, 30 Nov 2010 15:19:59 +0000 (12:19 -0300)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 30 Nov 2010 15:28:41 +0000 (16:28 +0100)
When sstrip is selected it tries to strip kernel modules too.
Unfortunately this fails with a "unrecognized program segment header
size" error thus interrupting the build process.

We introduce a new $(KSTRIPCMD) strip command for this, being a regular
strip when sstrip is selected and an empty stub when not stripping.

At the same time get rid of the REMOVE_SECTION_* variables, as they are
only used once.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Makefile
package/Makefile.in

index 8dbb026b7f1aca9a2e538cb7738ea71a231fd662..008bdf335812ee57e31147c21c3929640e9cee53 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -421,7 +421,7 @@ endif
        find $(TARGET_DIR) -type f -perm +111 '!' -name 'libthread_db*.so*' | \
                xargs $(STRIPCMD) 2>/dev/null || true
        find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
-               xargs -r $(STRIPCMD) $(STRIP_STRIP_UNNEEDED)
+               xargs -r $(KSTRIPCMD) || true
 
        mkdir -p $(TARGET_DIR)/etc
        # Mandatory configuration file and auxilliary cache directory
index a39dbbc52afdd11ae2babf0cff8b87214308fcaa..2ca8c3144993a4dfadfc64abe7b28c9409ac1e58 100644 (file)
@@ -146,23 +146,22 @@ ifeq ($(BR2_STRIP_strip),y)
 STRIP_DISCARD_ALL:=--discard-all
 STRIP_STRIP_UNNEEDED:=--strip-unneeded
 STRIP_STRIP_ALL:=--strip-all
-REMOVE_SECTION_COMMENT:=--remove-section=.comment
-REMOVE_SECTION_NOTE:=--remove-section=.note
 TARGET_STRIP=$(TARGET_CROSS)strip
-STRIPCMD=$(TARGET_CROSS)strip $(REMOVE_SECTION_COMMENT) $(REMOVE_SECTION_NOTE)
+STRIPCMD=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
+KSTRIPCMD=$(STRIPCMD) $(STRIP_STRIP_UNNEEDED)
 endif
 ifeq ($(BR2_STRIP_sstrip),y)
 STRIP_DISCARD_ALL:=
 STRIP_STRIP_UNNEEDED:=
 STRIP_STRIP_ALL:=
-REMOVE_SECTION_COMMENT:=
-REMOVE_SECTION_NOTE:=
 TARGET_STRIP=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-sstrip
 STRIPCMD=$(TARGET_STRIP)
+KSTRIPCMD=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note --strip-unneeded
 endif
 ifeq ($(BR2_STRIP_none),y)
 TARGET_STRIP=true
 STRIPCMD=$(TARGET_STRIP)
+KSTRIPCMD=$(TARGET_STRIP)
 endif
 INSTALL:=$(shell which install || type -p install)
 FLEX:=$(shell which flex || type -p flex)