mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-22 20:43:56 +08:00
6f5b41a2f5
With some of the changes we'd like to make to CROSS_COMPILE, the initial block of clang flag handling which controls things like the target triple, whether or not to use the integrated assembler and how to find GAS, and erroring on unknown warnings is becoming unwieldy. Move it into its own file under scripts/. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
15 lines
450 B
Makefile
15 lines
450 B
Makefile
ifneq ($(CROSS_COMPILE),)
|
|
CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
|
|
endif
|
|
ifeq ($(LLVM_IAS),1)
|
|
CLANG_FLAGS += -integrated-as
|
|
else
|
|
CLANG_FLAGS += -no-integrated-as
|
|
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
|
|
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
|
|
endif
|
|
CLANG_FLAGS += -Werror=unknown-warning-option
|
|
KBUILD_CFLAGS += $(CLANG_FLAGS)
|
|
KBUILD_AFLAGS += $(CLANG_FLAGS)
|
|
export CLANG_FLAGS
|