From 9a9df0230ff3b0eba855d1184079806855b70ede Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 28 Jan 2014 03:38:28 -0800 Subject: [PATCH] Force extension loaders to be linked in --- riscv/extension.cc | 6 ------ spike/extensions.cc | 10 ++++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/riscv/extension.cc b/riscv/extension.cc index 34d3f4f..b758eef 100644 --- a/riscv/extension.cc +++ b/riscv/extension.cc @@ -1,12 +1,6 @@ #include "extension.h" #include "trap.h" -std::map>& extensions() -{ - static std::map> v; - return v; -} - extension_t::~extension_t() { } diff --git a/spike/extensions.cc b/spike/extensions.cc index 53b62a1..d6ee6f1 100644 --- a/spike/extensions.cc +++ b/spike/extensions.cc @@ -1 +1,11 @@ +#include "extension.h" #include "hwacha.h" +#include "dummy-rocc.h" + +// Static constructors want to make use of the extensions map, so we +// access it through a function call to guarantee initialization order. +std::map>& extensions() +{ + static std::map> v; + return v; +} -- 2.30.2