arch: Uniformize optimization flag setting across architectures

This commit is contained in:
Gustavo Henrique Nihei 2021-04-23 17:57:02 -03:00 committed by Xiang Xiao
parent abf039b744
commit f8a36f10c3
12 changed files with 25 additions and 34 deletions

View File

@ -63,6 +63,8 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
# NuttX buildroot under Linux or Cygwin
@ -73,14 +75,12 @@ ifeq ($(CONFIG_ARM_OABI_TOOLCHAIN),y)
else
CROSSDEV ?= arm-nuttx-eabi-
endif
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU EABI toolchain
ifeq ($(CONFIG_ARM_TOOLCHAIN),GNU_EABI)
CROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION ?= -Os
endif
# Default toolchain

View File

@ -57,6 +57,8 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
# NuttX buildroot under Linux or Cygwin
@ -73,11 +75,6 @@ ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),GNU_EABI)
ARCHCPUFLAGS = -mcpu=cortex-m0 -mthumb -mfloat-abi=soft
endif
# Individual tools may limit the optimizatin level but, by default, the
# optimization level will be set to -Os
MAXOPTIMIZATION ?= -Os
# Default toolchain
CC = $(CROSSDEV)gcc

View File

@ -75,6 +75,8 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
ifeq ($(CONFIG_ENDIAN_BIG),y)
@ -91,14 +93,12 @@ ifeq ($(CONFIG_ARMV7A_OABI_TOOLCHAIN),y)
else
CROSSDEV ?= $(TARGET_ARCH)-nuttx-eabi-
endif
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU EABI toolchain
ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),GNU_EABI)
CROSSDEV ?= $(TARGET_ARCH)-none-eabi-
MAXOPTIMIZATION ?= -Os
endif
# Default toolchain

View File

@ -71,6 +71,8 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
# Parametrization for ARCHCPUFLAGS
@ -117,14 +119,12 @@ else
CROSSDEV ?= arm-nuttx-eabi-
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
endif
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU EABI toolchain
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),GNU_EABI)
CROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION ?= -Os
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
endif
@ -132,7 +132,6 @@ endif
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CLANG)
CROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION ?= -Os
ARCHCPUFLAGS = -target arm-none-eabi $(TOOLCHAIN_MCPU) $(TOOLCHAIN_MFLOAT)
CC = clang
CXX = clang++

View File

@ -57,6 +57,8 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
ifeq ($(CONFIG_ENDIAN_BIG),y)
@ -73,14 +75,12 @@ ifeq ($(CONFIG_ARMV7R_OABI_TOOLCHAIN),y)
else
CROSSDEV ?= $(TARGET_ARCH)-nuttx-eabi-
endif
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU EABI toolchain
ifeq ($(CONFIG_ARMV7R_TOOLCHAIN),GNU_EABI)
CROSSDEV ?= $(TARGET_ARCH)-none-eabi-
MAXOPTIMIZATION ?= -Os
endif
# Default toolchain

View File

@ -71,6 +71,8 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
# Parametrization for ARCHCPUFLAGS
@ -107,14 +109,12 @@ else
CROSSDEV ?= arm-nuttx-eabi-
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
endif
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU EABI toolchain
ifeq ($(CONFIG_ARMV8M_TOOLCHAIN),GNU_EABI)
CROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION ?= -Os
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
endif
@ -122,7 +122,6 @@ endif
ifeq ($(CONFIG_ARMV8M_TOOLCHAIN),CLANG)
CROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION ?= -Os
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
endif

View File

@ -86,13 +86,14 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -O2
endif
# NuttX buildroot GCC toolchain under Linux or Cygwin
ifeq ($(CONFIG_AVR_TOOLCHAIN),BUILDROOT)
CROSSDEV ?= avr-nuttx-elf-
MAXOPTIMIZATION ?= -O2
LDFLAGS += -nostartfiles -nodefaultlibs
endif
@ -100,7 +101,6 @@ endif
ifeq ($(CONFIG_AVR_TOOLCHAIN),CROSSPACK)
CROSSDEV ?= avr-
MAXOPTIMIZATION ?= -O2
LDFLAGS += -nostartfiles -nodefaultlibs
endif
@ -108,13 +108,11 @@ endif
ifeq ($(CONFIG_AVR_TOOLCHAIN),LINUXGCC)
CROSSDEV ?= avr-
MAXOPTIMIZATION ?= -O2
LDFLAGS += -nostartfiles -nodefaultlibs
endif
ifeq ($(CONFIG_AVR_TOOLCHAIN),WINAVR)
CROSSDEV ?= avr-
MAXOPTIMIZATION ?= -O2
LDFLAGS += -nostartfiles -nodefaultlibs
endif

View File

@ -57,20 +57,20 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
# NuttX buildroot under Linux or Cygwin
ifeq ($(CONFIG_LM32_TOOLCHAIN),BUILDROOT)
CROSSDEV ?= lm32-nuttx-elf-
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU toolchain
ifeq ($(CONFIG_LM32_TOOLCHAIN),GNUL)
CROSSDEV ?= lm32-elf-
MAXOPTIMIZATION ?= -Os
endif
# Default toolchain

View File

@ -21,8 +21,10 @@
CROSSDEV = riscv32-unknown-elf-
ARCHCPUFLAGS = -march=rv32i
ifeq ($(CONFIG_DEBUG_SYMBOLS),)
MAXOPTIMIZATION ?= -Os
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
# Default toolchain

View File

@ -49,6 +49,8 @@
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -O2
endif
# Pick correct or1k architecture selection
@ -61,7 +63,6 @@ endif
#ifeq ($(CONFIG_OR1K_TOOLCHAIN),GNU_ELF)
CROSSDEV ?= or1k-elf-
MAXOPTIMIZATION ?= -O2
ARCHCPUFLAGS = -mboard=de0_nano
ARCHPICFLAGS = -fpic -membedded-pic
LDFLAGS += -nostartfiles -nodefaultlibs

View File

@ -49,6 +49,8 @@ endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU RVG toolchain
@ -57,13 +59,6 @@ ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
CROSSDEV ?= riscv64-unknown-elf-
endif
# Individual tools may limit the optimization level but, by default, the
# optimization level will be set to -Os
ifeq ($(CONFIG_DEBUG_SYMBOLS),)
MAXOPTIMIZATION ?= -Os
endif
# Default toolchain
CC = $(CROSSDEV)gcc

View File

@ -36,7 +36,7 @@ ARCHCPUFLAGS =
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
else
MAXOPTIMIZATION := -Os
MAXOPTIMIZATION ?= -Os
endif
# Default toolchain