New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 733193 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 713137



Sign in to add a comment

Same templated class used imported and exported in the same compilation unit breaks the build

Project Member Reported by brat...@opera.com, Jun 14 2017

Issue description

If 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>.

 

Comment 1 by brat...@opera.com, Jun 14 2017

Blocking: 713137

Comment 2 by brat...@opera.com, Jun 14 2017

Note, this only happens in component builds since other builds don't import and export symbols like this.

Comment 3 by brat...@opera.com, Jun 14 2017

Status: Unconfirmed (was: Untriaged)
Status: Assigned (was: Unconfirmed)
Cc: dpranke@chromium.org
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.

Comment 6 by brat...@opera.com, 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