randstruct: Split randstruct Makefile and CFLAGS
[platform/kernel/linux-starfive.git] / scripts / Makefile.randstruct
1 # SPDX-License-Identifier: GPL-2.0
2
3 randstruct-cflags-y += -DRANDSTRUCT
4
5 ifdef CONFIG_GCC_PLUGIN_RANDSTRUCT
6 randstruct-cflags-y     \
7         += -fplugin=$(objtree)/scripts/gcc-plugins/randomize_layout_plugin.so
8 randstruct-cflags-$(CONFIG_RANDSTRUCT_PERFORMANCE)              \
9         += -fplugin-arg-randomize_layout_plugin-performance-mode
10 endif
11
12 export RANDSTRUCT_CFLAGS := $(randstruct-cflags-y)
13
14 KBUILD_CFLAGS   += $(RANDSTRUCT_CFLAGS)