Skip to contentSkip to conversation

MIPS: Makefile: Replace -pg with CC_FLAGS_FTRACE

PATCH Superseded zhaoxiao 2 participants 2 messages Apr 19, 2021 MIPS

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

zhaoxiao

author
#0 lore raw

PATCH v2 1/1 MIPS: Makefile: Replace -pg with CC_FLAGS_FTRACE

In preparation for mips supporting ftrace built on other compiler options, let's have the mips Makefiles remove the $(CC_FLAGS_FTRACE) flags, whatever these may be, rather than assuming '-pg'.

---
v2:add this same change be appropriate to all of the below Makefile.

 arch/mips/boot/compressed/Makefile | 2 +-
 arch/mips/kernel/Makefile          | 8 ++++----
 arch/mips/vdso/Makefile            | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
arch/mips/boot/compressed/Makefile +1 -1
index f93f72bcba97..e4b7839293e1 100644
@@ -18,7 +18,7 @@ include $(srctree)/arch/mips/Kbuild.platforms
 BOOT_HEAP_SIZE := 0x400000
 
 # Disable Function Tracer
-KBUILD_CFLAGS := $(filter-out -pg, $(KBUILD_CFLAGS))
+KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE), $(KBUILD_CFLAGS))
 
 KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS))
 
arch/mips/kernel/Makefile +4 -4
index b4a57f1de772..814b3da30501 100644
@@ -17,10 +17,10 @@ obj-y		+= cpu-probe.o
 endif
 
 ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_ftrace.o = -pg
-CFLAGS_REMOVE_early_printk.o = -pg
-CFLAGS_REMOVE_perf_event.o = -pg
-CFLAGS_REMOVE_perf_event_mipsxx.o = -pg
+CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_early_printk.o =  $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_perf_event.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_perf_event_mipsxx.o = $(CC_FLAGS_FTRACE)
 endif
 
 obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm1480.o
arch/mips/vdso/Makefile +2 -2
index 2131d3fd7333..1b2ea34c3d3b 100644
@@ -46,7 +46,7 @@ CFLAGS_vgettimeofday-o32.o = -include $(srctree)/$(src)/config-n32-o32-env.c -in
 CFLAGS_vgettimeofday-n32.o = -include $(srctree)/$(src)/config-n32-o32-env.c -include $(c-gettimeofday-y)
 endif
 
-CFLAGS_REMOVE_vgettimeofday.o = -pg
+CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
 
 ifdef CONFIG_MIPS_DISABLE_VDSO
   ifndef CONFIG_MIPS_LD_CAN_LINK_VDSO
@@ -60,7 +60,7 @@ ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
 	$(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared \
 	-G 0 --eh-frame-hdr --hash-style=sysv --build-id=sha1 -T
 
-CFLAGS_REMOVE_vdso.o = -pg
+CFLAGS_REMOVE_vdso.o = $(CC_FLAGS_FTRACE)
 
 GCOV_PROFILE := n
 UBSAN_SANITIZE := n
Signature · 1 line
2.20.1
#1 lore raw

Hello!

Quoted 3 lines · zhaoxiao

In preparation for mips supporting ftrace built on other compiler options, let's have the mips Makefiles remove the $(CC_FLAGS_FTRACE) flags, whatever these may be, rather than assuming '-pg'.

But your patch is adding 'em, not removing?

Quoted 54 lines

---
v2:add this same change be appropriate to all of the below Makefile.

  arch/mips/boot/compressed/Makefile | 2 +-
  arch/mips/kernel/Makefile          | 8 ++++----
  arch/mips/vdso/Makefile            | 4 ++--
  3 files changed, 7 insertions(+), 7 deletions(-)
arch/mips/boot/compressed/Makefile +1 -1
index f93f72bcba97..e4b7839293e1 100644
@@ -18,7 +18,7 @@ include $(srctree)/arch/mips/Kbuild.platforms
  BOOT_HEAP_SIZE := 0x400000
 
  # Disable Function Tracer
-KBUILD_CFLAGS := $(filter-out -pg, $(KBUILD_CFLAGS))
+KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE), $(KBUILD_CFLAGS))
 
  KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS))
 
arch/mips/kernel/Makefile +4 -4
index b4a57f1de772..814b3da30501 100644
@@ -17,10 +17,10 @@ obj-y		+= cpu-probe.o
  endif
 
  ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_ftrace.o = -pg
-CFLAGS_REMOVE_early_printk.o = -pg
-CFLAGS_REMOVE_perf_event.o = -pg
-CFLAGS_REMOVE_perf_event_mipsxx.o = -pg
+CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_early_printk.o =  $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_perf_event.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_perf_event_mipsxx.o = $(CC_FLAGS_FTRACE)
  endif
 
  obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm1480.o
arch/mips/vdso/Makefile +1 -1
index 2131d3fd7333..1b2ea34c3d3b 100644
@@ -46,7 +46,7 @@ CFLAGS_vgettimeofday-o32.o = -include $(srctree)/$(src)/config-n32-o32-env.c -in
  CFLAGS_vgettimeofday-n32.o = -include $(srctree)/$(src)/config-n32-o32-env.c -include $(c-gettimeofday-y)
  endif
 
-CFLAGS_REMOVE_vgettimeofday.o = -pg
+CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
 
  ifdef CONFIG_MIPS_DISABLE_VDSO
    ifndef CONFIG_MIPS_LD_CAN_LINK_VDSO

arch/mips/vdso/Makefile ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ · line 66

Quoted 8 lines
arch/mips/vdso/Makefile +1 -1
@@ -60,7 +60,7 @@ ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
  	$(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared \
  	-G 0 --eh-frame-hdr --hash-style=sysv --build-id=sha1 -T
 
-CFLAGS_REMOVE_vdso.o = -pg
+CFLAGS_REMOVE_vdso.o = $(CC_FLAGS_FTRACE)
 
  GCOV_PROFILE := n
  UBSAN_SANITIZE := n

MBR, Sergei