Revert "kbuild: add clang support"

This reverts commit 58fd0778c6dcc6bd3148b5d07615cd7bd777f456.

Change-Id: Ibffe036d2e182652b3c966c10ed405c9386f823c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2015-11-05 15:19:42 -05:00
parent b43758d22a
commit 14cb8da750
2 changed files with 5 additions and 42 deletions

View file

@ -352,19 +352,6 @@ CFLAGS_KERNEL =
AFLAGS_KERNEL =
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
ifeq ($(COMPILER),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_TARGET := -target $(notdir $(CROSS_COMPILE:%-=%))
GCC_TOOLCHAIN := $(dir $(CROSS_COMPILE))
endif
ifneq ($(GCC_TOOLCHAIN),)
CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN)
endif
ifneq ($(IA),1)
CLANG_IA_FLAG = -no-integrated-as
endif
CLANG_FLAGS := $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_IA_FLAG)
endif
# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE := -include $(CURDIR)/include/generated/autoconf.h
@ -386,9 +373,10 @@ ZEPHYRINCLUDE := \
KBUILD_CPPFLAGS := -DKERNEL
KBUILD_CFLAGS := -c -g -std=c99 \
-fno-reorder-functions \
-fno-asynchronous-unwind-tables \
-fno-omit-frame-pointer \
-Wall \
-fno-defer-pop -Wall \
-Wno-unused-but-set-variable \
-Wno-format-zero-length \
-Wno-main -ffreestanding
@ -667,25 +655,6 @@ KBUILD_CFLAGS += $(CFLAGS)
KBUILD_AFLAGS += $(CFLAGS)
ifeq ($(COMPILER),clang)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
# Quiet clang warning: comparison of unsigned expression < 0 is always false
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
else
# This warning generated too much noise in a regular build.
# Use make W=1 to enable this warning (see scripts/Makefile.build)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
KBUILD_CFLAGS += $(call cc-option,-fno-reorder-functions)
KBUILD_CFLAGS += $(call cc-option,-fno-defer-pop)
# conserve stack if available
KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
endif
# We trigger additional mismatches with less inlining
ifdef CONFIG_DEBUG_SECTION_MISMATCH
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
@ -705,6 +674,8 @@ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
# on a per-function basis.
KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
# conserve stack if available
KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
# disallow errors like 'EXPORT_GPL(foo);' with missing header
KBUILD_CFLAGS += $(call cc-option,-Werror=implicit-int)

View file

@ -6,15 +6,7 @@ cflags-y += $(call cc-option,-ffunction-sections,) $(call cc-option,-fdata-secti
ifeq ($(PERF_OPT),y)
cflags-y += -DPERF_OPT
else
PREFERRED_STACK_BOUNDARY = y
endif
ifeq ($(COMPILER),gcc)
cflags-$(PREFERRED_STACK_BOUNDARY) += $(call cc-option,-mpreferred-stack-boundary=2)
else
biarch := $(call cc-option,-m32)
KBUILD_AFLAGS += $(biarch)
KBUILD_CFLAGS += $(biarch)
cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
endif
cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)