diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-09-24 18:16:35 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-27 17:40:58 +0000 |
commit | fe015a6df72349c3cf654ea3eb80b46e52b10e1e (patch) | |
tree | cba5bd3ce8931fc9b0e2e7670caeabd01a0bd7b2 /Makefile.toolchain | |
parent | a721dce648ced6c460c619f7ff556491aa5ed88a (diff) | |
download | chrome-ec-fe015a6df72349c3cf654ea3eb80b46e52b10e1e.tar.gz |
core: Add forward declaration for IRQ handler routine
clang warns when attribute declarations do not precede definitions:
error: attribute declaration must precede
definition [-Werror,-Wignored-attributes]
The cortex-m/irq_handler.h file uses the "__keep" attribute on
"routine". The declaration with the attribute must come before the
definition or the compiler will ignore it. This results in link errors
when using LTO with lld since it is optimized out. In order to fix this,
the DECLARE_IRQ instances must be moved before the function definitions.
However, if DECLARE_IRQ instances are moved without this change, we will
get an implicit declaration compiler error:
error: implicit declaration of function 'uart_interrupt'
This change does not change the resulting output as verified by the
"compare_builds.sh" script.
BRANCH=none
BUG=b:172020503
TEST=./util/compare_builds.sh -b all -j 70
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Icb282cb0f0a0557d6bc1d184378c5923d0e3a72d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3182634
Reviewed-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'Makefile.toolchain')
0 files changed, 0 insertions, 0 deletions