Add gprof test code

This commit is contained in:
Takumi Sueda
2026-04-13 13:32:09 +09:00
parent a17bbf6b14
commit d48949419e
5 changed files with 77 additions and 0 deletions

17
gprof/Makefile Normal file
View File

@@ -0,0 +1,17 @@
export CFLAGS = -pg # Use gprof
export CFLAGS += -static # Static link
export CFLAGS += -O0 # Heavy optimization
export CFLAGS += -Wl,--defsym,_mcount=mcount # Link _mcount to mcount
export CFLAGS += -mapcs-frame # Use standard calling convention
#export CFLAGS += -fno-omit-frame-pointer # Don't omit fp (might not necessary to enable this)
AppMain.exe:
@arm-mingw32ce-gcc -o AppMain $(CFLAGS) profile.c
AppMain.mitigated.s:
@arm-mingw32ce-gcc -O0 -S -fno-omit-frame-pointer -mapcs-frame profile.c
@mv profile.s AppMain.mitigated.s
.PHONY:
clean:
@rm -f AppMain.exe AppMain*.s