mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 02:20:48 +00:00
Add CONFIG_LTO to use GCC Link-Time Optimizations to try to reduce the flash footprint of the firmware. Add additional protection to some functions/data to avoid removal by the linker when their usage is not obvious. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=make buildall (with and without LTO enable on all boards) Change-Id: I586b8c1eda4592b416c85383b65153c1d5ab0059 Reviewed-on: https://chromium-review.googlesource.com/271291 Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
25 lines
678 B
Makefile
25 lines
678 B
Makefile
# -*- makefile -*-
|
|
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
#
|
|
# Cortex-M0 core OS files build
|
|
#
|
|
|
|
# Select ARMv6-m compatible bare-metal toolchain
|
|
CROSS_COMPILE?=arm-none-eabi-
|
|
|
|
# CPU specific compilation flags
|
|
CFLAGS_CPU+=-mthumb -Os -mno-sched-prolog
|
|
CFLAGS_CPU+=-mno-unaligned-access
|
|
|
|
ifneq ($(CONFIG_LTO),)
|
|
CFLAGS_CPU+=-flto
|
|
LDFLAGS_EXTRA+=-flto
|
|
endif
|
|
|
|
core-y=cpu.o init.o thumb_case.o div.o lmul.o ldivmod.o uldivmod.o
|
|
core-$(CONFIG_COMMON_PANIC_OUTPUT)+=panic.o
|
|
core-$(CONFIG_COMMON_RUNTIME)+=switch.o task.o
|
|
core-$(CONFIG_WATCHDOG)+=watchdog.o
|