Skip to content

Commit

Permalink
[ALPS06334164] ANDROID: clang: update to 13.0.2
Browse files Browse the repository at this point in the history
[Detail]
https://android-review.googlesource.com/c/kernel/common/+/1823999

[Solution]
1. replace r428724 to r433403
2. disable -Wunused-but-set-variable
3. fix error in sspm_timesync.c:174:37: error: overflow in expression;
result is 1385447424 with type long [-Werror,-Winteger-overflow]

MTK-Commit-Id: 7e87be8100d15ce2f0e44dbc3b1146197cf2d5a3

CR-Id: ALPS06334164
Feature: build process
Change-Id: I9be5fa9006f8bf535e24da3e52a919b09aa8d14d
Signed-off-by: Po Hu <[email protected]>
  • Loading branch information
Po Hu authored and alan.hu committed Dec 5, 2021
1 parent adaf578 commit 66517ef
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ include scripts/Makefile.ubsan
# last assignments
KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS) -Werror
KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)

# Use --build-id when available.
LDFLAGS_BUILD_ID := $(call ld-option, --build-id)
Expand Down
18 changes: 18 additions & 0 deletions build.config.mtk.aarch64.tiramisu
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu-
LLVM=1
LLVM_IAS=1
LD_LIBRARY_PATH=prebuilts/clang/host/linux-x86/clang-r433403b/lib64:$$LD_LIBRARY_PATH
# DEFCONFIG=defconfig
KERNEL_DIR=kernel-4.19
CLANG_PREBUILT_BIN=prebuilts/clang/host/linux-x86/clang-r433403b/bin
# for check scripts
CC=clang
LD=ld.lld
AR=llvm-ar
NM=llvm-nm
OBJCOPY=llvm-objcopy
OBJDUMP=llvm-objdump
READELF=llvm-readelf
OBJSIZE=llvm-size
STRIP=llvm-strip
19 changes: 19 additions & 0 deletions build.config.mtk.arm.tiramisu
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARCH=arm

CROSS_COMPILE=arm-linux-gnueabi-
LLVM=1

# DEFCONFIG=defconfig
KERNEL_DIR=kernel-4.19
CLANG_PREBUILT_BIN=prebuilts/clang/host/linux-x86/clang-r433403b/bin
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gas/linux-x86
# for check scripts
CC=clang
LD=ld.lld
AR=llvm-ar
NM=llvm-nm
OBJCOPY=llvm-objcopy
OBJDUMP=llvm-objdump
READELF=llvm-readelf
OBJSIZE=llvm-size
STRIP=llvm-strip
6 changes: 3 additions & 3 deletions drivers/misc/mediatek/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export MTK_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM))
subdir-ccflags-y += -Werror
export MTK_PLATFORM := $(subst $(quote),,$(CONFIG_MTK_PLATFORM))
subdir-ccflags-y := -Werror $(call cc-disable-warning, unused-but-set-variable)
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/
Expand All @@ -12,7 +12,7 @@ obj-$(CONFIG_MTK_IRTX_PWM_SUPPORT) += irtx/
obj-$(CONFIG_MTK_AUDIODSP_SUPPORT) += adsp/
obj-$(CONFIG_MTK_AUDIO_IPI) += audio_ipi/
obj-$(CONFIG_MTK_TINYSYS_SCP_SUPPORT) += scp/
ifeq ($(subst ",,$(CONFIG_MTK_SENSOR_ARCHITECTURE)), 1.0)
ifeq ($(subst $(quote),,$(CONFIG_MTK_SENSOR_ARCHITECTURE)), 1.0)
obj-y += sensors-1.0/
endif

Expand Down
4 changes: 2 additions & 2 deletions drivers/misc/mediatek/connectivity/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ifneq ($(KERNELRELEASE),)
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/clkbuf/src
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/include/clkbuf_v1/$(MTK_PLATFORM)
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/include/mt-plat
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat
subdir-ccflags-y += -I$(srctree)/drivers/mmc/core
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/eccci/$(MTK_PLATFORM)
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/eccci/
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/pmic/mt6370/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
subdir-ccflags-y += -Wall -Werror
subdir-ccflags-y := -Wall -Werror $(call cc-disable-warning, unused-but-set-variable)
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/typec/tcpc/inc
subdir-ccflags-y += -I$(srctree)/drivers/power/supply/mediatek/misc
subdir-ccflags-y += -I$(srctree)/drivers/power/supply
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/sspm/sspm_timesync.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/* sched_clock wrap time is 4398 seconds for arm arch timer
* applying a period less than it for tinysys timesync
*/
#define TIMESYNC_WRAP_TIME (4000*NSEC_PER_SEC)
#define TIMESYNC_WRAP_TIME (4000ULL * NSEC_PER_SEC)

struct timesync_context_t {
spinlock_t lock;
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/mediatek/typec/tcpc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
subdir-ccflags-y += -Wall -Werror
subdir-ccflags-y := -Wall -Werror $(call cc-disable-warning, unused-but-set-variable)
subdir-ccflags-y += -I$(srctree)/drivers/power/supply
obj-$(CONFIG_TCPC_MT6360) += tcpc_mt6360.o
obj-$(CONFIG_TCPC_MT6370) += tcpc_mt6370.o
Expand Down
11 changes: 8 additions & 3 deletions kenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,24 @@ ifneq ($(strip $(TARGET_NO_KERNEL)),true)
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))

kernel_build_config_suffix := .mtk
ifeq ($(KERNEL_TARGET_ARCH),arm64)
kernel_build_config_suffix := $(kernel_build_config_suffix).aarch64
ifeq ($(strip $(TARGET_KERNEL_USE_CLANG)),true)
include $(current_dir)/build.config.mtk.aarch64
else
include $(current_dir)/build.config.mtk.aarch64.gcc
kernel_build_config_suffix := $(kernel_build_config_suffix).gcc
endif
else
kernel_build_config_suffix := $(kernel_build_config_suffix).arm
ifeq ($(strip $(TARGET_KERNEL_USE_CLANG)),true)
include $(current_dir)/build.config.mtk.arm
else
$(error TARGET_KERNEL_USE_CLANG is not set)
endif
endif
ifeq ($(PLATFORM_VERSION),Tiramisu)
kernel_build_config_suffix := $(kernel_build_config_suffix).tiramisu
endif
include $(current_dir)/build.config$(kernel_build_config_suffix)

ARGS := CROSS_COMPILE=$(CROSS_COMPILE)
ifneq ($(LLVM),)
Expand Down
40 changes: 20 additions & 20 deletions sound/soc/mediatek/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
subdir-ccflags-y += -Werror
subdir-ccflags-y := -Werror $(call cc-disable-warning, unused-but-set-variable)

# dsp related code
obj-$(CONFIG_MTK_AUDIODSP_SUPPORT) += audio_dsp/
Expand Down Expand Up @@ -37,10 +37,10 @@ endif
ifeq ($(CONFIG_MTK_SND_SOC_NEW_ARCH),y)

# MTK Platform Support
MTK_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM))
MTK_PLATFORM := $(subst $(quote),,$(CONFIG_MTK_PLATFORM))

