summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-05-07 11:32:30 -0500
committerAaron Durbin <adurbin@chromium.org>2015-05-07 19:52:50 +0200
commit7aafe5303b7cdbf4285b32e987d4f71b5615108f (patch)
treef231bcbe1ae6ae3ed5811370ed76679788bee34f /src/lib
parent1d7b9de3504e90f0886fccec3a1f8a783fd4cc58 (diff)
timestamp: fix incremental linking error for !HAVE_MONOTONIC_TIMER
In linking ramstage a single object file is created before linking with the linker script. Though there is a weak timestamp_get() symbol in timestamp.c any of its dependent symbols need to be available during the incremental link. As not all platforms have HAVE_MONOTONIC_TIMER enabled this will create a linking error. Fix this by providing a hint to the compiler to remove dead code and thus the dependent symbols causing linking errors in the presence of !HAVE_MONOTONIC_TIMER. Change-Id: Ib8a5dca2c12c2edac7605f403ed91b793823c8a3 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/10138 Tested-by: build bot (Jenkins) Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/timestamp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 0c9c884942..4b5f4d4b06 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -180,6 +180,9 @@ uint64_t __attribute__((weak)) timestamp_get(void)
{
struct mono_time t1, t2;
+ if (!IS_ENABLED(CONFIG_HAVE_MONOTONIC_TIMER))
+ return 0;
+
mono_time_set_usecs(&t1, 0);
timer_monotonic_get(&t2);