0001-Add-Compiler-Flags-and-remove-exe-from-output.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From d535a7032b73eaa1d5128e571323de724e4eef3a Mon Sep 17 00:00:00 2001
  2. From: junyuantan <junyuan.tan@starfivetech.com>
  3. Date: Mon, 16 Aug 2021 17:38:27 +0800
  4. Subject: [PATCH] Add Compiler Flags and remove exe from output
  5. This patch is required for adding compiler flags and change output format
  6. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  7. ---
  8. Makefile | 2 +-
  9. linux64/core_portme.mak | 2 +-
  10. 2 files changed, 2 insertions(+), 2 deletions(-)
  11. diff --git a/Makefile b/Makefile
  12. index 51760d1..b90e0ca 100644
  13. --- a/Makefile
  14. +++ b/Makefile
  15. @@ -60,7 +60,7 @@ CORE_FILES = core_list_join core_main core_matrix core_state core_util
  16. ORIG_SRCS = $(addsuffix .c,$(CORE_FILES))
  17. SRCS = $(ORIG_SRCS) $(PORT_SRCS)
  18. OBJS = $(addprefix $(OPATH),$(addsuffix $(OEXT),$(CORE_FILES)) $(PORT_OBJS))
  19. -OUTNAME = coremark$(EXE)
  20. +OUTNAME = coremark
  21. OUTFILE = $(OPATH)$(OUTNAME)
  22. LOUTCMD = $(OFLAG) $(OUTFILE) $(LFLAGS_END)
  23. OUTCMD = $(OUTFLAG) $(OUTFILE) $(LFLAGS_END)
  24. diff --git a/linux64/core_portme.mak b/linux64/core_portme.mak
  25. index 3276f40..b85bd52 100755
  26. --- a/linux64/core_portme.mak
  27. +++ b/linux64/core_portme.mak
  28. @@ -24,7 +24,7 @@ OUTFLAG= -o
  29. CC = gcc
  30. # Flag: CFLAGS
  31. # Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags"
  32. -PORT_CFLAGS = -O2 -fno-common -funroll-loops -finline-functions --param max-inline-insns-auto=20 -falign-functions=4 -falign-jumps=4 -falign-loops=4 --param inline-min-speedup=10
  33. +PORT_CFLAGS = -mabi=lp64d -O3 -fno-common -funroll-loops -finline-functions -funroll-all-loops -falign-jumps=8 -falign-loops=8 -finline-limit=1000 -falign-functions=8 -ffast-math -fno-tree-loop-distribute-patterns --param fsm-scale-path-stmts=3 -mcmodel=medany -fno-builtin-printf
  34. FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)"
  35. CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\"
  36. #Flag: LFLAGS_END