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

Commit 8c976599 authored by Naitik Bharadiya's avatar Naitik Bharadiya Committed by Gerrit - the friendly Code Review server
Browse files

LLVMLINUX: kbuild, LLVMLinux: Add more compiler options for clang



Change default compiler options when using clang

Signed-off-by: default avatarBehan Webster <behanw@converseincode.com>
[Refreshed patch following nearby changes in upstream and rename of $(COMPILER)
to $(cc-name)]

Change-Id: I817956d811c57d602851ccbb91afe348b78d7749
Signed-off-by: default avatarDaniel Sanders <daniel.sanders@imgtec.com>
Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
Git-commit: 3389e33f857f6204563e19945539281ed6f6a813
Git-repo: https://android.googlesource.com/kernel/common/


[satyap@codeaurora.org: resolution of trivial merge conflicts]
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
[snaseem@codeaurora.org: resolution of trivial merge conflicts]
Signed-off-by: default avatarShadab Naseem <snaseem@codeaurora.org>
Signed-off-by: default avatarGaurav Kohli <gkohli@codeaurora.org>
Signed-off-by: default avatarNaitik Bharadiya <bharad@codeaurora.org>
parent 5951cd06
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -306,6 +306,11 @@ HOSTCXX = g++
HOSTCFLAGS   := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
HOSTCXXFLAGS = -O2

ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
HOSTCFLAGS  += -Wno-unused-value -Wno-unused-parameter \
		-Wno-missing-field-initializers
endif

# Decide whether to build built-in, modular, or both.
# Normally, just do built-in.

@@ -532,8 +537,12 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
KBUILD_CFLAGS += $(call cc-disable-warning, duplicate-decl-specifier)
KBUILD_CFLAGS += -Wno-undefined-optimized
KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare
KBUILD_CFLAGS += -Wno-asm-operand-widths
KBUILD_CFLAGS += -Wno-initializer-overrides
KBUILD_CFLAGS += -fno-builtin

# Quiet clang warning: comparison of unsigned expression < 0 is always false

KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
@@ -546,6 +555,7 @@ KBUILD_CFLAGS += $(CLANG_FLAGS)
KBUILD_AFLAGS	+= $(CLANG_FLAGS)
else

KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
# These warnings generated too much noise in a regular build.
# Use make W=1 to enable them (see scripts/Makefile.build)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)