When compiled with LLVM, there will be some false positive warnings. Add options to ignore these warning.
Chen Zhongjin (2): Makefile: Exclude false positive warning options for Clang kbuild: Fix grep -q waring
arch/arm64/kernel/Makefile | 3 +++ block/Makefile | 3 +++ fs/Makefile | 3 +++ scripts/Makefile.build | 4 ++-- 4 files changed, 11 insertions(+), 2 deletions(-)
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9SOCR
---------------------------
Fix three false positive warning options for Bisheng Clang.
Exclude -Walign-mismatch for: block/blk-mq.c:767:51: warning: passing 8-byte aligned argument to 32-byte aligned parameter 2 of 'smp_call_function_single_async' may result in an unaligned pointer access [-Walign-mismatch] smp_call_function_single_async(rq->mq_ctx->cpu, &rq->csd); ^
Exclude -Wbitwise-instead-of-logical for: fs/namei.c:2053:13: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] } while (!(has_zero(a, &adata, &constants) | has_zero(b, &bdata,... ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || fs/namei.c:2053:13: note: cast one or both operands to int to silence this warning
Exclude -Wmacro-redefined for: ./arch/arm64/include/asm/elf.h:218:9: warning: 'COMPAT_ARCH_DLINFO' macro redefined [-Wmacro-redefined] #define COMPAT_ARCH_DLINFO \ ^ arch/arm64/kernel/binfmt_elf32.c:22:9: note: previous definition is here #define COMPAT_ARCH_DLINFO
Signed-off-by: Chen Zhongjin chenzhongjin@huawei.com --- arch/arm64/kernel/Makefile | 3 +++ block/Makefile | 3 +++ fs/Makefile | 3 +++ 3 files changed, 9 insertions(+)
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index c839a123aa4c7..5b9951b6fb052 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -32,6 +32,9 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE
obj-$(CONFIG_AARCH32_EL0) += binfmt_elf32.o sys32.o signal32.o \ sys_compat.o +ifdef CONFIG_CC_IS_CLANG +CFLAGS_binfmt_elf32.o := $(call cc-disable-warning, macro-redefined) +endif obj-$(CONFIG_AARCH32_EL0) += sigreturn32.o obj-$(CONFIG_KUSER_HELPERS) += kuser32.o obj-$(CONFIG_ARM64_ILP32) += binfmt_ilp32.o sys_ilp32.o \ diff --git a/block/Makefile b/block/Makefile index 8d841f5f986fe..29814c6bb2df8 100644 --- a/block/Makefile +++ b/block/Makefile @@ -9,6 +9,9 @@ obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-sysfs.o \ blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \ blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \ genhd.o ioprio.o badblocks.o partitions/ blk-rq-qos.o +ifdef CONFIG_CC_IS_CLANG +CFLAGS_blk-mq.o := $(call cc-disable-warning, align-mismatch) +endif
obj-$(CONFIG_BOUNCE) += bounce.o obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o diff --git a/fs/Makefile b/fs/Makefile index 2a756dda52e56..29cc13ba2c088 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -15,6 +15,9 @@ obj-y := open.o read_write.o file_table.o super.o \ stack.o fs_struct.o statfs.o fs_pin.o nsfs.o \ fs_types.o fs_context.o fs_parser.o fsopen.o init.o \ kernel_read_file.o remap_range.o +ifdef CONFIG_CC_IS_CLANG +CFLAGS_namei.o := $(call cc-disable-warning, bitwise-instead-of-logical) +endif
ifeq ($(CONFIG_BLOCK),y) obj-y += buffer.o block_dev.o direct-io.o mpage.o
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9SOCR
---------------------------
For some aarch64 environment, grep -q can cause warning: error: write on a pipe with no reader
This is caused in compiling when: objdump -h kernel/sched/core.o | grep -q __ksymtab
grep -q __ksymtab is equal to grep __ksymtab > /dev/null, Use the later command to fix above warning.
Signed-off-by: Chen Zhongjin chenzhongjin@huawei.com --- scripts/Makefile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 17e8b20659001..585d4e98211c0 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -167,7 +167,7 @@ ifdef CONFIG_MODVERSIONS # o remove .tmp_<file>.o to <file>.o
cmd_modversions_c = \ - if $(OBJDUMP) -h $@ | grep -q __ksymtab; then \ + if $(OBJDUMP) -h $@ | grep __ksymtab > /dev/null; then \ $(call cmd_gensymtypes_c,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ > $(@D)/.tmp_$(@F:.o=.ver); \ \ @@ -352,7 +352,7 @@ ifdef CONFIG_ASM_MODVERSIONS # we parse asm-prototypes.h C header to get function definitions.
cmd_modversions_S = \ - if $(OBJDUMP) -h $@ | grep -q __ksymtab; then \ + if $(OBJDUMP) -h $@ | grep __ksymtab > /dev/null; then \ $(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \ > $(@D)/.tmp_$(@F:.o=.ver); \ \
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/8229 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/J...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/8229 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/J...