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

Issue 822334 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
Build-Toolchain



Sign in to add a comment

Chrome failed to link with lld on arm-generic

Project Member Reported by manojgupta@chromium.org, Mar 15 2018

Issue description

https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/chromiumos-sdk/builds/2969

chromeos-chrome-67.0.3369.0_rc-r1: [2/2] LINK ./chrome
chromeos-chrome-67.0.3369.0_rc-r1: FAILED: chrome 
chromeos-chrome-67.0.3369.0_rc-r1: python "../../../../../../../home/chrome-bot/chrome_root/src/build/toolchain/gcc_link_wrapper.py" --output="./chrome" -- armv7a-cros-linux-gnueabi-clang++ -fuse-ld=lld -pie -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--no-as-needed -lpthread -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all --target=arm-linux-gnueabihf -Wl,-O2 -Wl,--gc-sections -Wl,--gdb-index --sysroot=../../../../../../../build/arm-generic -L../../../../../../../build/arm-generic/lib -Wl,-rpath-link=../../../../../../../build/arm-generic/lib -L../../../../../../../build/arm-generic/usr/lib -Wl,-rpath-link=../../../../../../../build/arm-generic/usr/lib -L../../../../../../../build/arm-generic/usr/local/lib -Wl,-rpath-link=../../../../../../../build/arm-generic/usr/local/lib -L../../../../../../../build/arm-generic/usr/armv7a-cros-linux-gnueabi/lib -Wl,-rpath-link=../../../../../../../build/arm-generic/usr/armv7a-cros-linux-gnueabi/lib -Wl,-rpath-link=. -Wl,--disable-new-dtags -L/build/arm-generic/usr/lib -Wl,-O1 -Wl,-O2 -Wl,--as-needed -stdlib=libc++  -o "./chrome" -Wl,--start-group @"./chrome.rsp"  -Wl,--end-group   -ldl -lpthread -lrt -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -ldbus-1 -lcups -lfontconfig -lexpat -lfreetype -lharfbuzz -ldrm -lresolv -lxkbcommon -lgestures -levdev -lsync -lgbm -lpci -lasound -lcras -lm -lz -lEGL -lGLESv2 -lffi 
chromeos-chrome-67.0.3369.0_rc-r1: /usr/bin/ld.lld: error: duplicate symbol: main
chromeos-chrome-67.0.3369.0_rc-r1: >>> defined at chrome_exe_main_aura.cc:17 (../../../../../../../home/chrome-bot/chrome_root/src/chrome/app/chrome_exe_main_aura.cc:17)
chromeos-chrome-67.0.3369.0_rc-r1: >>>            obj/chrome/chrome_initial/chrome_exe_main_aura.o:(main)
chromeos-chrome-67.0.3369.0_rc-r1: >>> defined at rar.cpp:5 (../../../../../../../home/chrome-bot/chrome_root/src/third_party/unrar/src/rar.cpp:5)
chromeos-chrome-67.0.3369.0_rc-r1: >>>            rar.o:(.text.main+0x1) in archive obj/third_party/unrar/libunrar.a
chromeos-chrome-67.0.3369.0_rc-r1: clang-7.0: error: linker command failed with exit code 1 (use -v to see invocation)
 
Blocking: -815357
Labels: -Pri-1 Pri-2
Summary: Chrome failed to link with lld on arm-generic (was: Chorme failed to link with lld on arm-generic)
Stopped testing lld with llvm-next since lld deployment is not planned in this branch.
The change below in lld caused the error.
commit 5d46c4f8645f737eaa18116c466eaf7fd268dd68
Author: Rafael Espindola <rafael.espindola@gmail.com>
Date:   Tue Feb 27 20:31:22 2018 +0000

    Put undefined symbols from shared libraries in the symbol table.
    
    With the recent fixes these symbols have more in common than not with
    regular undefined symbols.
    
    git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@326242 91177308-0d34-0410-b5e6-96231b3b80d8
Cc: p...@chromium.org
In case this happens in linux too.

Comment 4 by p...@chromium.org, Mar 21 2018

I haven't seen this on Linux, but it looks like an ODR violation that happens to be caught by lld on cros. I think you should be able to fix it by removing src/rar.cpp from third_party/unrar/BUILD.gn.
I can try that. But it looks like a lld regress too, older version of lld can link Chrome without problem.

Comment 6 by p...@chromium.org, Mar 21 2018

Not really, the lld change was a change in link order that shouldn't matter except in invalid programs.

Comment 7 by vapier@chromium.org, Mar 21 2018

i'm w/pcc -- sounds like a bug fix in lld that uncovered a real bug on the Chromium side.  the fact that we weren't rejecting this before doesn't make it a regression.
Project Member

Comment 8 by bugdroid1@chromium.org, Mar 22 2018

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

commit 09a2374904378bbe7170d14d50b8dff8dc03857e
Author: Yunlian Jiang <yunlian@chromium.org>
Date: Thu Mar 22 17:38:09 2018

unrar: remove rar.cpp from gn file.

Newer lld failed to link chrome, it complains about duplicate symbol.
It looks like an ODR violation.

BUG= chromium:822334 
TEST=lld links Chrome now.

Change-Id: I2894b49b68d0a0a952f290af81f38eb30aa34cbd
Reviewed-on: https://chromium-review.googlesource.com/974455
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545134}
[modify] https://crrev.com/09a2374904378bbe7170d14d50b8dff8dc03857e/third_party/unrar/BUILD.gn

Status: Verified (was: Untriaged)

Sign in to add a comment