From: Andrew Waterman Date: Tue, 28 Jan 2014 11:38:28 +0000 (-0800) Subject: Force extension loaders to be linked in X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a9df0230ff3b0eba855d1184079806855b70ede;p=riscv-isa-sim.git Force extension loaders to be linked in --- 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; +}