ANDROID: HACK: Makefile: whitelist CFLAGS to reenable Werror

This is a two pronged approached, based on whether offending files are
"in tree" vs "out of tree."

For "in tree" files that produce warnings, these warnings are
whitelisted in the top level Makefile. We will work with upstream to
either fix these warnings properly or silence them when building with
Clang.

For "out of tree" files, the most specific directory Makefile is used to
silence this warning for the sub directory.  We will work with the
appropriate vendors to fix these warnings.

With these existing warnings silenced, we can re-enable CONFIG_WERROR.
The method used for "out of tree" files will _not_ catch new instances
of the same error in the same subdirectory, but the idea is that no new
classes of warnings will be added in the future. As we fix existing
warnings, the whitelists will be pruned back (until they no longer
exist).

It's unlikely this patch will be reverted at once. Rather, as we fix
classes of warnings, the whitelists should be pruned back as applicable
until there are no more `TODO: remove me b/62057517`.

Bug: 37513383
Bug: 62057517
Bug: 62058353

Change-Id: I583552512a28eb8867a3f3e848be4af2becdbc8e
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
This commit is contained in:
Nick Desaulniers
2017-05-24 14:25:55 -07:00
parent f3e0b41699
commit 0fd6c92c20
21 changed files with 89 additions and 18 deletions

View File

@@ -414,6 +414,19 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-Wno-format-security \
-std=gnu89 $(CLANG_FLAGS)
# TODO: remove me b/62057517
KBUILD_CFLAGS += \
-Wno-address-of-packed-member \
-Wno-unneeded-internal-declaration \
-Wno-enum-conversion \
-Wno-section \
-Wno-duplicate-decl-specifier \
-Wno-array-bounds \
-Wno-logical-not-parentheses \
-Wno-constant-conversion \
-Wno-parentheses-equality \
-Wno-gcc-compat \
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS := -D__ASSEMBLY__ $(CLANG_FLAGS)

View File

@@ -1,10 +1,3 @@
function update_clang_config() {
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-d CC_WERROR
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}
ARCH=arm64
BRANCH=android-msm-wahoo-4.4
CC=clang
@@ -13,7 +6,7 @@ CROSS_COMPILE=aarch64-linux-android-
DEFCONFIG=wahoo_defconfig
EXTRA_CMDS=''
KERNEL_DIR=private/msm-google
POST_DEFCONFIG_CMDS='check_defconfig && update_clang_config'
POST_DEFCONFIG_CMDS='check_defconfig'
CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-3859424/bin/
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin
LZ4_PREBUILTS_BIN=prebuilts-master/misc/linux-x86/lz4

View File

@@ -1,10 +1,3 @@
function update_clang_config() {
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-d CC_WERROR
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}
ARCH=arm64
BRANCH=android-msm-wahoo-4.4
CC=clang
@@ -13,7 +6,7 @@ CROSS_COMPILE=aarch64-linux-android-
DEFCONFIG=wahoo_defconfig
EXTRA_CMDS=''
KERNEL_DIR=private/msm-google
POST_DEFCONFIG_CMDS='check_defconfig && update_clang_config'
POST_DEFCONFIG_CMDS='check_defconfig'
CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-3859424/bin/
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin
LZ4_PREBUILTS_BIN=prebuilts-master/misc/linux-x86/lz4

View File

@@ -29,3 +29,7 @@ endif
obj-$(CONFIG_COMMON_CLK_MSM) += gdsc.o
obj-$(CONFIG_COMMON_CLK_MSM) += mdss/
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-literal-conversion

View File

@@ -10,3 +10,8 @@ endif
obj-$(CONFIG_CRYPTO_DEV_QCRYPTO) += qcrypto.o
obj-$(CONFIG_CRYPTO_DEV_OTA_CRYPTO) += ota_crypto.o
obj-$(CONFIG_CRYPTO_DEV_QCOM_ICE) += ice.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-frame-larger-than= \
-Wno-ignored-attributes

View File

@@ -23,4 +23,8 @@ obj-y += broadcom/
obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
obj-$(CONFIG_EFI) += efi/
obj-$(CONFIG_UEFI_CPER) += efi/
obj-$(CONFIG_MSM_TZ_LOG) += qcom/
obj-$(CONFIG_MSM_TZ_LOG) += qcom/
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-ignored-attributes

View File

@@ -37,3 +37,7 @@ stmvl53l0-objs := stmvl53l0_module.o \
ifeq ($(FEATURE_USE_CCI), true)
stmvl53l0-objs += stmvl53l0_module-cci.o
endif
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-typedef-redefinition

View File

