Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7c63176 authored by Prasad Sodagudi's avatar Prasad Sodagudi Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: default avatarRishabh Bhatnagar <rishabhb@codeaurora.org>
parent 13a07ada
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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)