New issue
Advanced search Search tips

Issue 676418 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

LNK4217 errors in media.service.exe, media_mojo_unittests, media_unittests link steps in Windows component builds:

Project Member Reported by w...@chromium.org, Dec 21 2016

Issue description

Windows component builds raise warning LNK4217 during the link step of the media_unittests and media_mojo_unittests targets:

[1/3] LINK media.service.exe media.service.exe.pdb
FAILED: media.service.exe media.service.exe.pdb
C:/python_27_amd64/files/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./media.service.exe /PDB:./media.service.exe.pdb @./media.service.exe.rsp
LINK : ./media.service.exe not found or not built by the last incremental link; performing full link
main.obj : warning LNK4217: locally defined symbol ?CreateMediaServiceForTesting@media@@YA?AV?$unique_ptr@VService@service_manager@@U?$default_delete@VService@service_manager@@@std@@@std@@XZ (class std::unique_ptr<class service_manager::Service,struct std::default_delete<class service_manager::Service> > __cdecl media::CreateMediaServiceForTesting(void)) imported in function ServiceMain

FAILED: media_mojo_unittests.exe media_mojo_unittests.exe.pdb
C:/python_27_amd64/files/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./media_mojo_unittests.exe /PDB:./media_mojo_unittests.exe.pdb @./media_mojo_unittests.exe.rsp
LINK : ./media_mojo_unittests.exe not found or not built by the last incremental link; performing full link
mojo_audio_decoder_unittest.obj : warning LNK4217: locally defined symbol ??0MojoAudioDecoderService@media@@QEAA@V?$WeakPtr@VMojoCdmServiceContext@media@@@base@@V?$unique_ptr@VAudioDecoder@media@@U?$default_delete@VAudioDecoder@media@@@std@@@std@@@Z (public: __cdecl media::MojoAudioDecoderService::MojoAudioDecoderService(class base::WeakPtr<class media::MojoCdmServiceContext>,class std::unique_ptr<class media::AudioDecoder,struct std::default_delete<class media::AudioDecoder> >)) imported in function "class std::unique_ptr<class media::MojoAudioDecoderService,struct std::default_delete<class media::MojoAudioDecoderService> > __cdecl base::MakeUnique<class media::MojoAudioDecoderService,class base::WeakPtr<class media::MojoCdmServiceContext>,class std::unique_ptr<class testing::StrictMock<class media::MockAudioDecoder>,struct std::default_delete<class testing::StrictMock<class media::MockAudioDecoder> > > >(class base::WeakPtr<class media::MojoCdmServiceContext> &&,class std::unique_ptr<class testing::StrictMock<class media::MockAudioDecoder>,struct std::default_delete<class testing::StrictMock<class media::MockAudioDecoder> > > &&)" (??$MakeUnique@VMojoAudioDecoderService@media@@V?$WeakPtr@VMojoCdmServiceContext@media@@@base@@V?$unique_ptr@V?$StrictMock@VMockAudioDecoder@media@@@testing@@U?$default_delete@V?$StrictMock@VMockAudioDecoder@media@@@testing@@@std@@@std@@@base@@YA?AV?$unique_ptr@VMojoAudioDecoderService@media@@U?$default_delete@VMojoAudioDecoderService@media@@@std@@@std@@$$QEAV?$WeakPtr@VMojoCdmServiceContext@media@@@0@$$QEAV?$unique_ptr@V?$StrictMock@VMockAudioDecoder@media@@@testing@@U?$default_delete@V?$StrictMock@VMockAudioDecoder@media@@@testing@@@std@@@2@@Z)

FAILED: media_unittests.exe media_unittests.exe.pdb
C:/python_27_amd64/files/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./media_unittests.exe /PDB:./media_unittests.exe.pdb @./media_unittests.exe.rsp
LINK : ./media_unittests.exe not found or not built by the last incremental link; performing full link
mojo_audio_decoder_unittest.obj : warning LNK4217: locally defined symbol ??0MojoAudioDecoderService@media@@QEAA@V?$WeakPtr@VMojoCdmServiceContext@media@@@base@@V?$unique_ptr@VAudioDecoder@media@@U?$default_delete@VAudioDecoder@media@@@std@@@std@@@Z (public: __cdecl media::MojoAudioDecoderService::MojoAudioDecoderService(class base::WeakPtr<class media::MojoCdmServiceContext>,class std::unique_ptr<class media::AudioDecoder,struct std::default_delete<class media::AudioDecoder> >)) imported in function "class std::unique_ptr<class media::MojoAudioDecoderService,struct std::default_delete<class media::MojoAudioDecoderService> > __cdecl base::MakeUnique<class media::MojoAudioDecoderService,class base::WeakPtr<class media::MojoCdmServiceContext>,class std::unique_ptr<class testing::StrictMock<class media::MockAudioDecoder>,struct std::default_delete<class testing::StrictMock<class media::MockAudioDecoder> > > >(class base::WeakPtr<class media::MojoCdmServiceContext> &&,class std::unique_ptr<class testing::StrictMock<class media::MockAudioDecoder>,struct std::default_delete<class testing::StrictMock<class media::MockAudioDecoder> > > &&)" (??$MakeUnique@VMojoAudioDecoderService@media@@V?$WeakPtr@VMojoCdmServiceContext@media@@@base@@V?$unique_ptr@V?$StrictMock@VMockAudioDecoder@media@@@testing@@U?$default_delete@V?$StrictMock@VMockAudioDecoder@media@@@testing@@@std@@@std@@@base@@YA?AV?$unique_ptr@VMojoAudioDecoderService@media@@U?$default_delete@VMojoAudioDecoderService@media@@@std@@@std@@$$QEAV?$WeakPtr@VMojoCdmServiceContext@media@@@0@$$QEAV?$unique_ptr@V?$StrictMock@VMockAudioDecoder@media@@@testing@@U?$default_delete@V?$StrictMock@VMockAudioDecoder@media@@@testing@@@std@@@2@@Z)
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 23 2016

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

