Skip to content

Commit 8530ea3

Browse files
committed
Kbuild: remove structleak gcc plugin
gcc-12 and higher support the -ftrivial-auto-var-init= flag, after gcc-8 is the minimum version, this is half of the supported ones, and the vast majority of the versions that users are actually likely to have, so it seems like a good time to stop having the fallback plugin implementation Older toolchains are still able to build kernels normally without this plugin, but won't be able to use variable initialization.. Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 2555d4c commit 8530ea3

File tree

7 files changed

+3
-370
lines changed

7 files changed

+3
-370
lines changed

drivers/gpu/drm/panel/panel-tpo-td028ttec1.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,7 @@ struct td028ttec1_panel {
8686

8787
#define to_td028ttec1_device(p) container_of(p, struct td028ttec1_panel, panel)
8888

89-
/*
90-
* noinline_for_stack so we don't get multiple copies of tx_buf
91-
* on the stack in case of gcc-plugin-structleak
92-
*/
93-
static int noinline_for_stack
89+
static int
9490
jbt_ret_write_0(struct td028ttec1_panel *lcd, u8 reg, int *err)
9591
{
9692
struct spi_device *spi = lcd->spi;

lib/Kconfig.debug

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,9 +2870,7 @@ config STACKINIT_KUNIT_TEST
28702870
help
28712871
Test if the kernel is zero-initializing stack variables and
28722872
padding. Coverage is controlled by compiler flags,
2873-
CONFIG_INIT_STACK_ALL_PATTERN, CONFIG_INIT_STACK_ALL_ZERO,
2874-
CONFIG_GCC_PLUGIN_STRUCTLEAK, CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF,
2875-
or CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL.
2873+
CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_ALL_ZERO.
28762874

28772875
config FORTIFY_KUNIT_TEST
28782876
tristate "Test fortified str*() and mem*() function internals at runtime" if !KUNIT_ALL_TESTS

lib/tests/stackinit_kunit.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
33
* Test cases for compiler-based stack variable zeroing via
4-
* -ftrivial-auto-var-init={zero,pattern} or CONFIG_GCC_PLUGIN_STRUCTLEAK*.
4+
* -ftrivial-auto-var-init={zero,pattern}.
55
* For example, see:
66
* "Running tests with kunit_tool" at Documentation/dev-tools/kunit/start.rst
77
* ./tools/testing/kunit/kunit.py run stackinit [--raw_output] \
@@ -376,14 +376,6 @@ union test_small_end {
376376
# define USER_PASS XFAIL
377377
# define BYREF_PASS XFAIL
378378
# define STRONG_PASS XFAIL
379-
#elif defined(CONFIG_GCC_PLUGIN_STRUCTLEAK_USER)
380-
# define USER_PASS WANT_SUCCESS
381-
# define BYREF_PASS XFAIL
382-
# define STRONG_PASS XFAIL
383-
#elif defined(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF)
384-
# define USER_PASS WANT_SUCCESS
385-
# define BYREF_PASS WANT_SUCCESS
386-
# define STRONG_PASS XFAIL
387379
#else
388380
# define USER_PASS WANT_SUCCESS
389381
# define BYREF_PASS WANT_SUCCESS

mm/mm_init.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,12 +2668,6 @@ static void __init report_meminit(void)
26682668
stack = "all(pattern)";
26692669
else if (IS_ENABLED(CONFIG_INIT_STACK_ALL_ZERO))
26702670
stack = "all(zero)";
2671-
else if (IS_ENABLED(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL))
2672-
stack = "byref_all(zero)";
2673-
else if (IS_ENABLED(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF))
2674-
stack = "byref(zero)";
2675-
else if (IS_ENABLED(CONFIG_GCC_PLUGIN_STRUCTLEAK_USER))
2676-
stack = "__user(zero)";
26772671
else
26782672
stack = "off";
26792673

scripts/Makefile.gcc-plugins

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,6 @@ ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY
88
endif
99
export DISABLE_LATENT_ENTROPY_PLUGIN
1010

11-
gcc-plugin-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) += structleak_plugin.so
12-
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE) \
13-
+= -fplugin-arg-structleak_plugin-verbose
14-
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \
15-
+= -fplugin-arg-structleak_plugin-byref
16-
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \
17-
+= -fplugin-arg-structleak_plugin-byref-all
18-
ifdef CONFIG_GCC_PLUGIN_STRUCTLEAK
19-
DISABLE_STRUCTLEAK_PLUGIN += -fplugin-arg-structleak_plugin-disable
20-
endif
21-
export DISABLE_STRUCTLEAK_PLUGIN
22-
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \
23-
+= -DSTRUCTLEAK_PLUGIN
24-
2511
gcc-plugin-$(CONFIG_GCC_PLUGIN_STACKLEAK) += stackleak_plugin.so
2612
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK) \
2713
+= -DSTACKLEAK_PLUGIN

scripts/gcc-plugins/structleak_plugin.c

Lines changed: 0 additions & 257 deletions
This file was deleted.

0 commit comments

Comments
 (0)