--- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -224,6 +224,11 @@ cmd_modversions_c = \ endif ifdef CONFIG_FTRACE_MCOUNT_RECORD +# gcc 5 supports generating the mcount tables directly +ifneq ($(call cc-option,-mrecord-mcount,y),y) +KBUILD_CFLAGS += -mrecord-mcount +else +# else do it all manually ifdef BUILD_C_RECORDMCOUNT ifeq ("$(origin RECORDMCOUNT_WARN)", "command line") RECORDMCOUNT_FLAGS = -w @@ -274,6 +279,7 @@ endif ifdef CONFIG_RETPOLINE objtool_args += --retpoline endif +endif ifdef CONFIG_MODVERSIONS