diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-11 13:23:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-11 13:23:07 -0400 |
commit | e5337178f7023bd06a39c06e1fab88817559c0f3 (patch) | |
tree | 04e9e9a0c674e0f9bab9102d02c269177406ac5c | |
parent | 834d3cd294abd9ad81c6cbaefdda28aa491ceb06 (diff) | |
parent | 5318321d367c21ca1fe9eb00caefc239c938750a (diff) |
Merge tag 'kbuild-fixes-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Masahiro writes:
"Kbuild fixes for v4.19 (2nd)
- Fix warnings from recordmcount.pl when building with Clang
- Allow Clang to use GNU toolchains correctly
- Disable CONFIG_SAMPLES for UML to avoid build error"
* tag 'kbuild-fixes-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
samples: disable CONFIG_SAMPLES for UML
kbuild: allow to use GCC toolchain not in Clang search path
ftrace: Build with CPPFLAGS to get -Qunused-arguments
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | samples/Kconfig | 1 | ||||
-rw-r--r-- | scripts/Makefile.build | 2 |
3 files changed, 7 insertions, 4 deletions
@@ -483,13 +483,15 @@ endif | |||
483 | ifeq ($(cc-name),clang) | 483 | ifeq ($(cc-name),clang) |
484 | ifneq ($(CROSS_COMPILE),) | 484 | ifneq ($(CROSS_COMPILE),) |
485 | CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) | 485 | CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) |
486 | GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..) | 486 | GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD))) |
487 | CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR) | ||
488 | GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..) | ||
487 | endif | 489 | endif |
488 | ifneq ($(GCC_TOOLCHAIN),) | 490 | ifneq ($(GCC_TOOLCHAIN),) |
489 | CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) | 491 | CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) |
490 | endif | 492 | endif |
491 | KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) | 493 | KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) |
492 | KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) | 494 | KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) |
493 | KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) | 495 | KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) |
494 | KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) | 496 | KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) |
495 | endif | 497 | endif |
diff --git a/samples/Kconfig b/samples/Kconfig index bd133efc1a56..ad1ec7016d4c 100644 --- a/samples/Kconfig +++ b/samples/Kconfig | |||
@@ -1,5 +1,6 @@ | |||
1 | menuconfig SAMPLES | 1 | menuconfig SAMPLES |
2 | bool "Sample kernel code" | 2 | bool "Sample kernel code" |
3 | depends on !UML | ||
3 | help | 4 | help |
4 | You can build and test sample kernel code here. | 5 | You can build and test sample kernel code here. |
5 | 6 | ||
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5a2d1c9578a0..54da4b070db3 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -219,7 +219,7 @@ else | |||
219 | sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ | 219 | sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ |
220 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ | 220 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ |
221 | "$(if $(CONFIG_64BIT),64,32)" \ | 221 | "$(if $(CONFIG_64BIT),64,32)" \ |
222 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \ | 222 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)" \ |
223 | "$(LD) $(KBUILD_LDFLAGS)" "$(NM)" "$(RM)" "$(MV)" \ | 223 | "$(LD) $(KBUILD_LDFLAGS)" "$(NM)" "$(RM)" "$(MV)" \ |
224 | "$(if $(part-of-module),1,0)" "$(@)"; | 224 | "$(if $(part-of-module),1,0)" "$(@)"; |
225 | recordmcount_source := $(srctree)/scripts/recordmcount.pl | 225 | recordmcount_source := $(srctree)/scripts/recordmcount.pl |