New issue
Advanced search Search tips

Issue 679037 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

ClangToTWin(dll) red due to link error in mojo_system_impl.dll

Project Member Reported by r...@chromium.org, Jan 6 2017

Issue description

This looks like some dllexport inconsistencies between MSVC and Clang. First failing build:

https://build.chromium.org/p/chromium.fyi/builders/ClangToTWin%28dll%29/builds/6674

The link error:

[12758/43961] LINK(DLL) mojo_system_impl.dll mojo_system_impl.dll.lib mojo_system_impl.dll.pdb
FAILED: mojo_system_impl.dll mojo_system_impl.dll.lib mojo_system_impl.dll.pdb 
C:/b/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x86 False link.exe /nologo /IMPLIB:./mojo_system_impl.dll.lib /DLL /OUT:./mojo_system_impl.dll /PDB:./mojo_system_impl.dll.pdb @./mojo_system_impl.dll.rsp
named_platform_channel_pair_win.obj : error LNK2019: unresolved external symbol "public: __thiscall mojo::edk::NamedPlatformChannelPair::Options::~Options(void)" (??1Options@NamedPlatformChannelPair@edk@mojo@@QAE@XZ) referenced in function "public: __thiscall mojo::edk::NamedPlatformChannelPair::`default constructor closure'(struct mojo::edk::NamedPlatformChannelPair::Options const &)" (??_FNamedPlatformChannelPair@edk@mojo@@QAE@ABUOptions@012@@Z)

./mojo_system_impl.dll : fatal error LNK1120: 1 unresolved externals

It's uncle[12758/43961] LINK(DLL) mojo_system_impl.dll mojo_system_impl.dll.lib mojo_system_impl.dll.pdb
FAILED: mojo_system_impl.dll mojo_system_impl.dll.lib mojo_system_impl.dll.pdb 
C:/b/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x86 False link.exe /nologo /IMPLIB:./mojo_system_impl.dll.lib /DLL /OUT:./mojo_system_impl.dll /PDB:./mojo_system_impl.dll.pdb @./mojo_system_impl.dll.rsp
named_platform_channel_pair_win.obj : error LNK2019: unresolved external symbol "public: __thiscall mojo::edk::NamedPlatformChannelPair::Options::~Options(void)" (??1Options@NamedPlatformChannelPair@edk@mojo@@QAE@XZ) referenced in function "public: __thiscall mojo::edk::NamedPlatformChannelPair::`default constructor closure'(struct mojo::edk::NamedPlatformChannelPair::Options const &)" (??_FNamedPlatformChannelPair@edk@mojo@@QAE@ABUOptions@012@@Z)

./mojo_system_impl.dll : fatal error LNK1120: 1 unresolved externals

I think this is probably a Chrome-side mojo change and not a clang change, but I can't pinpoint it.

 

Comment 1 by r...@chromium.org, Jan 7 2017

This was caused by my change r291045. Reduction:

struct NonTrivial {
  NonTrivial();
  ~NonTrivial();
  int o;
};
struct __declspec(dllexport) Foo {
  struct Options {
    NonTrivial o;
  };
  Foo(const Options &v = {});
};
Foo::Foo(const Options &v) {}

With my change, clang fails to generate the implicit ~Options destructor.
But link is happy and just lld isn't, right? How does that work?

Comment 3 by r...@chromium.org, Jan 7 2017

I think both are unhappy. This is a non-lld bot.

Comment 4 by h...@chromium.org, Jan 9 2017

Status: Assigned (was: Untriaged)

Comment 5 by r...@chromium.org, Jan 9 2017

r291453 should fix this. Let's see if the bot cycles green.

Comment 6 by r...@chromium.org, Jan 9 2017

There's a similar failure on ClangToTWin(dbg):
https://build.chromium.org/p/chromium.fyi/builders/ClangToTWin%28dbg%29/builds/7358

It looks like it came in with the skia roll, but it has a similar link error in a default constructor closure in a dll build:
[9828/43809] LINK(DLL) skia.dll skia.dll.lib skia.dll.pdb
FAILED: skia.dll skia.dll.lib skia.dll.pdb 
C:/b/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x86 False link.exe /nologo /IMPLIB:./skia.dll.lib /DLL /OUT:./skia.dll /PDB:./skia.dll.pdb @./skia.dll.rsp
SkPictureAnalyzer.obj : error LNK2019: unresolved external symbol "public: __thiscall sk_sp<class GrContextThreadSafeProxy>::sk_sp<class GrContextThreadSafeProxy>(std::nullptr_t)" (??0?$sk_sp@VGrContextThreadSafeProxy@@@@QAE@$$T@Z) referenced in function "public: __thiscall SkPictureGpuAnalyzer::`default constructor closure'(class sk_sp<class GrContextThreadSafeProxy>)" (??_FSkPictureGpuAnalyzer@@QAE@V?$sk_sp@VGrContextThreadSafeProxy@@@@@Z)

./skia.dll : fatal error LNK1120: 1 unresolved externals

I'll try to repro, but I think it's probably fixed by my change.

Comment 7 by r...@chromium.org, Jan 9 2017

Status: Fixed (was: Assigned)
I reproduced the link failure before my fix, applied my fix, rebuilt, and confirmed that skia.dll now builds.

The release dll bot also cycled green, so I'm marking this fixed:
https://build.chromium.org/p/chromium.fyi/builders/ClangToTWin%28dll%29/builds/6726

Sign in to add a comment