Implement a workaround for thread_local on aarch64
Some versions of lld break thread_local on aarch64. There's a
minimally-painful workaround for it, so let's apply that.
Change-Id: I706de9e280cc15006e5767ee10d961cb2d99352c
diff --git a/aos/testing/BUILD b/aos/testing/BUILD
index 052cabe..ce67b84 100644
--- a/aos/testing/BUILD
+++ b/aos/testing/BUILD
@@ -24,6 +24,7 @@
visibility = ["//visibility:public"],
deps = [
":googletest",
+ "//aos:thread_local",
"//aos/logging:implementations",
"//aos/mutex",
"@com_google_absl//absl/base",
diff --git a/aos/testing/test_logging.cc b/aos/testing/test_logging.cc
index db6246c..77bc4e9 100644
--- a/aos/testing/test_logging.cc
+++ b/aos/testing/test_logging.cc
@@ -7,8 +7,10 @@
#include "gtest/gtest.h"
#include "absl/base/call_once.h"
+
#include "aos/logging/implementations.h"
#include "aos/mutex/mutex.h"
+#include "aos/thread_local.h"
using ::aos::logging::LogMessage;
@@ -97,12 +99,12 @@
// Thread local storage for mock time. This is thread local because if
// someone spawns a thread and goes to town in parallel with a simulated event
// loop, we want to just print the actual monotonic clock out.
- static thread_local bool mock_time_;
- static thread_local ::aos::monotonic_clock::time_point monotonic_now_;
+ static AOS_THREAD_LOCAL bool mock_time_;
+ static AOS_THREAD_LOCAL ::aos::monotonic_clock::time_point monotonic_now_;
};
-thread_local bool TestLogImplementation::mock_time_ = false;
-thread_local ::aos::monotonic_clock::time_point
+AOS_THREAD_LOCAL bool TestLogImplementation::mock_time_ = false;
+AOS_THREAD_LOCAL ::aos::monotonic_clock::time_point
TestLogImplementation::monotonic_now_ = ::aos::monotonic_clock::min_time;
class MyTestEventListener : public ::testing::EmptyTestEventListener {