commit c868aae8f9b8d51461afff79064c75339e6ce30c
Author: wez <wez@chromium.org>
Date: Fri Dec 23 08:09:04 2016

Use the /WX flag to have link warnings treated as errors.

Link steps with warnings typically lead to working binaries, but warnings can indicate dependency issues in the codebase, slow down builds, and otherwise just make it harder to find more relevant output in build logs.

This CL also adds exceptions to ignore certain linker warnings under specific configurations and targets.

BUG= 659007 ,  676418 , 676417,  654776 

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

[modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/build/config/compiler/BUILD.gn
[modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/build/config/win/BUILD.gn
[modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/media/BUILD.gn
[modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/media/mojo/BUILD.gn
[modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/media/mojo/services/BUILD.gn
[modify] https://crrev.com/c868aae8f9b8d51461afff79064c75339e6ce30c/third_party/WebKit/Source/platform/BUILD.gn

Comment 2 by w...@chromium.org, Jan 3 2017

Owner: xhw...@chromium.org
Status: Assigned (was: Untriaged)

Comment 3 by w...@chromium.org, Jan 3 2017

FYI: To see the warnings:
1. Add fatal_linker_warnings=false to your GN args.
2. Delete the target you're interested in, or gn clean your output directory.
3. Build the target.

Comment 4 by w...@chromium.org, Jan 3 2017

Scratch step #1: You'll need to explicitly remove the suppressions from the BUILD.gn for media, and then follow steps #2 and #3 to have the build warn & fail.
Thanks I'll take a look. I just updated my Windows bot. I'll try the repro steps once I got chromium building on Windows.
Owner: jrumm...@chromium.org
It's taking longer than expected for me to get my Windows machine ready and I am fully occupied by other tasks. Assigning to jrummell@ (who has Windows machine handy) for load balancing.
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 13 2017

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

commit 6e462aab03239f5ddfcec2adc598e5d775fb70e2
Author: jrummell <jrummell@chromium.org>
Date: Thu Jul 13 20:49:47 2017

Fix media_mojo builds

Previously media/mojo/sevices:lib was done as a source_set due to issue
670094. Now that that issue is fixed, the intermediate "lib" target is
no longer needed.

Removing the suppression of duplicate symbols revealed that some of the
CdmPromiseTemplate methods end up in multiple modules when doing a
component build. So fix CdmPromiseTemplate<>::GetResolveParameterType()
implementation to avoid this.

This also enables //media/mojo/services/media_service_unittests on
Windows (which was disabled due to linking issues that are now fixed).

BUG= 676418 , 676055 , 656706 
TEST=media_mojo tests compile and run

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

[modify] https://crrev.com/6e462aab03239f5ddfcec2adc598e5d775fb70e2/media/BUILD.gn
[modify] https://crrev.com/6e462aab03239f5ddfcec2adc598e5d775fb70e2/media/base/cdm_callback_promise.h
[modify] https://crrev.com/6e462aab03239f5ddfcec2adc598e5d775fb70e2/media/base/cdm_promise.cc
[modify] https://crrev.com/6e462aab03239f5ddfcec2adc598e5d775fb70e2/media/base/cdm_promise.h
[modify] https://crrev.com/6e462aab03239f5ddfcec2adc598e5d775fb70e2/media/cdm/BUILD.gn
[modify] https://crrev.com/6e462aab03239f5ddfcec2adc598e5d775fb70e2/media/mojo/BUILD.gn
[modify] https://crrev.com/6e462aab03239f5ddfcec2adc598e5d775fb70e2/media/mojo/services/BUILD.gn
[modify] https://crrev.com/6e462aab03239f5ddfcec2adc598e5d775fb70e2/media/remoting/proto_utils.h

Status: Fixed (was: Assigned)

Sign in to add a comment