Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ damage your configuration (see
toolchains. If you are using the older OABI toolchain the prefix for
the tools will be `arm-nuttx-elf-`; for the EABI toolchain the prefix will
be `arm-nuttx-eabi-`. If you are using the older OABI toolchain with
an ARM Cortex-M3/4, you will need to set CONFIG_ARMV7M_OABI_TOOLCHAIN
an ARM Cortex-M3/4, you will need to set CONFIG_ARM_TOOLCHAIN_BUILDROOT_OABI
in the `.config` file in order to pick the right tool prefix.

If the make system ever picks the wrong prefix for your toolchain, you
Expand Down
38 changes: 38 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,44 @@
if ARCH_ARM
comment "ARM Options"

choice
prompt "Toolchain Selection"
default ARM_TOOLCHAIN_GNU_EABI

config ARM_TOOLCHAIN_IAR
bool "IAR ANSI C/C++ toolchain"
select CYGWIN_WINTOOL if WINDOWS_CYGWIN

config ARM_TOOLCHAIN_BUILDROOT
bool "Buildroot (Cygwin or Linux)"
depends on !WINDOWS_NATIVE
select ARCH_TOOLCHAIN_GNU

config ARM_TOOLCHAIN_BUILDROOT_OABI
bool "OABI (vs EABI)"
depends on !WINDOWS_NATIVE
select ARCH_TOOLCHAIN_GNU
---help---
Most of the older buildroot toolchains are OABI

config ARM_TOOLCHAIN_GNU_EABI
bool "Generic GNU EABI toolchain"
select ARCH_TOOLCHAIN_GNU
---help---
This option should work for any modern GNU toolchain (GCC 4.5 or newer)

config ARM_TOOLCHAIN_GNU_OABI
bool "Generic GNU OABI toolchain"
select ARCH_TOOLCHAIN_GNU
---help---
This option should work for any GNU toolchain.

config ARM_TOOLCHAIN_CLANG
bool "Generic Clang toolchain"
select ARCH_TOOLCHAIN_CLANG

endchoice

choice
prompt "ARM MCU selection"
default ARCH_CHIP_STM32
Expand Down
28 changes: 0 additions & 28 deletions arch/arm/src/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,3 @@
#

comment "ARM Configuration Options"

choice
prompt "Toolchain Selection"
default ARM_TOOLCHAIN_GNU_EABI

config ARM_TOOLCHAIN_BUILDROOT
bool "Buildroot (Cygwin or Linux)"
depends on !WINDOWS_NATIVE

config ARM_TOOLCHAIN_GNU_EABI
bool "Generic GNU EABI toolchain"
---help---
This option should work for any modern GNU toolchain (GCC 4.5 or newer)
configured for arm-none-eabi-.

config ARM_TOOLCHAIN_GNU_OABI
bool "Generic GNU OABI toolchain"
---help---
This option should work for any GNU toolchain configured for arm-elf-.

endchoice

config ARM_OABI_TOOLCHAIN
bool "OABI (vs EABI)"
default n
depends on ARM_TOOLCHAIN_BUILDROOT
---help---
Most of the older buildroot toolchains are OABI and are named arm-nuttx-elf- vs. arm-nuttx-eabi-
165 changes: 2 additions & 163 deletions arch/arm/src/arm/Toolchain.defs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################
# arch/arm/src/armv/Toolchain.defs
# arch/arm/src/arm/Toolchain.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -18,165 +18,4 @@
#
############################################################################

# Setup for the selected toolchain

#
# Handle old-style chip-specific toolchain names in the absence of
# a new-style toolchain specification, force the selection of a single
# toolchain and allow the selected toolchain to be overridden by a
# command-line selection.
#

ifeq ($(filter y, \
$(CONFIG_ARM_TOOLCHAIN_BUILDROOT) \
),y)
CONFIG_ARM_TOOLCHAIN ?= BUILDROOT
endif

ifeq ($(filter y, \
$(CONFIG_ARM_TOOLCHAIN_GNU_EABI) \
),y)
CONFIG_ARM_TOOLCHAIN ?= GNU_EABI
endif

#
# Supported toolchains
#
# TODO - It's likely that all of these toolchains now support the
# CortexM4. Since they are all GCC-based, we could almost
# certainly simplify this further.
#
# Each toolchain definition should set:
#
# CROSSDEV The GNU toolchain triple (command prefix)
# ARCHCPUFLAGS CPU-specific flags selecting the instruction set
# FPU options, etc.
# ARCHOPTIMIZATION The optimization level that results in
# reliable code generation.
#

ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
ARCHOPTIMIZATION += $(CONFIG_DEBUG_OPTLEVEL)
else ifeq ($(CONFIG_DEBUG_FULLOPT),y)
ARCHOPTIMIZATION += -Os
endif

ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += -fno-strict-aliasing
endif

ifeq ($(CONFIG_FRAME_POINTER),y)
ARCHOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
ARCHOPTIMIZATION += -fomit-frame-pointer
endif

ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif

ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

ifeq ($(CONFIG_MM_KASAN_ALL),y)
ARCHOPTIMIZATION += -fsanitize=kernel-address
endif

ifeq ($(CONFIG_MM_UBSAN_ALL),y)
ARCHOPTIMIZATION += $(CONFIG_MM_UBSAN_OPTION)
endif

ifeq ($(CONFIG_MM_UBSAN_TRAP_ON_ERROR),y)
ARCHOPTIMIZATION += -fsanitize-undefined-trap-on-error
endif

# NuttX buildroot under Linux or Cygwin

ifeq ($(CONFIG_ARM_TOOLCHAIN),BUILDROOT)
ifeq ($(CONFIG_ARM_OABI_TOOLCHAIN),y)
CROSSDEV ?= arm-nuttx-elf-
else
CROSSDEV ?= arm-nuttx-eabi-
endif
endif

# Generic GNU EABI toolchain

ifeq ($(CONFIG_ARM_TOOLCHAIN),GNU_EABI)
CROSSDEV ?= arm-none-eabi-
endif

ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -nostdinc++

ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHCXXFLAGS += -Wall -Wshadow -Wundef

ifneq ($(CONFIG_CXX_EXCEPTION),y)
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
endif

ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti
endif

LDFLAGS += -nostdlib

# Optimization of unused sections

ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
ARCHOPTIMIZATION += -ffunction-sections -fdata-sections
endif

# Debug link map

ifeq ($(CONFIG_DEBUG_LINK_MAP),y)
LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map)
endif

ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION += -g
endif