# MTK Codec Chip Support
MTK_CODEC := $(subst ",,$(CONFIG_MTK_SND_SOC_CODEC))
MTK_CODEC := $(subst $(quote),,$(CONFIG_MTK_SND_SOC_CODEC))

# flags for not ready feature, uncomment after ready
subdir-ccflags-y += -DAUDIO_USING_WRAP_DRIVER
Expand All @@ -51,47 +51,47 @@ subdir-ccflags-y += -DSND_SOC_AW87519
endif

# include path
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/accdet/mt6358
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/include
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/include/mt-plat
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/base/power/include
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/base/power/$(MTK_PLATFORM)
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/dramc/$(MTK_PLATFORM)/
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/accdet/mt6358
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/$(MTK_PLATFORM)
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/dramc/$(MTK_PLATFORM)/

ifeq ($(CONFIG_MACH_MT6761),y)
AUDIO_PLATFORM := mt6765
else
AUDIO_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM))
AUDIO_PLATFORM := $(subst $(quote),,$(CONFIG_MTK_PLATFORM))
endif

subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/scp/$(AUDIO_PLATFORM)/
subdir-ccflags-y += -Werror -I$(srctree)/drivers/misc/mediatek/audio_ipi/$(AUDIO_PLATFORM)/
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/scp/$(AUDIO_PLATFORM)/
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/audio_ipi/$(AUDIO_PLATFORM)/


# Common include path
subdir-ccflags-y += -Werror -I$(src)/common_int
subdir-ccflags-y += -I$(src)/common_int

# PMIC include path
ifneq ($(MTK_CODEC),)
subdir-ccflags-y += -Werror -I$(src)/codec/$(MTK_CODEC)
ifneq ($(MTK_CODEC),)
subdir-ccflags-y += -I$(src)/codec/$(MTK_CODEC)
endif

subdir-ccflags-y += -Werror -Wno-incompatible-pointer-types
subdir-ccflags-y += -Wno-incompatible-pointer-types

# Update pmic built flow to avoid codec init later than codec probe
ifneq ($(MTK_CODEC),)
ifneq ($(MTK_CODEC),)
obj-y += codec/$(MTK_CODEC)/
endif
obj-y += common_int/

ifeq ($(MTK_PLATFORM),mt6758)
obj-y += mt6758_int/
subdir-ccflags-y += -Werror -I$(src)/mt6758_int
subdir-ccflags-y += -I$(src)/mt6758_int
else
obj-y += $(AUDIO_PLATFORM)/

# AP include path
subdir-ccflags-y += -Werror -I$(src)/$(AUDIO_PLATFORM)
subdir-ccflags-y += -I$(src)/$(AUDIO_PLATFORM)
endif
endif

0 comments on commit 66517ef

Please sign in to comment.