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

Commit 96d47aed authored by Behan Webster's avatar Behan Webster Committed by Satya Durga Srinivasu Prabhala
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)]
Signed-off-by: default avatarDaniel Sanders <daniel.sanders@imgtec.com>

Change-Id: I817956d811c57d602851ccbb91afe348b78d7749
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>
parent 7760647f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -308,7 +308,7 @@ HOSTCXXFLAGS = -O2

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

# Decide whether to build built-in, modular, or both.
@@ -711,7 +711,12 @@ KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
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.
@@ -722,6 +727,7 @@ KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
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.extrawarn)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)