# Default toolchain

CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E -P -x c
STRIP = $(CROSSDEV)strip --strip-unneeded
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
NM = $(CROSSDEV)nm

# Link Time Optimization

ifeq ($(CONFIG_LTO_FULL),y)
ARCHOPTIMIZATION += -flto
ifeq ($(CONFIG_ARM_TOOLCHAIN),GNU_EABI)
LD := $(CROSSDEV)gcc
AR := $(CROSSDEV)gcc-ar rcs
NM := $(CROSSDEV)gcc-nm
ARCHOPTIMIZATION += -fuse-linker-plugin
ARCHOPTIMIZATION += -fno-builtin
endif
endif

# Add the builtin library

EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name))

ifneq ($(CONFIG_LIBM),y)
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a))
endif

ifeq ($(CONFIG_LIBSUPCXX),y)
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a))
endif

ifeq ($(CONFIG_ARCH_COVERAGE),y)
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name=libgcov.a))
endif
include $(TOPDIR)/arch/arm/src/common/Toolchain.defs
21 changes: 0 additions & 21 deletions arch/arm/src/armv6-m/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,3 @@
#

comment "ARMv6-M Configuration Options"

choice
prompt "Toolchain Selection"
default ARMV6M_TOOLCHAIN_GNU_EABI

config ARMV6M_TOOLCHAIN_BUILDROOT
bool "Buildroot (Cygwin or Linux)"
select ARCH_TOOLCHAIN_GNU

config ARMV6M_TOOLCHAIN_GNU_EABI
bool "Generic GNU EABI toolchain"
select ARCH_TOOLCHAIN_GNU
---help---
This option should work for any modern GNU toolchain (GCC 4.5 or newer)
configured for arm-none-eabi.

config ARMV6M_TOOLCHAIN_CLANG
bool "Generic Clang toolchain"
select ARCH_TOOLCHAIN_CLANG

endchoice
Loading