diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-07-28 14:27:41 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-08-13 12:10:42 -0400 |
commit | 4b950bb9ac0c7246dcf75060040577c3de60c166 (patch) | |
tree | 073ac6d106c27b9107f5f0b53c7fe5f8ed610e89 | |
parent | cf8dfd15e5fb280fa1e79e1d373456cb1e701222 (diff) |
Kbuild: Handle PREEMPT_RT for version string and magic
Update the build scripts and the version magic to reflect when
CONFIG_PREEMPT_RT is enabled in the same way as CONFIG_PREEMPT is treated.
The resulting version strings:
Linux m 5.3.0-rc1+ #100 SMP Fri Jul 26 ...
Linux m 5.3.0-rc1+ #101 SMP PREEMPT Fri Jul 26 ...
Linux m 5.3.0-rc1+ #102 SMP PREEMPT_RT Fri Jul 26 ...
The module vermagic:
5.3.0-rc1+ SMP mod_unload modversions
5.3.0-rc1+ SMP preempt mod_unload modversions
5.3.0-rc1+ SMP preempt_rt mod_unload modversions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | include/linux/vermagic.h | 2 | ||||
-rw-r--r-- | init/Makefile | 5 | ||||
-rw-r--r-- | scripts/Makefile.modpost | 2 | ||||
-rwxr-xr-x | scripts/mkcompile_h | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index bae807eb2933..9aced11e9000 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #endif | 9 | #endif |
10 | #ifdef CONFIG_PREEMPT | 10 | #ifdef CONFIG_PREEMPT |
11 | #define MODULE_VERMAGIC_PREEMPT "preempt " | 11 | #define MODULE_VERMAGIC_PREEMPT "preempt " |
12 | #elif defined(CONFIG_PREEMPT_RT) | ||
13 | #define MODULE_VERMAGIC_PREEMPT "preempt_rt " | ||
12 | #else | 14 | #else |
13 | #define MODULE_VERMAGIC_PREEMPT "" | 15 | #define MODULE_VERMAGIC_PREEMPT "" |
14 | #endif | 16 | #endif |
diff --git a/init/Makefile b/init/Makefile index a3e5ce2bcf08..6246a06364d0 100644 --- a/init/Makefile +++ b/init/Makefile | |||
@@ -33,5 +33,6 @@ $(obj)/version.o: include/generated/compile.h | |||
33 | silent_chk_compile.h = : | 33 | silent_chk_compile.h = : |
34 | include/generated/compile.h: FORCE | 34 | include/generated/compile.h: FORCE |
35 | @$($(quiet)chk_compile.h) | 35 | @$($(quiet)chk_compile.h) |
36 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ | 36 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ |
37 | "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)" | 37 | "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \ |
38 | "$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)" | ||
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 26e6574ecd08..e003350bc473 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost | |||
@@ -23,7 +23,7 @@ | |||
23 | # Version magic (see include/linux/vermagic.h for full details) | 23 | # Version magic (see include/linux/vermagic.h for full details) |
24 | # - Kernel release | 24 | # - Kernel release |
25 | # - SMP is CONFIG_SMP | 25 | # - SMP is CONFIG_SMP |
26 | # - PREEMPT is CONFIG_PREEMPT | 26 | # - PREEMPT is CONFIG_PREEMPT[_RT] |
27 | # - GCC Version | 27 | # - GCC Version |
28 | # Module info | 28 | # Module info |
29 | # - Module version (MODULE_VERSION) | 29 | # - Module version (MODULE_VERSION) |
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 2339f86126cb..d1d757c6edf4 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h | |||
@@ -5,7 +5,8 @@ TARGET=$1 | |||
5 | ARCH=$2 | 5 | ARCH=$2 |
6 | SMP=$3 | 6 | SMP=$3 |
7 | PREEMPT=$4 | 7 | PREEMPT=$4 |
8 | CC=$5 | 8 | PREEMPT_RT=$5 |
9 | CC=$6 | ||
9 | 10 | ||
10 | vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; } | 11 | vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; } |
11 | 12 | ||
@@ -53,6 +54,7 @@ UTS_VERSION="#$VERSION" | |||
53 | CONFIG_FLAGS="" | 54 | CONFIG_FLAGS="" |
54 | if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi | 55 | if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi |
55 | if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi | 56 | if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi |
57 | if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi | ||
56 | UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP" | 58 | UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP" |
57 | 59 | ||
58 | # Truncate to maximum length | 60 | # Truncate to maximum length |