Makefile: Disable constant merging/optimziations with clang
Clang optimizes static constant variables if both variables are having same value. clang decided to merge the bpf_prog_iops and bpf_map_iops into a single memory location, such that the two i_ops could then not be distinguished anymore and leading to kernel panic. So disable Snapdragon specific compiler optimizations by adding -mllvm -disable-struct-const-merge flag to CFLAG. Change-Id: I3a8d3829fd5102c916e74af4080a1b1d2d3257b9 Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
This commit is contained in:
1 parent
13a07ada0e
commit
f7c63176ab
1 file changed
+1
@@ -713,6 +713,7 @@ KBUILD_CFLAGS += -Wno-initializer-overrides
|
||||
KBUILD_CFLAGS += -fno-builtin
|
||||
KBUILD_CFLAGS += $(call cc-option, -Wno-undefined-optimized)
|
||||
KBUILD_CFLAGS += $(call cc-option, -Wno-tautological-constant-out-of-range-compare)
|
||||
KBUILD_CFLAGS += $(call cc-option, -mllvm -disable-struct-const-merge)
|
||||
|
||||
# Quiet clang warning: comparison of unsigned expression < 0 is always false
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
|
||||
|
||||
Reference in new issue
Block a user