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

Issue 669352 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Windows build warning LNK4217 in unit_tests

Project Member Reported by pkasting@chromium.org, Nov 29 2016

Issue description

Getting this while building tonight.  Not sure how recent a regression it might be.

ui.lib(inspect_ui.obj) : warning LNK4217: locally defined symbol ?GetClientNames
AndUrls@UiDevToolsServer@devtools@ui@@SA?AV?$vector@U?$pair@V?$basic_string@DU?$
char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@V?$allocator@U?$pair@V?$basi
c_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@XZ (pu
blic: static class std::vector<struct std::pair<class std::basic_string<char,str
uct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<
char,struct std::char_traits<char>,class std::allocator<char> > >,class std::all
ocator<struct std::pair<class std::basic_string<char,struct std::char_traits<cha
r>,class std::allocator<char> >,class std::basic_string<char,struct std::char_tr
aits<char>,class std::allocator<char> > > > > __cdecl ui::devtools::UiDevToolsSe
rver::GetClientNamesAndUrls(void)) imported in function "void __cdecl `anonymous
 namespace'::GetUiDevToolsTargets(class base::ListValue &)" (?GetUiDevToolsTarge
ts@?A0x0e470548@@YAXAEAVListValue@base@@@Z)
 
Owner: sadrul@chromium.org
Status: Assigned (was: Untriaged)
Components: -Platform>DevTools

Comment 3 by sadrul@chromium.org, Nov 29 2016

Cc: sadrul@chromium.org
Owner: mhashmi@chromium.org
--> mhashmi@

Sounds like you need a UI_DEVTOOLS_EXPORT here: https://cs.chromium.org/chromium/src/components/ui_devtools/devtools_server.h?sq=package:chromium&dr=C&l=35 (and maybe for Create too?)
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c9d4abeb958fde2ab943e4e32d445ae695d71630

commit c9d4abeb958fde2ab943e4e32d445ae695d71630
Author: mhashmi <mhashmi@chromium.org>
Date: Thu Dec 08 21:04:38 2016

Remove UI_DEVTOOLS_EXPORT from class and add it to static methods

The error was caused because static methods in devtools_server.h were
not marked UI_DEVTOOLS_EXPORT. We cannot mark them as such if the whole
class is already marked. Therefore, we need to remove the export from the
class and add it to the static methods.

BUG= 669352 

Review-Url: https://codereview.chromium.org/2560013002
Cr-Commit-Position: refs/heads/master@{#437338}

[modify] https://crrev.com/c9d4abeb958fde2ab943e4e32d445ae695d71630/components/ui_devtools/devtools_server.h

Just seen this again in logs here:
https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/311878/steps/compile%20%28with%20patch%29/logs/stdio

ui.lib(inspect_ui.obj) : warning LNK4217: locally defined symbol ?GetClientNamesAndUrls@UiDevToolsServer@devtools@ui@@SA?AV?$vector@U?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@V?$allocator@U?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@XZ (public: static class std::vector<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > __cdecl ui::devtools::UiDevToolsServer::GetClientNamesAndUrls(void)) imported in function "void __cdecl `anonymous namespace'::GetUiDevToolsTargets(class base::ListValue &)" (?GetUiDevToolsTargets@?A0xda0d3908@@YAXAAVListValue@base@@@Z)

Comment 6 by w...@chromium.org, Dec 10 2016

I'm also seeing this (locally) for blink_platform.dll (StructTraits warning), content.dll (PowerMonitorBroadcastSource), and chrome.dll (GetClientNamesAndUrls; updating now to verify that's gone away).

Could/should linker warnings be treated as errors, as we do for compiler warnings?
@6: See  bug 659007 .
Project Member

Comment 8 by bugdroid1@chromium.org, Dec 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/030d74f466988680ff7dbe644954569f447975f3

commit 030d74f466988680ff7dbe644954569f447975f3
Author: leon.han <leon.han@intel.com>
Date: Tue Dec 13 02:52:16 2016

Forbid components/ui_devtools:ui_devtools exporting symbols.

components/ui_devtools:ui_devtools is a source_set target depended on
by chrome/browser/ui:ui and ash:ash, which just embed ui_devtools and do not
expect it to export any symbols out.

BUG= 669352 

