Skip to content

Commit d37aa2e

Browse files
masahir0ykees
authored andcommitted
gcc-plugins: use KERNELVERSION for plugin version
Commit 61f60ba ("gcc-plugins: Change all version strings match kernel") broke parallel builds. Instead of adding the dependency between GCC plugins and utsrelease.h, let's use KERNELVERSION, which does not require any build artifact. Another reason why I want to avoid utsrelease.h is because it depends on CONFIG_LOCALVERSION(_AUTO) and localversion* files. (include/generated/utsrelease.h depends on include/config/kernel.release, which is generated by scripts/setlocalversion) I want to keep host tools independent of the kernel configuration. There is no good reason to rebuild GCC plugins just because of CONFIG_LOCALVERSION being changed. We just want to associate the plugin versions with the kernel source version. KERNELVERSION should be enough for our purpose. Fixes: 61f60ba ("gcc-plugins: Change all version strings match kernel") Reported-by: kernel test robot <[email protected]> Link: https://lore.kernel.org/linux-mm/[email protected] Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ed5edd5 commit d37aa2e

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

scripts/gcc-plugins/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin)
2828

2929
plugin_cxxflags = -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \
3030
-include $(srctree)/include/linux/compiler-version.h \
31-
-include $(objtree)/include/generated/utsrelease.h \
31+
-DPLUGIN_VERSION=$(call stringify,$(KERNELVERSION)) \
3232
-I $(GCC_PLUGINS_DIR)/include -I $(obj) -std=gnu++11 \
3333
-fno-rtti -fno-exceptions -fasynchronous-unwind-tables \
3434
-ggdb -Wno-narrowing -Wno-unused-variable \

scripts/gcc-plugins/latent_entropy_plugin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ __visible int plugin_is_GPL_compatible;
8282
static GTY(()) tree latent_entropy_decl;
8383

8484
static struct plugin_info latent_entropy_plugin_info = {
85-
.version = UTS_RELEASE,
85+
.version = PLUGIN_VERSION,
8686
.help = "disable\tturn off latent entropy instrumentation\n",
8787
};
8888

scripts/gcc-plugins/randomize_layout_plugin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ __visible int plugin_is_GPL_compatible;
3434
static int performance_mode;
3535

3636
static struct plugin_info randomize_layout_plugin_info = {
37-
.version = UTS_RELEASE,
37+
.version = PLUGIN_VERSION,
3838
.help = "disable\t\t\tdo not activate plugin\n"
3939
"performance-mode\tenable cacheline-aware layout randomization\n"
4040
};

scripts/gcc-plugins/sancov_plugin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ __visible int plugin_is_GPL_compatible;
2626
tree sancov_fndecl;
2727

2828
static struct plugin_info sancov_plugin_info = {
29-
.version = UTS_RELEASE,
29+
.version = PLUGIN_VERSION,
3030
.help = "sancov plugin\n",
3131
};
3232

scripts/gcc-plugins/stackleak_plugin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static bool verbose = false;
4444
static GTY(()) tree track_function_decl;
4545

4646
static struct plugin_info stackleak_plugin_info = {
47-
.version = UTS_RELEASE,
47+
.version = PLUGIN_VERSION,
4848
.help = "track-min-size=nn\ttrack stack for functions with a stack frame size >= nn bytes\n"
4949
"arch=target_arch\tspecify target build arch\n"
5050
"disable\t\tdo not activate the plugin\n"

scripts/gcc-plugins/structleak_plugin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
__visible int plugin_is_GPL_compatible;
3838

3939
static struct plugin_info structleak_plugin_info = {
40-
.version = UTS_RELEASE,
40+
.version = PLUGIN_VERSION,
4141
.help = "disable\tdo not activate plugin\n"
4242
"byref\tinit structs passed by reference\n"
4343
"byref-all\tinit anything passed by reference\n"

0 commit comments

Comments
 (0)