summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNathan Chancellor <natechancellor@gmail.com>2018-11-27 10:22:46 -0700
committerAmit Pundir <amit.pundir@linaro.org>2018-12-11 00:15:25 +0530
commit3e104c78b1da5bffcbd0cf8865bfd2d7e26bd796 (patch)
treeafebd813cc3a043b1c58a2aaeb6934e19efeba2e /Makefile
parent770f7163da89a92625f78c374e0c9cd82f78d190 (diff)
Makefile: Tidy up 4.4.165 merge
Some parts of commit c630d13c9806 ("kbuild: Set KBUILD_CFLAGS before incl. arch Makefile") and its follow up fixes/improvements and commit cfbabf536f6b ("kbuild: clang: disable unused variable warnings only when constant") were not fully applied. Additionally, commit f0907aa15ed9 ("ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple") is reapplied in the new CLANG_TARGET location. Change-Id: Id6332daac607e49213c9a5a594af015830e10d29 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 2 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 77b664f7156b..a0df14c5a4d4 100644
--- a/Makefile
+++ b/Makefile
@@ -611,7 +611,8 @@ all: vmlinux
ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
-CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
+CLANG_TRIPLE ?= $(CROSS_COMPILE)
+CLANG_TARGET := --target=$(notdir $(CLANG_TRIPLE:%-=%))
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR)
GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
@@ -719,18 +720,7 @@ ifdef CONFIG_KCOV
endif
ifeq ($(cc-name),clang)
-ifneq ($(CROSS_COMPILE),)
-CLANG_TRIPLE ?= $(CROSS_COMPILE)
-CLANG_TARGET := --target=$(notdir $(CLANG_TRIPLE:%-=%))
-GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
-endif
-ifneq ($(GCC_TOOLCHAIN),)
-CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
-endif
-KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
-KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
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 += $(call cc-disable-warning, address-of-packed-member)
@@ -742,8 +732,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# See modpost pattern 2
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
-KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
-KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
else
# These warnings generated too much noise in a regular build.