aboutsummaryrefslogtreecommitdiff
path: root/include/lib/bakery_lock.h
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2016-04-11 13:17:50 +0100
committerSandrine Bailleux <sandrine.bailleux@arm.com>2016-04-14 16:24:03 +0100
commit10c252c14b7f446c0b49ef1aafbd5d37804577dd (patch)
tree5c3790bfeedbfdefbfdd5757fb62d026a93f64bf /include/lib/bakery_lock.h
parent403973c95daa62b8411f789a8a93ef9e18b7f980 (diff)
downloadarm-trusted-firmware-10c252c14b7f446c0b49ef1aafbd5d37804577dd.tar.gz
Fix build error with optimizations disabled (-O0)
If Trusted Firmware is built with optimizations disabled (-O0), the linker throws the following error: undefined reference to 'xxx' Where 'xxx' is a raw inline function defined in a header file. The reason is that, with optimizations disabled, GCC may decide to skip the inlining. If that is the case, an external definition to the compilation unit must be provided. Because no external definition is present, the linker throws the error. This patch fixes the problem by declaring the following inline functions static, so the internal definition is used: - cm_set_next_context() - bakery_lock_init() Note that building the TF with optimizations disabled when Trusted Board Boot is enabled is currently unsupported, as this makes the BL2 image too big to fit in memory without any adjustment of its base address. Similarly, disabling optimizations for debug builds on FVP is unsupported at the moment. Change-Id: I284a9f84cc8df96a0c1a52dfe05c9e8544c0cefe
Diffstat (limited to 'include/lib/bakery_lock.h')
-rw-r--r--include/lib/bakery_lock.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/lib/bakery_lock.h b/include/lib/bakery_lock.h
index 8a5389174..6b8157e66 100644
--- a/include/lib/bakery_lock.h
+++ b/include/lib/bakery_lock.h
@@ -96,7 +96,7 @@ typedef bakery_info_t bakery_lock_t;
#endif /* __USE_COHERENT_MEM__ */
-inline void bakery_lock_init(bakery_lock_t *bakery) {}
+static inline void bakery_lock_init(bakery_lock_t *bakery) {}
void bakery_lock_get(bakery_lock_t *bakery);
void bakery_lock_release(bakery_lock_t *bakery);