Skip to content

Commit

Permalink
Revert "Kconfig: allow CC_OPTIMIZE_FOR_PERFORMANCE_O3 on all arches"
Browse files Browse the repository at this point in the history
This reverts commit 19f6835.

	modified:   arch/arc/Makefile
	modified:   init/Kconfig
  • Loading branch information
ravindu644 committed Mar 5, 2024
1 parent 1b99b46 commit be9eaf0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 8 additions & 0 deletions arch/arc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ endif
cfi := $(call as-instr,.cfi_startproc\n.cfi_endproc,-DARC_DW2_UNWIND_AS_CFI)
cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables $(cfi)

ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
# Generic build system uses -O2, we want -O3
# Note: No need to add to cflags-y as that happens anyways
#
# Disable the false maybe-uninitialized warings gcc spits out at -O3
ARCH_CFLAGS += -O3 $(call cc-disable-warning,maybe-uninitialized,)
endif

# small data is default for elf32 tool-chain. If not usable, disable it
# This also allows repurposing GP as scratch reg to gcc reg allocator
disable_small_data := y
Expand Down
10 changes: 2 additions & 8 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1154,20 +1154,14 @@ choice
default CC_OPTIMIZE_FOR_PERFORMANCE

config CC_OPTIMIZE_FOR_PERFORMANCE
bool "Optimize for performance (-O2)"
bool "Optimize for performance"
help
This is the default optimization level for the kernel, building
with the "-O2" compiler flag for best performance and most
helpful compile-time warnings.

config CC_OPTIMIZE_FOR_PERFORMANCE_O3
bool "Optimize more for performance (-O3)"
help
Choosing this option will pass "-O3" to your compiler to optimize
the kernel yet more for performance.

config CC_OPTIMIZE_FOR_SIZE
bool "Optimize for size (-Os)"
bool "Optimize for size"
help
Enabling this option will pass "-Os" instead of "-O2" to
your compiler resulting in a smaller kernel.
Expand Down

0 comments on commit be9eaf0

Please sign in to comment.