@@ -1,2 +1,6 @@
obj-$(CONFIG_TOUCHSCREEN_FTM4) += ftm4.o
ftm4-objs += ftm4_ts.o ftm4_fwu.o ftm4_pdc.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-strncat-size

View File

@@ -7,3 +7,6 @@ obj-$(CONFIG_MSM_VIDC_V4L2) += vidc/
obj-y += sde/
obj-y += broadcast/
obj-$(CONFIG_DVB_MPQ) += dvb/
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-parentheses-equality

View File

@@ -20,3 +20,7 @@ obj-$(CONFIG_MSM_VIDC_V4L2) := msm-vidc.o
obj-$(CONFIG_MSM_VIDC_V4L2) += governors/
obj-$(CONFIG_MSM_VIDC_VMEM) += vmem/
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-frame-larger-than=

View File

@@ -71,3 +71,8 @@ google-easel-objs += google-easel-comm.o google-easel-comm-dma.o g
obj-$(CONFIG_FPR_FPC) += fpr_FingerprintCard/
obj-$(CONFIG_MEMORY_STATE_TIME) += memory_state_time.o
obj-$(CONFIG_ACCESS_RAMOOPS) += access_ramoops.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-ignored-attributes \
-Wno-header-guard

View File

@@ -1,3 +1,7 @@
obj-$(CONFIG_IPA3) += ipa_hal.o
ipa_hal-y := ipahal.o ipahal_reg.o ipahal_fltrt.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-shift-overflow

View File

@@ -76,3 +76,7 @@ obj-$(CONFIG_ARCH_QCOM) += qcom/
obj-$(CONFIG_POWER_SUPPLY) += supply/
obj-$(CONFIG_HTC_BATTERY) += htc_battery.o
obj-$(CONFIG_LGE_BATTERY) += lge_battery.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-tentative-definition-incomplete-type

View File

@@ -105,3 +105,7 @@ obj-$(CONFIG_WCD_DSP_GLINK) += wcd-dsp-glink.o
obj-$(CONFIG_QCOM_SMCINVOKE) += smcinvoke.o
obj-$(CONFIG_QCOM_EARLY_RANDOM) += early_random.o
obj-$(CONFIG_QCOM_CX_IPEAK) += cx_ipeak.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-ignored-attributes

View File

@@ -11,3 +11,7 @@ obj-$(CONFIG_DEBUG_BUS_VOTER) += msm_bus_dbg_voter.o
obj-$(CONFIG_CORESIGHT) += msm_buspm_coresight_adhoc.o
obj-$(CONFIG_DEBUG_FS) += msm_bus_dbg.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-self-assign

View File

@@ -11,3 +11,7 @@ obj-$(CONFIG_ION_DUMMY) += ion_dummy_driver.o
obj-$(CONFIG_ION_TEGRA) += tegra/
obj-$(CONFIG_ION_MSM) += msm/
obj-$(CONFIG_ION_MSM) += ion_system_secure_heap.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-constant-logical-operand

View File

@@ -18,3 +18,7 @@ modules_install:
clean:
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
# TODO: remove me b/62057517
KBUILD_CFLAGS += \
-Wno-typedef-redefinition

View File

@@ -64,3 +64,7 @@ obj-$(CONFIG_FB_MSM_QPIC_ILI_QVGA_PANEL) += qpic_panel_ili_qvga.o
obj-$(CONFIG_FB_MSM_MDSS) += mdss_fb.o mdss_util.o
obj-$(CONFIG_COMPAT) += mdss_compat_utils.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-header-guard

View File

@@ -7,3 +7,7 @@ ccflags-y += -Ifs/ext4
obj-$(CONFIG_PFT) += pft.o
obj-$(CONFIG_PFK) += pfk.o pfk_kc.o pfk_ice.o pfk_ext4.o pfk_ecryptfs.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-ignored-attributes

View File

@@ -1,2 +1,5 @@
snd-soc-tas2557-objs := tas2557-core.o tas2557-regmap.o tas2557-codec.o tas2557-misc.o tiload.o
obj-$(CONFIG_SND_SOC_TAS2557_STEREO) += snd-soc-tas2557.o
obj-$(CONFIG_SND_SOC_TAS2557_STEREO) += snd-soc-tas2557.o
# TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-shift-overflow

View File

@@ -19,3 +19,7 @@ obj-y += audio_calibration.o audio_cal_utils.o q6adm.o q6afe.o q6asm.o \
msm-pcm-q6-noirq.o
ocmem-audio-objs += audio_ocmem.o
obj-$(CONFIG_AUDIO_OCMEM) += ocmem-audio.o
#TODO: remove me b/62057517
subdir-ccflags-y += \
-Wno-non-literal-null-conversion