2
0

201-extra_optimization.patch 675 B

123456789101112131415161718192021222324
  1. --- a/Makefile
  2. +++ b/Makefile
  3. @@ -538,9 +538,9 @@ endif # $(dot-config)
  4. all: vmlinux
  5. ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
  6. -KBUILD_CFLAGS += -Os
  7. +KBUILD_CFLAGS += -Os -fno-caller-saves
  8. else
  9. -KBUILD_CFLAGS += -O2
  10. +KBUILD_CFLAGS += -O2 -fno-reorder-blocks -fno-tree-ch -fno-caller-saves
  11. endif
  12. include $(srctree)/arch/$(SRCARCH)/Makefile
  13. @@ -595,6 +595,9 @@ endif
  14. NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
  15. CHECKFLAGS += $(NOSTDINC_FLAGS)
  16. +# improve gcc optimization
  17. +CFLAGS += $(call cc-option,-funit-at-a-time,)
  18. +
  19. # warn about C99 declaration after statement
  20. KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)