X86: Makefile: Replace -pg with CC_FLAGS_FTRACE
PATCH 1/1 X86: Makefile: Replace -pg with CC_FLAGS_FTRACE
In preparation for x86 supporting ftrace built on other compiler options, let's have the x86 Makefiles remove the $(CC_FLAGS_FTRACE) flags, whatever these may be, rather than assuming '-pg'.
There should be no functional change as a result of this patch.
--- arch/x86/kernel/Makefile | 16 ++++++++-------- arch/x86/lib/Makefile | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)
arch/x86/kernel/Makefile +8 -8
@@ -13,14 +13,14 @@ CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) ifdef CONFIG_FUNCTION_TRACER # Do not profile debug and lowlevel utilities -CFLAGS_REMOVE_tsc.o = -pg -CFLAGS_REMOVE_paravirt-spinlocks.o = -pg -CFLAGS_REMOVE_pvclock.o = -pg -CFLAGS_REMOVE_kvmclock.o = -pg -CFLAGS_REMOVE_ftrace.o = -pg -CFLAGS_REMOVE_early_printk.o = -pg -CFLAGS_REMOVE_head64.o = -pg -CFLAGS_REMOVE_sev-es.o = -pg +CFLAGS_REMOVE_tsc.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_paravirt-spinlocks.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_pvclock.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_kvmclock.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_early_printk.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_head64.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_sev-es.o = $(CC_FLAGS_FTRACE) endif KASAN_SANITIZE_head$(BITS).o := n
arch/x86/lib/Makefile +1 -1
@@ -21,7 +21,7 @@ KASAN_SANITIZE_cmdline.o := n KCSAN_SANITIZE_cmdline.o := n ifdef CONFIG_FUNCTION_TRACER -CFLAGS_REMOVE_cmdline.o = -pg +CFLAGS_REMOVE_cmdline.o = $(CC_FLAGS_FTRACE) endif CFLAGS_cmdline.o := -fno-stack-protector -fno-jump-tables
Signature · 1 line
2.20.1
Quoted 11 lines · zhaoxiao
In preparation for x86 supporting ftrace built on other compiler options, let's have the x86 Makefiles remove the $(CC_FLAGS_FTRACE) flags, whatever these may be, rather than assuming '-pg'.
There should be no functional change as a result of this patch.
Signed-off-by zhaoxiao <[email protected]>--- arch/x86/kernel/Makefile | 16 ++++++++-------- arch/x86/lib/Makefile | 2 +-
I see additional CFLAGS_REMOVE_* = -pg in
- arch/x86/mm/Makefile
- arch/x86/kernel/cpu/Makefile
- arch/x86/entry/vdso/Makefile
- arch/x86/um/vdso/Makefile
- arch/x86/xen/Makefile
Would this same change be appropriate to all of the above? Seeing the additional possible values of CC_FLAGS_FTRACE (-mrecord-mcount, -mnop-mcount, -mfentry) makes we wonder if those are currently broken for these files as they are not removed, or if only -pg is problematic?
Thank you for the patch.
Quoted 47 lines
2 files changed, 9 insertions(+), 9 deletions(-)arch/x86/kernel/Makefile +8
-8@@ -13,14 +13,14 @@ CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) ifdef CONFIG_FUNCTION_TRACER # Do not profile debug and lowlevel utilities -CFLAGS_REMOVE_tsc.o = -pg -CFLAGS_REMOVE_paravirt-spinlocks.o = -pg -CFLAGS_REMOVE_pvclock.o = -pg -CFLAGS_REMOVE_kvmclock.o = -pg -CFLAGS_REMOVE_ftrace.o = -pg -CFLAGS_REMOVE_early_printk.o = -pg -CFLAGS_REMOVE_head64.o = -pg -CFLAGS_REMOVE_sev-es.o = -pg +CFLAGS_REMOVE_tsc.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_paravirt-spinlocks.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_pvclock.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_kvmclock.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_early_printk.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_head64.o = $(CC_FLAGS_FTRACE) +CFLAGS_REMOVE_sev-es.o = $(CC_FLAGS_FTRACE) endif KASAN_SANITIZE_head$(BITS).o := narch/x86/lib/Makefile +1
-2@@ -21,7 +21,7 @@ KASAN_SANITIZE_cmdline.o := n KCSAN_SANITIZE_cmdline.o := n ifdef CONFIG_FUNCTION_TRACER -CFLAGS_REMOVE_cmdline.o = -pg +CFLAGS_REMOVE_cmdline.o = $(CC_FLAGS_FTRACE) endif CFLAGS_cmdline.o := -fno-stack-protector -fno-jump-tables --2.20.1
Signature · 2 lines
Thanks, ~Nick Desaulniers