agpu: support clang and gcc build [1/8]
authorJinping Wang <jinping.wang@amlogic.com>
Sun, 8 Mar 2020 09:20:25 +0000 (17:20 +0800)
committerbinqi zhang <binqi.zhang@amlogic.com>
Mon, 2 Nov 2020 06:51:57 +0000 (01:51 -0500)
PD#SWPL-35312

Problem:
need support build with clang
when switch build to clang, it throw many errors.

Solution:
there's some coding problem throw out by clang, clang
consider warning as error, so eliminate with -Wno-error
first. module owner need fix this issue, they're
potential bugs!

the coding issue need tracking in other thread.

Verify:
local and patchbuild

Change-Id: Iffee5be4f58bd97065b63110fa79792c3a77742c
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
gpu-v2.mk [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 9613e7c..ae077d1
--- a/gpu-v2.mk
+++ b/gpu-v2.mk
@@ -34,9 +34,9 @@ define utgard-modules
        @echo "make mali module MALI_OUT is $(PRODUCT_OUT)/obj/mali $(MALI_OUT)"
        @echo "make mali module MAKE is $(MAKE)"
        @echo "GPU_DRV_VERSION is $(1)"
-       PATH=$$(cd ./$(TARGET_HOST_TOOL_PATH); pwd):$$PATH \
+       PATH=$(KERNEL_TOOLPATHS):$$PATH \
        $(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    \
+       $(KERNEL_ARGS) CONFIG_MALI400=m  CONFIG_MALI450=m    \
        EXTRA_CFLAGS="-DCONFIG_MALI400=m -DCONFIG_MALI450=m" \
        EXTRA_LDFLAGS+="--strip-debug" \
        CONFIG_AM_VDEC_H264_4K2K=y
@@ -53,9 +53,9 @@ define midgard-modules
        cp $(2)/* $(PRODUCT_OUT)/obj/t83x -airf
        @echo "make mali module KERNEL_ARCH is $(KERNEL_ARCH) current dir is $(shell pwd)"
        @echo "MALI is $(2), MALI_OUT is $(PRODUCT_OUT)/obj/t83x "
-       PATH=$$(cd ./$(TARGET_HOST_TOOL_PATH); pwd):$$PATH \
+       PATH=$(KERNEL_TOOLPATHS):$$PATH \
        $(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) \
+       $(KERNEL_ARGS) \
        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
@@ -73,12 +73,12 @@ define bifrost-modules
        cp $(2)/* $(PRODUCT_OUT)/obj/bifrost -airf
        @echo "make mali module KERNEL_ARCH is $(KERNEL_ARCH) current dir is $(shell pwd)"
        @echo "MALI is $(2), MALI_OUT is $(PRODUCT_OUT)/obj/bifrost "
-       PATH=$$(cd ./$(TARGET_HOST_TOOL_PATH); pwd):$$PATH \
+       PATH=$(KERNEL_TOOLPATHS):$$PATH \
        $(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) \
+       $(KERNEL_ARGS) \
        EXTRA_CFLAGS="-DCONFIG_MALI_PLATFORM_DEVICETREE -DCONFIG_MALI_MIDGARD_DVFS -DCONFIG_MALI_BACKEND=gpu " \
        EXTRA_CFLAGS+="-I$(shell pwd)/$(PRODUCT_OUT)/obj/bifrost/kernel/include " \
-       EXTRA_CFLAGS+="-Wno-error=larger-than=16384  -DCONFIG_MALI_DMA_BUF_MAP_ON_DEMAND=1 -DCONFIG_MALI_DMA_BUF_LEGACY_COMPAT=0" \
+       EXTRA_CFLAGS+="-Wno-error -DCONFIG_MALI_DMA_BUF_MAP_ON_DEMAND=1 -DCONFIG_MALI_DMA_BUF_LEGACY_COMPAT=0" \
        EXTRA_LDFLAGS+="--strip-debug" \
        CONFIG_MALI_MIDGARD=m CONFIG_MALI_PLATFORM_DEVICETREE=y CONFIG_MALI_MIDGARD_DVFS=y CONFIG_MALI_BACKEND=gpu