this is really creepy: the same(!) instance of the singleton factory
sees different addresses of the class static variable, depending on
the compilation unit.
Please note that the type of the concrete factory function is *erased*
when exiting the constructor function of ConfigurableHolder
basically this reproduces the problem in a simplified setup.
Especially note that we're going through a single instance of the factory,
yet still this single instance 'sees' two different locations of the
class static variable
...but still dynamically linking against the core lib
But the actual template instantiations happen now within the two
compilation units, which are linked statically.
When looking into the symbol table, we can see that the static
field is emitted two times
readelf -W target/clang-static-init -s | c++filt |less
Observations:
- the initial observation was that we get two instances of the config rules service
- obviously this it is *not* the initialisation of a static variable accessed from
multiple compilation units. But the access from two compilation units is crucial
- we can exclude the effect of all other initialisation. It *is* in SingletonSubclass
- we can exclude the effect of dynamic linking. Even two translation units
linked statically exhibit the same problem
rebuild this test case in the research area, to be able to verify with various compilers