012-extra_optimization.patch 592 B

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