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

Issue 606391 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
User never visited
Closed: Apr 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 537368



Sign in to add a comment

clang and ld.so needs cooperation in SimpleChrome

Project Member Reported by shenhan@chromium.org, Apr 25 2016

Issue description

In SimpleChrome workflow, we explicitly invoke Chromium ld.so (which is different from system ld.so), like below - 

/SimpleChrome/lib/.../ld.so --library "XXX" clang.elf -c xxx

The problem here is that clang.elf re-invokes itself (I didn't dive deep enough to provide rationale for this behavior), however, this time, system ld.so is used, that's wrong, also --library "XXX" passed to the first invocation is also lost, thus, the second invocation fails.

To fix this, I suggest in clang, instead of re-invoking 'clang.elf', we re-invoking 'clang', which is a wrapper and this uses the correct ld.so and passes the correct libraries option.
 

Comment 1 by vapier@chromium.org, Apr 25 2016

i think this upstream patch to ld.so would help:
  https://sourceware.org/ml/libc-alpha/2016-04/msg00576.html

then we could set argv[0] back to the non-elf file and clang should dtrt after that.
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 25 2016

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

commit 75b0655936503b8f8587c6cc7ccdb857833112fa
Author: Han Shen <shenhan@google.com>
Date: Tue Mar 29 22:02:23 2016

Make clang call wrapper instead of underlying binary (for simple-chrome).

In simple-chrome, clang is a shell wrapper, it calls clang.elf, which is
the real binary, then, clang.elf calls clang.elf itself. It is the last
invocation "clang.elf -> clang.elf" that breaks, because direct calls to
clang.elf misses all environment setup in clang wrapper. Fix this by
calling to clang wrapper instead of clang.elf binary.

BUG= chromium:606391 
TEST=ld.so --library 'xxx' clang -c test.c under simplechrome

Change-Id: I7ddbed76ceb261893ba1260d5f903fdd88702f7b
Reviewed-on: https://chromium-review.googlesource.com/335881
Commit-Ready: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
Reviewed-by: Han Shen <shenhan@chromium.org>

[add] https://crrev.com/75b0655936503b8f8587c6cc7ccdb857833112fa/sys-devel/llvm/files/llvm-3.8-invocation.patch

Project Member

Comment 3 by bugdroid1@chromium.org, Apr 28 2016

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

commit 7bcd5901d3e5babb724dd698f6d622a628092c28
Author: Han Shen <shenhan@google.com>
Date: Tue Apr 26 17:40:14 2016

Apply patch for crbug/606391.

CL https://chromium-review.googlesource.com/#/c/335881/ only included
the patch file, and the patch file was not applied. Fix this by
epatching this in the ebuild file.

BUG= chromium:606391 
TEST=Buid chromeos llvm

Change-Id: I0c21575706f5ecc710241f9aa860e384b1d6e8fc
Reviewed-on: https://chromium-review.googlesource.com/340771
Commit-Ready: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
Reviewed-by: Luis Lozano <llozano@chromium.org>

[rename] https://crrev.com/7bcd5901d3e5babb724dd698f6d622a628092c28/sys-devel/llvm/llvm-3.8_pre255169-r3.ebuild

Status: Fixed (was: Started)
Fixed by CLs in comment #2 & #3.
Blocking: 537368

Sign in to add a comment