Remove globally constructed variables

Using global variables that have construction order dependencies on each
other do not guarantee the expected execution order. We had an issue
where the defaultConfigPath is not constructed from the string in
handler.cpp before it was used to construct the Handler impl.

This resolves the issue by removing runtime constructed global variables
entirely.

Change-Id: I868f34782d22d3b2b07be303a05f58b9c9f8c8b8
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/handler.cpp b/handler.cpp
index 028c97b..f9a964d 100644
--- a/handler.cpp
+++ b/handler.cpp
@@ -316,8 +316,5 @@
     return _pcie_i2c_map[entry];
 }
 
-const std::string defaultConfigFile =
-    "/usr/share/ipmi-entity-association/entity_association_map.json";
-
 } // namespace ipmi
 } // namespace google
diff --git a/handler_impl.hpp b/handler_impl.hpp
index 130a4b0..7771da7 100644
--- a/handler_impl.hpp
+++ b/handler_impl.hpp
@@ -14,7 +14,8 @@
 namespace ipmi
 {
 
-extern const std::string defaultConfigFile;
+constexpr char defaultConfigFile[] =
+    "/usr/share/ipmi-entity-association/entity_association_map.json";
 
 class Handler : public HandlerInterface
 {
diff --git a/main.cpp b/main.cpp
index 030f56c..0eb8f0c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -38,12 +38,11 @@
 namespace ipmi
 {
 
-Handler handlerImpl;
-
 void setupGoogleOemSysCommands() __attribute__((constructor));
 
 void setupGoogleOemSysCommands()
 {
+    static Handler handlerImpl;
     oem::Router* oemRouter = oem::mutableRouter();
 
     std::fprintf(stderr,