Skip to content

clang vs gcc -- let the battle begin. Issue with header-file static singletons #671

@klingaard

Description

@klingaard

In a similar fashion to sparcians/simdb#170, TreeNodeExtensionManager has a couple of static singletons that are causing issues in a clang-built simulator against the gcc-built sparta.

From @bdutro:

$ nm Actions_test| c++filt | grep factories

00000000009c0d80 u guard variable for sparta::TreeNodeExtensionManager::extensionFactories_[abi:cxx11]()::factories
00000000009c4800 b guard variable for sparta::TreeNodeExtensionManager::extensionFactories_[abi:cxx11]()::factories[abi:cxx11]
00000000009c0da0 u sparta::TreeNodeExtensionManager::extensionFactories_[abi:cxx11]()::factories
00000000009c47d0 b sparta::TreeNodeExtensionManager::extensionFactories_[abi:cxx11]()::factories[abi:cxx11]

We have two copies of a singleton because GCC makes it a global unique symbol (which is a GNU extension) and Clang refuses to acknowledge those symbols exist

The fix is to move the singletons to source files.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcomponent: spartaIssue is related to sparta framework

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions