Same templated class used imported and exported in the same compilation unit breaks the build |
||||
Issue descriptionIf a class A is used imported and a class B is defined exported in the same compilation unit, and they have identical templated base classs (for instance Supplement<LocalDOMWindow>, then Visual Studio 2015 will generate code that causes linker errors because of multiple definitions of the templated base class. There are two instances of this in Blink modules if built with Jumbo. 1. WebAudio using core classes with Supplement<LocalDOMWindow> as well as exporting it. 2. Fetch using and exporting blink::PairIterable<class WTF::String,class WTF::String>.
,
Jun 14 2017
Note, this only happens in component builds since other builds don't import and export symbols like this.
,
Jun 14 2017
,
Jun 15 2017
,
Jul 19 2017
This sounds like a bug in our code; we shouldn't have cases where you're getting dllexport and dllimport in things in the same linkable, and normallly I'd expect this to produce at least compiler warnings even in non-jumbo builds.
,
Jul 19 2017
The end classes themselves are properly divided. Pseudo code would be:
base_foo.h
------
template <F> class Base { ... };
core_file.h
--------------
CORE_EXPORT class Core : public Base<int> { ... };
modules_file.h
---------------
MODULES_EXPORT class Module : public Base<int> { ... };
And the linking errors happen in modules.dll for class Base<int>, not for class Core or class Module. It will claim Base<int> is in both core_dll.lib and modules.dll which is kind of true, but since it's a template it should be a weak (if that is the word) symbol in modules.dll and it should not collide. But it does.
|
||||
►
Sign in to add a comment |
||||
Comment 1 by brat...@opera.com
, Jun 14 2017