You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.4 KiB

# Copyright 2020 The Pigweed Authors
#
# Licensed 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
#
# https://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.
import("//build_overrides/pigweed.gni")
# Disable obnoxious ABI warning.
#
# GCC 7.1 adds an over-zealous ABI warning with little useful information
# on how to resolve the issue. The warning you get is:
#
# note: parameter passing for argument of type '...' changed in GCC 7.1
#
# There is no other information, and searching for the error is needed to
# understand what is happening. For upstream Pigweed, we compile from
# source so this is irrelevant; so disable it.
#
# See: https://gcc.gnu.org/gcc-7/changes.html (search for "psabi").
# https://gcc.gnu.org/ml/gcc/2017-05/msg00073.html
config("disable_psabi_warning") {
cflags = [ "-Wno-psabi" ]
}
config("cortex_common") {
asmflags = [
"-mabi=aapcs",
"-mthumb",
]
cflags = asmflags + [
"-specs=nano.specs",
"-specs=nosys.specs",
]
ldflags = cflags + [
"-lnosys",
"-lc",
]
}
config("enable_float_printf") {
cflags = [ "-u_printf_float" ]
ldflags = cflags
}
config("cortex_m0plus") {
cflags = [ "-mcpu=cortex-m0plus" ]
asmflags = cflags
ldflags = cflags
}
config("cortex_m3") {
cflags = [ "-mcpu=cortex-m3" ]
asmflags = cflags
ldflags = cflags
}
config("cortex_m4") {
cflags = [ "-mcpu=cortex-m4" ]
asmflags = cflags
ldflags = cflags
}
config("cortex_m7") {
cflags = [ "-mcpu=cortex-m7" ]
asmflags = cflags
ldflags = cflags
}
config("cortex_software_fpu") {
cflags = [ "-mfloat-abi=soft" ]
asmflags = cflags
ldflags = cflags
}
config("cortex_hardware_fpu") {
cflags = [
"-mfloat-abi=hard",
"-mfpu=fpv4-sp-d16",
]
asmflags = cflags
defines = [ "PW_ARMV7M_ENABLE_FPU=1" ]
ldflags = cflags
}
config("cortex_hardware_fpu_v5") {
cflags = [
"-mfloat-abi=hard",
"-mfpu=fpv5-d16",
]
asmflags = cflags
defines = [ "PW_ARMV7M_ENABLE_FPU=1" ]
ldflags = cflags
}