2015-12-14 08:40:38 -06:00
|
|
|
############################################################################
|
|
|
|
# arch/arm/src/armv7-r/Toolchain.defs
|
|
|
|
#
|
2020-05-13 08:18:31 -06:00
|
|
|
# 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
|
2015-12-14 08:40:38 -06:00
|
|
|
#
|
2020-05-13 08:18:31 -06:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2015-12-14 08:40:38 -06:00
|
|
|
#
|
2020-05-13 08:18:31 -06:00
|
|
|
# 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.
|
2015-12-14 08:40:38 -06:00
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
# Setup for the selected toolchain
|
|
|
|
|
|
|
|
#
|
|
|
|
# Select and allow the selected toolchain to be overridden by a command-line
|
|
|
|
#selection.
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(filter y, \
|
|
|
|
$(CONFIG_ARMV7R_TOOLCHAIN_BUILDROOT) \
|
|
|
|
),y)
|
|
|
|
CONFIG_ARMV7R_TOOLCHAIN ?= BUILDROOT
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(filter y, \
|
|
|
|
$(CONFIG_ARMV7R_TOOLCHAIN_GNU_EABIL) \
|
|
|
|
),y)
|
2020-05-18 22:18:15 +08:00
|
|
|
CONFIG_ARMV7R_TOOLCHAIN ?= GNU_EABI
|
2015-12-14 08:40:38 -06:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(filter y, \
|
|
|
|
$(CONFIG_ARMV7R_TOOLCHAIN_GNU_EABIW) \
|
|
|
|
),y)
|
2020-05-18 22:18:15 +08:00
|
|
|
CONFIG_ARMV7R_TOOLCHAIN ?= GNU_EABI
|
2015-12-14 08:40:38 -06:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Supported toolchains
|
|
|
|
#
|
|
|
|
# Each toolchain definition should set:
|
|
|
|
#
|
|
|
|
# CROSSDEV The GNU toolchain triple (command prefix)
|
|
|
|
# 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)
|
2021-04-23 17:57:02 -03:00
|
|
|
else
|
|
|
|
MAXOPTIMIZATION ?= -Os
|
2015-12-14 08:40:38 -06:00
|
|
|
endif
|
|
|
|
|
2015-12-26 18:13:01 -06:00
|
|
|
ifeq ($(CONFIG_ENDIAN_BIG),y)
|
|
|
|
TARGET_ARCH := armeb
|
|
|
|
else
|
|
|
|
TARGET_ARCH := arm
|
|
|
|
endif
|
|
|
|
|
2015-12-14 08:40:38 -06:00
|
|
|
# NuttX buildroot under Linux or Cygwin
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARMV7R_TOOLCHAIN),BUILDROOT)
|
|
|
|
ifeq ($(CONFIG_ARMV7R_OABI_TOOLCHAIN),y)
|
2015-12-26 18:13:01 -06:00
|
|
|
CROSSDEV ?= $(TARGET_ARCH)-nuttx-elf-
|
2015-12-14 08:40:38 -06:00
|
|
|
else
|
2015-12-26 18:13:01 -06:00
|
|
|
CROSSDEV ?= $(TARGET_ARCH)-nuttx-eabi-
|
2015-12-14 08:40:38 -06:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-05-18 22:18:15 +08:00
|
|
|
# Generic GNU EABI toolchain
|
2015-12-14 08:40:38 -06:00
|
|
|
|
2020-05-18 22:18:15 +08:00
|
|
|
ifeq ($(CONFIG_ARMV7R_TOOLCHAIN),GNU_EABI)
|
2015-12-26 18:13:01 -06:00
|
|
|
CROSSDEV ?= $(TARGET_ARCH)-none-eabi-
|
2015-12-14 08:40:38 -06:00
|
|
|
endif
|
2020-07-15 20:51:26 +08:00
|
|
|
|
2020-07-01 18:08:10 +08:00
|
|
|
# Default toolchain
|
|
|
|
|
|
|
|
CC = $(CROSSDEV)gcc
|
|
|
|
CXX = $(CROSSDEV)g++
|
|
|
|
CPP = $(CROSSDEV)gcc -E -P -x c
|
2021-06-04 14:57:34 +03:00
|
|
|
LD = $(CROSSDEV)gcc
|
2020-07-01 18:08:10 +08:00
|
|
|
STRIP = $(CROSSDEV)strip --strip-unneeded
|
2021-08-31 16:53:04 +08:00
|
|
|
AR = $(CROSSDEV)gcc-ar rcs
|
|
|
|
NM = $(CROSSDEV)gcc-nm
|
2020-07-01 18:08:10 +08:00
|
|
|
OBJCOPY = $(CROSSDEV)objcopy
|
|
|
|
OBJDUMP = $(CROSSDEV)objdump
|
|
|
|
|
2020-07-15 20:51:26 +08:00
|
|
|
# Add the builtin library
|
|
|
|
|
|
|
|
EXTRA_LIBS += -lgcc
|
2020-08-31 12:35:21 -06:00
|
|
|
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name`"}"
|
2020-07-15 20:51:26 +08:00
|
|
|
|
|
|
|
ifneq ($(CONFIG_LIBM),y)
|
|
|
|
EXTRA_LIBS += -lm
|
2020-08-31 12:35:21 -06:00
|
|
|
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libm.a`"}"
|
2020-07-15 20:51:26 +08:00
|
|
|
endif
|
|
|
|
|
2021-08-28 00:13:21 +08:00
|
|
|
ifeq ($(CONFIG_LIBSUPCXX),y)
|
2020-07-15 20:51:26 +08:00
|
|
|
EXTRA_LIBS += -lsupc++
|
2020-08-31 12:35:21 -06:00
|
|
|
EXTRA_LIBPATHS += -L "${shell dirname "`$(CC) $(ARCHCPUFLAGS) --print-file-name=libsupc++.a`"}"
|
2020-07-15 20:51:26 +08:00
|
|
|
endif
|