walnux/arch/arm/src/armv7-m/Toolchain.defs
Xiang Xiao bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00

143 lines
4.2 KiB
Text

############################################################################
# arch/arm/src/armv7-m/Toolchain.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
# 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_ARMV7M_TOOLCHAIN_BUILDROOT) \
),y)
CONFIG_ARMV7M_TOOLCHAIN ?= BUILDROOT
endif
ifeq ($(filter y, \
$(CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL) \
),y)
CONFIG_ARMV7M_TOOLCHAIN ?= GNU_EABI
endif
ifeq ($(filter y, \
$(CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW) \
),y)
CONFIG_ARMV7M_TOOLCHAIN ?= GNU_EABI
endif
ifeq ($(filter y, \
$(CONFIG_ARMV7M_TOOLCHAIN_CLANGL) \
),y)
CONFIG_ARMV7M_TOOLCHAIN ?= CLANG
endif
ifeq ($(filter y, \
$(CONFIG_ARMV7M_TOOLCHAIN_CLANGW) \
),y)
CONFIG_ARMV7M_TOOLCHAIN ?= CLANG
endif
#
# Supported toolchains
#
# Each toolchain definition should set:
#
# CROSSDEV The GNU toolchain triple (command prefix)
# ARCROSSDEV If required, an alternative prefix used when
# invoking ar and nm.
# ARCHCPUFLAGS CPU-specific flags selecting the instruction set
# FPU options, etc.
# MAXOPTIMIZATION The maximum optimization level that results in
# reliable code generation.
#
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
endif
# Parametrization for ARCHCPUFLAGS
ifeq ($(CONFIG_ARCH_CORTEXM4),y)
TOOLCHAIN_ARM7EM := y
TOOLCHAIN_MCPU := -mcpu=cortex-m4
TOOLCHAIN_MTUNE := -mtune=cortex-m4
TOOLCHAIN_MARCH := -march=armv7e-m
ifeq ($(CONFIG_ARCH_FPU),y)
TOOLCHAIN_MFLOAT := -mfpu=fpv4-sp-d16 -mfloat-abi=hard
else
TOOLCHAIN_MFLOAT := -mfloat-abi=soft
endif
else ifeq ($(CONFIG_ARCH_CORTEXM7),y)
TOOLCHAIN_ARM7EM := y
TOOLCHAIN_MCPU := -mcpu=cortex-m7
TOOLCHAIN_MTUNE := -mtune=cortex-m7
TOOLCHAIN_MARCH := -march=armv7e-m
ifeq ($(CONFIG_ARCH_FPU),y)
ifeq ($(CONFIG_ARCH_DPFPU),y)
TOOLCHAIN_MFLOAT := -mfpu=fpv5-d16 -mfloat-abi=hard
else
TOOLCHAIN_MFLOAT := -mfpu=fpv5-sp-d16 -mfloat-abi=hard
endif
else
TOOLCHAIN_MFLOAT := -mfloat-abi=soft
endif
else # ifeq ($(CONFIG_ARCH_CORTEXM3),y)
TOOLCHAIN_ARM7EM := n
TOOLCHAIN_MCPU := -mcpu=cortex-m3
TOOLCHAIN_MTUNE := -mtune=cortex-m3
TOOLCHAIN_MARCH := -march=armv7-m
TOOLCHAIN_MFLOAT := -mfloat-abi=soft
endif
# NuttX buildroot under Linux or Cygwin
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),BUILDROOT)
ifeq ($(CONFIG_ARMV7M_OABI_TOOLCHAIN),y)
CROSSDEV ?= arm-nuttx-elf-
ARCROSSDEV ?= arm-nuttx-elf-
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) $(TOOLCHAIN_MFLOAT)
else
CROSSDEV ?= arm-nuttx-eabi-
ARCROSSDEV ?= 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-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION ?= -Os
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
endif
# Clang toolchain
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CLANG)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION ?= -Os
ARCHCPUFLAGS = $(TOOLCHAIN_MCPU) -mthumb $(TOOLCHAIN_MFLOAT)
endif