1613f4b3eSKees Cook# SPDX-License-Identifier: GPL-2.0 2613f4b3eSKees Cook 3613f4b3eSKees Cookrandstruct-cflags-y += -DRANDSTRUCT 4613f4b3eSKees Cook 5613f4b3eSKees Cookifdef CONFIG_GCC_PLUGIN_RANDSTRUCT 6613f4b3eSKees Cookrandstruct-cflags-y \ 7613f4b3eSKees Cook += -fplugin=$(objtree)/scripts/gcc-plugins/randomize_layout_plugin.so 8613f4b3eSKees Cookrandstruct-cflags-$(CONFIG_RANDSTRUCT_PERFORMANCE) \ 9613f4b3eSKees Cook += -fplugin-arg-randomize_layout_plugin-performance-mode 10*035f7f87SKees Cookelse 11*035f7f87SKees Cookrandstruct-cflags-y \ 12*035f7f87SKees Cook += -frandomize-layout-seed-file=$(objtree)/scripts/basic/randstruct.seed 13613f4b3eSKees Cookendif 14613f4b3eSKees Cook 15613f4b3eSKees Cookexport RANDSTRUCT_CFLAGS := $(randstruct-cflags-y) 16613f4b3eSKees Cook 17613f4b3eSKees CookKBUILD_CFLAGS += $(RANDSTRUCT_CFLAGS) 18