diff --git a/riscv/extension.cc b/riscv/extension.cc index 34d3f4f0..b758eef6 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 53b62a17..d6ee6f18 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; +}