New issue
Advanced search Search tips

Issue 599223 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue 481611



Sign in to add a comment

weird link errors in views_examples_with_content_exe

Project Member Reported by wfh@chromium.org, Mar 30 2016

Issue description

When allocator shim code in https://codereview.chromium.org/1414453017/ landed the following link error appeared on windows:

FAILED: C:\b\depot_tools\python276_bin\python.exe gyp-win-tool link-with-manifests environment.x86 True views_examples_with_content_exe.exe "C:\b\depot_tools\python276_bin\python.exe gyp-win-tool link-wrapper environment.x86 False link.exe /nologo /OUT:views_examples_with_content_exe.exe @views_examples_with_content_exe.exe.rsp" 1 mt.exe rc.exe "obj\ui\views\examples\views_examples_with_content_exe.views_examples_with_content_exe.exe.intermediate.manifest" obj\ui\views\examples\views_examples_with_content_exe.views_examples_with_content_exe.exe.generated.manifest ..\..\ui\views\examples\views_examples.exe.manifest ..\..\build\win\compatibility.manifest
allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: __query_new_mode already defined in libucrt.lib(new_mode.obj)

allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: __set_new_mode already defined in libucrt.lib(new_mode.obj)

allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: _calloc already defined in libucrt.lib(calloc.obj)

allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: _free already defined in libucrt.lib(free.obj)

allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: _malloc already defined in libucrt.lib(malloc.obj)

allocator.lib(allocator.allocator_shim_win.obj) : error LNK2005: _realloc already defined in libucrt.lib(realloc.obj)

views_examples_with_content_exe.exe : fatal error LNK1169: one or more multiply defined symbols found

https://build.chromium.org/p/chromium/builders/Win/builds/41816/steps/compile/logs/stdio

this appears to be caused by base being linked twice.

removing the base.gyp from the examples.gyp file gives another error on linux component builds:

[373/373] LINK views_examples_with_content_exe
FAILED: /b/build/slave/linux_chromeos/build/src/build/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -fuse-ld=gold -B/b/build/slave/linux_chromeos/build/src/third_party/binutils/Linux_x64/Release/bin -Wl,--disable-new-dtags -L. -m64 -Wl,--icf=all -Wl,-rpath=\$ORIGIN/lib/ -Wl,-rpath-link=lib/ -o views_examples_with_content_exe -Wl,--start-group obj/ui/views/examples/views_examples_with_content_exe.examples_with_content_main_exe.o -Wl,--end-group lib/libcontent.so lib/libviews_content_client.so lib/libviews_examples_with_content_lib.so 
obj/ui/views/examples/views_examples_with_content_exe.examples_with_content_main_exe.o:../../ui/views/examples/examples_with_content_main_exe.cc:function (anonymous namespace)::ShowContentExampleWindow(content::BrowserContext*, aura::Window*): error: undefined reference to 'logging::LogMessage::LogMessage(char const*, int, int)'
obj/ui/views/examples/views_examples_with_content_exe.examples_with_content_main_exe.o:../../ui/views/examples/examples_with_content_main_exe.cc:function (anonymous namespace)::ShowContentExampleWindow(content::BrowserContext*, aura::Window*): error: undefined reference to 'logging::LogMessage::~LogMessage()'
obj/ui/views/examples/views_examples_with_content_exe.examples_with_content_main_exe.o:../../ui/views/examples/examples_with_content_main_exe.cc:function base::Callback<void (content::BrowserContext*, aura::Window*), (base::internal::CopyMode)1>::operator=(base::Callback<void (content::BrowserContext*, aura::Window*), (base::internal::CopyMode)1> const&): error: undefined reference to 'base::internal::CallbackBase<(base::internal::CopyMode)1>::operator=(base::internal::CallbackBase<(base::internal::CopyMode)1> const&)'
obj/ui/views/examples/views_examples_with_content_exe.examples_with_content_main_exe.o:../../ui/views/examples/examples_with_content_main_exe.cc:function base::internal::CallbackBase<(base::internal::CopyMode)1>::~CallbackBase(): error: undefined reference to 'base::internal::CallbackBase<(base::internal::CopyMode)0>::~CallbackBase()'
obj/ui/views/examples/views_examples_with_content_exe.examples_with_content_main_exe.o:../../ui/views/examples/examples_with_content_main_exe.cc:function base::internal::CallbackBase<(base::internal::CopyMode)1>::CallbackBase(base::internal::BindStateBase*): error: undefined reference to 'base::internal::CallbackBase<(base::internal::CopyMode)0>::CallbackBase(base::internal::BindStateBase*)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
 

Comment 1 by wfh@chromium.org, Mar 30 2016

Cc: sadrul@chromium.org
Labels: OS-Windows
Owner: wfh@chromium.org
Status: Started (was: Untriaged)
this only happens in gyp and not gn...
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 31 2016

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

commit 14b98d2bde6a9cb8cd4fc770be8d182ed84eef7c
Author: wfh <wfh@chromium.org>
Date: Thu Mar 31 18:26:12 2016

Fix base dependency in views_examples_with_content_exe

This was causing a link error as base/allocator was linked twice
when building in static_library using VS2015 allocator shim.

https://build.chromium.org/p/chromium/builders/Win/builds/41816/steps/compile/logs/stdio

BUG= 481611 , 599223 

Review URL: https://codereview.chromium.org/1836093004

Cr-Commit-Position: refs/heads/master@{#384338}

[modify] https://crrev.com/14b98d2bde6a9cb8cd4fc770be8d182ed84eef7c/ui/views/examples/examples.gyp

Status: Fixed (was: Started)
Doing some Views bug scrubbing. I think this is fixed now? :)

Sign in to add a comment