Review-Url: https://codereview.chromium.org/2568003002
Cr-Commit-Position: refs/heads/master@{#438002}

[modify] https://crrev.com/030d74f466988680ff7dbe644954569f447975f3/components/ui_devtools/devtools_server.h

Comment 9 by leon....@intel.com, Dec 14 2016

Windows component build warning when creating blink_platform.dll:

[36444/41755] LINK(DLL) blink_platform.dll blink_platform.dll.lib blink_platform.dll.pdb
quads.mojom-blink.obj : warning LNK4217: locally defined symbol ?Read@?$StructTraits@VSizeDataView@mojom@gfx@@UWebSize@blink@@@mojo@@SA_NVSizeDataView@mojom@gfx@@PAUWebSize@blink@@@Z (public: static bool __cdecl mojo::StructTraits<class gfx::mojom::SizeDataView,struct blink::WebSize>::Read(class gfx::mojom::SizeDataView,struct blink::WebSize *)) imported in function "public: static bool __cdecl mojo::internal::Serializer<class gfx::mojom::SizeDataView,struct blink::WebSize>::Deserialize(class gfx::mojom::internal::Size_Data *,struct blink::WebSize *,struct mojo::internal::SerializationContext *)" (?Deserialize@?$Serializer@VSizeDataView@mojom@gfx@@UWebSize@blink@@@internal@mojo@@SA_NPAVSize_Data@2mojom@gfx@@PAUWebSize@blink@@PAUSerializationContext@23@@Z)

shared_quad_state.mojom-blink.obj : warning LNK4049: locally defined symbol ?Read@?$StructTraits@VSizeDataView@mojom@gfx@@UWebSize@blink@@@mojo@@SA_NVSizeDataView@mojom@gfx@@PAUWebSize@blink@@@Z (public: static bool __cdecl mojo::StructTraits<class gfx::mojom::SizeDataView,struct blink::WebSize>::Read(class gfx::mojom::SizeDataView,struct blink::WebSize *)) imported

transferable_resource.mojom-blink.obj : warning LNK4049: locally defined symbol ?Read@?$StructTraits@VSizeDataView@mojom@gfx@@UWebSize@blink@@@mojo@@SA_NVSizeDataView@mojom@gfx@@PAUWebSize@blink@@@Z (public: static bool __cdecl mojo::StructTraits<class gfx::mojom::SizeDataView,struct blink::WebSize>::Read(class gfx::mojom::SizeDataView,struct blink::WebSize *)) imported

gpu_info.mojom-blink.obj : warning LNK4049: locally defined symbol ?Read@?$StructTraits@VSizeDataView@mojom@gfx@@UWebSize@blink@@@mojo@@SA_NVSizeDataView@mojom@gfx@@PAUWebSize@blink@@@Z (public: static bool __cdecl mojo::StructTraits<class gfx::mojom::SizeDataView,struct blink::WebSize>::Read(class gfx::mojom::SizeDataView,struct blink::WebSize *)) imported

Comment 10 by leon....@intel.com, Dec 14 2016

Cc: leon....@intel.com

Comment 11 by w...@chromium.org, Dec 21 2016

Status: Fixed (was: Assigned)
Looks like the original issue (unit_tests) is resolved, and comment #9s issues are tracked by  issue 654776 , which is now resolved.
Project Member

Comment 12 by bugdroid1@chromium.org, Jan 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4724c1ac34d346dd8b44c4abc33b344a744a2d69

commit 4724c1ac34d346dd8b44c4abc33b344a744a2d69
Author: leon.han <leon.han@intel.com>
Date: Tue Jan 17 06:52:48 2017

Fix Windows build warning LNK4217 for blink_platform.dll.

[1] third_party/WebKit/public:offscreen_canvas_mojo_bindings_blink
  ==> [2] cc/ipc:interfaces_blink
    ==> [3] gpu/ipc/common:interfaces_blink
The above three targets are all linked into blink_platform.dll,
but [2] and [3] use gfx.mojom.Size typemap defined in
third_party/WebKit/Source/platform/mojo/GeometryStructTraits.{cpp,h},
which is exported from bink_platform.dll.
Thus, generated C++ bindings of [2] and [3] include GeometryStructTraits.h
while themselves are part of blink_platform.dll, means they are
importing(dllimport) local defined symbols marked as dllexport, caused LNK4217.

This CL moves this struct traits to a separate source_set target,
instead of exporting it from blink_platform.dll.

BUG= 654776 , 669352 
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2574593003
Cr-Commit-Position: refs/heads/master@{#443994}

[modify] https://crrev.com/4724c1ac34d346dd8b44c4abc33b344a744a2d69/third_party/WebKit/Source/platform/BUILD.gn
[add] https://crrev.com/4724c1ac34d346dd8b44c4abc33b344a744a2d69/third_party/WebKit/Source/platform/mojo/BUILD.gn
[modify] https://crrev.com/4724c1ac34d346dd8b44c4abc33b344a744a2d69/third_party/WebKit/Source/platform/mojo/Geometry.typemap
[modify] https://crrev.com/4724c1ac34d346dd8b44c4abc33b344a744a2d69/third_party/WebKit/Source/platform/mojo/GeometryStructTraits.cpp
[modify] https://crrev.com/4724c1ac34d346dd8b44c4abc33b344a744a2d69/third_party/WebKit/Source/platform/mojo/GeometryStructTraits.h
[modify] https://crrev.com/4724c1ac34d346dd8b44c4abc33b344a744a2d69/third_party/WebKit/public/BUILD.gn

Sign in to add a comment