enable --strip-debug to reduce module size
authorJiyu Yang <Jiyu.Yang@amlogic.com>
Tue, 17 Jul 2018 10:48:02 +0000 (18:48 +0800)
committerJiyu Yang <jiyu.yang@amlogic.com>
Thu, 26 Jul 2018 06:33:13 +0000 (23:33 -0700)
Change-Id: I494faba45e38226b94d46187f1b9be52c0d8e2db

dvalin/kernel/drivers/gpu/arm/midgard/Kbuild
gpu-v2.mk

index 9d3ab611dc09d80cdc8885f227d6357cb2aefbd5..1f67aa0caa48b30358b989dfc1be83b4ed7b3390 100755 (executable)
@@ -66,7 +66,7 @@ DEFINES +=-DMALI_KBASE_PLATFORM_PATH=$(src)/platform/$(CONFIG_MALI_PLATFORM_NAME
 endif
 
 DEFINES += -I$(srctree)/drivers/staging/android
-#ldflags-y += --strip-debug
+ldflags-y += --strip-debug
 
 # Use our defines when compiling
 ccflags-y += $(DEFINES) -I$(KBASE_PATH)   -I$(KBASE_PLATFORM_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux
index 028d6ab6c81aff2d39793e905e56c00dab03c412..61f1ca6b388d9f1099379528de1903179d2cff29 100644 (file)
--- a/gpu-v2.mk
+++ b/gpu-v2.mk
@@ -24,7 +24,7 @@ $(PRODUCT_OUT)/ramdisk.img:mali.ko
 $(PRODUCT_OUT)/system.img:mali.ko
 
 mali.ko: $(GPU_ARCH).ko
-       cp  $(PRODUCT_OUT)/$(GPU_MODS_OUT)/$(GPU_ARCH).ko $(PRODUCT_OUT)/$(GPU_MODS_OUT)/mali.ko
+       echo "$(GPU_ARCH).ko build finished"
 
 #TODO rm shell cmd
 # utgard-modules $(MESON_GPU_DIR) $(GPU_DRV_VERSION) $(KERNEL_ARCH)
@@ -40,11 +40,12 @@ define utgard-modules
        $(MAKE) -C $(shell pwd)/$(PRODUCT_OUT)/obj/KERNEL_OBJ M=$(shell pwd)/$(PRODUCT_OUT)/obj/mali  \
        ARCH=$(3) CROSS_COMPILE=$(PREFIX_CROSS_COMPILE) CONFIG_MALI400=m  CONFIG_MALI450=m    \
        EXTRA_CFLAGS="-DCONFIG_MALI400=m -DCONFIG_MALI450=m" \
+       EXTRA_LDFLAGS+="--strip-debug" \
        CONFIG_AM_VDEC_H264_4K2K=y modules
 
        @echo "GPU_MODS_OUT is $(GPU_MODS_OUT)"
        mkdir -p $(PRODUCT_OUT)/$(GPU_MODS_OUT)
-       cp  $(PRODUCT_OUT)/obj/mali/mali.ko $(PRODUCT_OUT)/$(GPU_MODS_OUT)/utgard.ko
+       cp  $(PRODUCT_OUT)/obj/mali/mali.ko $(PRODUCT_OUT)/$(GPU_MODS_OUT)/mali.ko
 endef
 
 #$(call midgard-modules,$(MESON_GPU_DIR),$(MESON_GPU_DIR)/midgard/$(GPU_DRV_VERSION),$(KERNEL_ARCH))
@@ -57,11 +58,12 @@ define midgard-modules
        $(MAKE) -C $(shell pwd)/$(PRODUCT_OUT)/obj/KERNEL_OBJ M=$(shell pwd)/$(PRODUCT_OUT)/obj/t83x/kernel/drivers/gpu/arm/midgard \
        ARCH=$(3) CROSS_COMPILE=$(PREFIX_CROSS_COMPILE) \
        EXTRA_CFLAGS="-DCONFIG_MALI_PLATFORM_DEVICETREE -DCONFIG_MALI_MIDGARD_DVFS -DCONFIG_MALI_BACKEND=gpu" \
+       EXTRA_LDFLAGS+="--strip-debug" \
        CONFIG_MALI_MIDGARD=m CONFIG_MALI_PLATFORM_DEVICETREE=y CONFIG_MALI_MIDGARD_DVFS=y CONFIG_MALI_BACKEND=gpu modules
 
        mkdir -p $(PRODUCT_OUT)/$(GPU_MODS_OUT)
        @echo "GPU_MODS_OUT is $(GPU_MODS_OUT)"
-       cp  $(PRODUCT_OUT)/obj/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase.ko $(PRODUCT_OUT)/$(GPU_MODS_OUT)/midgard.ko
+       cp  $(PRODUCT_OUT)/obj/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase.ko $(PRODUCT_OUT)/$(GPU_MODS_OUT)/mali.ko
        @echo "make mali module finished current dir is $(shell pwd)"
 endef
 
@@ -75,11 +77,12 @@ define bifrost-modules
        $(MAKE) -C $(shell pwd)/$(PRODUCT_OUT)/obj/KERNEL_OBJ M=$(shell pwd)/$(PRODUCT_OUT)/obj/bifrost/kernel/drivers/gpu/arm/midgard \
        ARCH=$(3) CROSS_COMPILE=$(PREFIX_CROSS_COMPILE) \
        EXTRA_CFLAGS="-DCONFIG_MALI_PLATFORM_DEVICETREE -DCONFIG_MALI_MIDGARD_DVFS -DCONFIG_MALI_BACKEND=gpu" \
+       EXTRA_LDFLAGS+="--strip-debug" \
        CONFIG_MALI_MIDGARD=m CONFIG_MALI_PLATFORM_DEVICETREE=y CONFIG_MALI_MIDGARD_DVFS=y CONFIG_MALI_BACKEND=gpu modules
 
        mkdir -p $(PRODUCT_OUT)/$(GPU_MODS_OUT)
        @echo "GPU_MODS_OUT is $(GPU_MODS_OUT)"
-       cp  $(PRODUCT_OUT)/obj/bifrost/kernel/drivers/gpu/arm/midgard/mali_kbase.ko $(PRODUCT_OUT)/$(GPU_MODS_OUT)/bifrost.ko
+       cp  $(PRODUCT_OUT)/obj/bifrost/kernel/drivers/gpu/arm/midgard/mali_kbase.ko $(PRODUCT_OUT)/$(GPU_MODS_OUT)/mali.ko
        @echo "make mali module finished current dir is $(shell pwd)"
 endef