File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -264,7 +264,8 @@ no-dot-config-targets := $(clean-targets) \
264264 $(version_h ) headers headers_% archheaders archscripts \
265265 %asm-generic kernelversion %src-pkg dt_binding_check \
266266 outputmakefile
267- no-sync-config-targets := $(no-dot-config-targets ) %install kernelrelease
267+ no-sync-config-targets := $(no-dot-config-targets ) %install kernelrelease \
268+ image_name
268269single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
269270
270271config-build :=
@@ -478,6 +479,7 @@ USERINCLUDE := \
478479 -I$(objtree ) /arch/$(SRCARCH ) /include/generated/uapi \
479480 -I$(srctree ) /include/uapi \
480481 -I$(objtree ) /include/generated/uapi \
482+ -include $(srctree ) /include/linux/compiler-version.h \
481483 -include $(srctree ) /include/linux/kconfig.h
482484
483485# Use LINUXINCLUDE when you must reference the include/ directory.
Original file line number Diff line number Diff line change @@ -632,13 +632,12 @@ config HAS_LTO_CLANG
632632 def_bool y
633633 # Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510
634634 depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD
635- depends on $(success,test $(LLVM) -eq 1)
636635 depends on $(success,test $(LLVM_IAS) -eq 1)
637636 depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
638637 depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
639638 depends on ARCH_SUPPORTS_LTO_CLANG
640639 depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
641- depends on !KASAN
640+ depends on !KASAN || KASAN_HW_TAGS
642641 depends on !GCOV_KERNEL
643642 help
644643 The compiler and Kconfig options support building with Clang's
Original file line number Diff line number Diff line change 1+ /* SPDX-License-Identifier: GPL-2.0-only */
2+
3+ #ifdef __LINUX_COMPILER_VERSION_H
4+ #error "Please do not include <linux/compiler-version.h>. This is done by the build system."
5+ #endif
6+ #define __LINUX_COMPILER_VERSION_H
7+
8+ /*
9+ * This header exists to force full rebuild when the compiler is upgraded.
10+ *
11+ * When fixdep scans this, it will find this string "CONFIG_CC_VERSION_TEXT"
12+ * and add dependency on include/config/cc/version/text.h, which is touched
13+ * by Kconfig when the version string from the compiler changes.
14+ */
Original file line number Diff line number Diff line change 22#ifndef __LINUX_KCONFIG_H
33#define __LINUX_KCONFIG_H
44
5- /* CONFIG_CC_VERSION_TEXT (Do not delete this comment. See help in Kconfig) */
6-
75#include <generated/autoconf.h>
86
97#ifdef CONFIG_CPU_BIG_ENDIAN
Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ config CC_VERSION_TEXT
2020 When the compiler is updated, Kconfig will be invoked.
2121
2222 - Ensure full rebuild when the compiler is updated
23- include/linux/kconfig .h contains this option in the comment line so
24- fixdep adds include/config/cc/version/text.h into the auto-generated
25- dependency. When the compiler is updated, syncconfig will touch it
26- and then every file will be rebuilt.
23+ include/linux/compiler-version .h contains this option in the comment
24+ line so fixdep adds include/config/cc/version/text.h into the
25+ auto-generated dependency. When the compiler is updated, syncconfig
26+ will touch it and then every file will be rebuilt.
2727
2828config CC_IS_GCC
2929 def_bool $(success,test "$(cc-name)" = GCC)
Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
327327
328328quiet_cmd_dtc = DTC $@
329329cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
330- $(DTC) -O $(patsubst .%,%,$(suffix $@)) - o $@ -b 0 \
330+ $(DTC) -o $@ -b 0 \
331331 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
332332 -d $(depfile).dtc.tmp $(dtc-tmp) ; \
333333 cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
@@ -352,7 +352,7 @@ define rule_dtc
352352endef
353353
354354$(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
355- $(call if_changed_rule,dtc,yaml )
355+ $(call if_changed_rule,dtc)
356356
357357dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
358358
Original file line number Diff line number Diff line change @@ -57,9 +57,9 @@ if arg_contain --version "$@"; then
5757fi
5858
5959if arg_contain -E " $@ " ; then
60- # For scripts/gcc -version.sh; This emulates GCC 20.0.0
60+ # For scripts/cc -version.sh; This emulates GCC 20.0.0
6161 if arg_contain - " $@ " ; then
62- sed ' s/^ __GNUC__$ /20/; s/^ __GNUC_MINOR__$ /0/; s/^ __GNUC_PATCHLEVEL__$ /0/'
62+ sed -n ' /^GCC/{s/ __GNUC__/20/; s/__GNUC_MINOR__/0/; s/__GNUC_PATCHLEVEL__/0/; p;} '
6363 exit 0
6464 else
6565 echo " no input files" >&2
@@ -73,6 +73,15 @@ if arg_contain -S "$@"; then
7373 echo " %gs"
7474 exit 0
7575 fi
76+
77+ # For arch/powerpc/tools/gcc-check-mprofile-kernel.sh
78+ if arg_contain -m64 " $@ " && arg_contain -mlittle-endian " $@ " &&
79+ arg_contain -mprofile-kernel " $@ " ; then
80+ if ! test -t 0 && ! grep -q notrace; then
81+ echo " _mcount"
82+ fi
83+ exit 0
84+ fi
7685fi
7786
7887# To set GCC_PLUGINS
@@ -85,3 +94,8 @@ if arg_contain -print-file-name=plugin "$@"; then
8594 echo $plugin_dir
8695 exit 0
8796fi
97+
98+ # inverted return value
99+ if arg_contain -D__SIZEOF_INT128__=0 " $@ " ; then
100+ exit 1
101+ fi
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ always-y += $(GCC_PLUGIN)
2222GCC_PLUGINS_DIR = $(shell $(CC ) -print-file-name=plugin)
2323
2424plugin_cxxflags = -Wp,-MMD,$(depfile ) $(KBUILD_HOSTCXXFLAGS ) -fPIC \
25+ -include $(srctree ) /include/linux/compiler-version.h \
2526 -I $(GCC_PLUGINS_DIR ) /include -I $(obj ) -std=gnu++11 \
2627 -fno-rtti -fno-exceptions -fasynchronous-unwind-tables \
2728 -ggdb -Wno-narrowing -Wno-unused-variable \
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ orig_args="$@"
2929# Get the first line of the --version output.
3030IFS='
3131'
32- set -- $( " $@ " --version)
32+ set -- $( LC_ALL=C " $@ " --version)
3333
3434# Split the line on spaces.
3535IFS=' '
@@ -44,14 +44,20 @@ if [ "$1" = GNU -a "$2" = ld ]; then
4444elif [ " $1 " = GNU -a " $2 " = gold ]; then
4545 echo " gold linker is not supported as it is not capable of linking the kernel proper." >&2
4646 exit 1
47- elif [ " $1 " = LLD ]; then
48- version=$2
49- min_version=$lld_min_version
50- name=LLD
51- disp_name=LLD
5247else
53- echo " $orig_args : unknown linker" >&2
54- exit 1
48+ while [ $# -gt 1 -a " $1 " != " LLD" ]; do
49+ shift
50+ done
51+
52+ if [ " $1 " = LLD ]; then
53+ version=$2
54+ min_version=$lld_min_version
55+ name=LLD
56+ disp_name=LLD
57+ else
58+ echo " $orig_args : unknown linker" >&2
59+ exit 1
60+ fi
5561fi
5662
5763# Some distributions append a package release number, as in 2.34-4.fc32
You can’t perform that action at this time.
0 commit comments