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

Issue 681132 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

chell-chrome-pfq failed on create_llvm_prof

Project Member Reported by laszio@chromium.org, Jan 13 2017

Issue description

@@@STEP_WARNINGS@@@
05:08:32: WARNING: AFDO profile generation failed with exception 
Traceback (most recent call last):
  File "/b/cbuild/internal_master/chromite/cbuildbot/stages/afdo_stages.py", line 49, in PerformStage
    buildroot, gs_context)
  File "/b/cbuild/internal_master/chromite/cbuildbot/afdo.py", line 479, in GenerateAFDOData
    print_cmd=True)
  File "/b/cbuild/internal_master/chromite/lib/cros_build_lib.py", line 625, in RunCommand
    raise RunCommandError(msg, cmd_result)
RunCommandError: return code: 127; command: cros_sdk -- /usr/bin/create_llvm_prof '--binary=/tmp/chrome.unstripped' '--profile=/tmp/chromeos-chrome-amd64-57.0.2980.0.perf.data' '--out=/tmp/chromeos-chrome-amd64-57.0.2980.0_rc-r1.afdo'
 * Generating locale-archive: forcing # of jobs to 1
/usr/bin/create_llvm_prof: error while loading shared libraries: libLLVMProfileData.so: cannot open shared object file: No such file or directory
 

Comment 1 by laszio@chromium.org, Jan 14 2017

Cc: yunlian@chromium.org vapier@chromium.org llozano@chromium.org manojgupta@chromium.org
CL428120 only solves part of the problem.
https://chromium-review.googlesource.com/#/c/428120/

Explanation:

The difficult part that remains is the use of llvm-next + latest-toolchain. The autofdo package is created by "current" llvm (i.e., linked to libLLVM-3.9svn.so) but what resides in the SDK when calling create_llvm_prof is from llvm-next (libLLVM-4.0svn.so).

autofdo's configure calls "llvm-config --libs" which returns libLLVM-${PV}.so. What's worse is that it has no --enable-static/--disable-shared options.


Possible Solutions:

Doing an "emerge autofdo" right before calling create_llvm_prof in AFDODataGenerateStage should work but looks dirty. Updating autofdo along with llvm when latest-toolchain is specified is also ugly.

One other way is to ditch create_llvm_prof and use gcov, which is supported by newer llvm according to the manual. However, I'm not sure how good the support is and how long it will be. I'll need a couple of day to test it.
http://clang.llvm.org/docs/UsersManual.html

Shipping a statistically linked clang/llvm should also work but you may not like it.

Any suggestions?

Comment 2 by laszio@chromium.org, Jan 14 2017

sorry for the typo: s/statistically/statically
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/602d6c110ef9589aae01eb1176f6906a0dd0c84d

commit 602d6c110ef9589aae01eb1176f6906a0dd0c84d
Author: Ting-Yuan Huang <laszio@chromium.org>
Date: Fri Jan 13 19:56:25 2017

autofdo: uprev and correct dependencies

The bug happens because it was built by the old toolchain but shipped
with the new one, where all libLLVM*.so is replaced with a
single libLLVM.so. Uprev fixes this.

BUG= chromium:681132 
TEST=build and run create_llvm_prof

Change-Id: Iebca73297b272b5a8b9f9fe0df24eca59361ccd7
Reviewed-on: https://chromium-review.googlesource.com/428120
Commit-Ready: Ting-Yuan Huang <laszio@chromium.org>
Tested-by: Ting-Yuan Huang <laszio@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[add] https://crrev.com/602d6c110ef9589aae01eb1176f6906a0dd0c84d/sys-devel/autofdo/autofdo-0.15-r1.ebuild
[modify] https://crrev.com/602d6c110ef9589aae01eb1176f6906a0dd0c84d/sys-devel/autofdo/autofdo-0.15.ebuild

Comment 4 by laszio@chromium.org, Jan 14 2017

A few sections, including .text, of chrome by gcov and llvm_prof look different. Revert the build flavor (libLLVM*.so v.s. libLLVM.so) seems the action to take now.

https://chromium-review.googlesource.com/#/c/428395/
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/b4f46332edf190f1182533ae5ec2e19868e51ce3

commit b4f46332edf190f1182533ae5ec2e19868e51ce3
Author: Ting-Yuan Huang <laszio@chromium.org>
Date: Sat Jan 14 19:06:05 2017

Revert "llvm: build a single libLLVM.so" again

This is conflicting with sys-devel/autofdo.  Also uprev autofdo so
that it will be built with the updated llvm.

BUG= chromium:681132 
TEST=none

Change-Id: Ib65235fe50c5766db555969f44ee0fd3dcdd4882
Reviewed-on: https://chromium-review.googlesource.com/428395
Commit-Ready: Ting-Yuan Huang <laszio@chromium.org>
Tested-by: Ting-Yuan Huang <laszio@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>

[rename] https://crrev.com/b4f46332edf190f1182533ae5ec2e19868e51ce3/sys-devel/autofdo/autofdo-0.15-r2.ebuild
[rename] https://crrev.com/b4f46332edf190f1182533ae5ec2e19868e51ce3/sys-devel/llvm/llvm-3.9_pre265926-r23.ebuild

Comment 6 by laszio@chromium.org, Jan 19 2017

Status: Verified (was: Started)

Sign in to add a comment