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

Issue 597106 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

sysroot wrapper does not work in standalone mode w/clang

Project Member Reported by vapier@chromium.org, Mar 22 2016

Issue description

$ ./armv7a-cros-linux-gnueabi/bin/armv7a-cros-linux-gnueabi-clang -c test.c
Traceback (most recent call last):
  File ".../armv7a-cros-linux-gnueabi/bin/../usr/x86_64-pc-linux-gnu/armv7a-cros-linux-gnueabi/gcc-bin/4.9.x/armv7a-cros-linux-gnueabi-clang", line 382, in <module>
    clang_cmdline += ['-B' + linker_path]
TypeError: cannot concatenate 'str' and 'NoneType' objects

looks like the lookup logic assumes that the toolchain is always in $PATH
 
Labels: -Pri-3 Pri-2
Status: Assigned (was: Unconfirmed)
Yunlian, can you please look into this?
I assume this happens outside chroot and there is "-B ${path_to_the_linker}" option in the commandline?

Comment 3 by vapier@chromium.org, Aug 30 2016

yes & yes -- i provided an example command line to show the failure
So I could just skip 
'clang_cmdline += ['-B' + linker_path]' if ${linker_path} is None.
Does this make sense?

Comment 5 by vapier@chromium.org, Aug 30 2016

i would question why the -B flag is there at all if it isn't needed.  using clang from the standalone toolchain package should also use the linker in that package and not the host linker.
It seems current clang can find the correct linker by itself. I will prepare a patch to remove the -B flag.

Comment 7 by vapier@chromium.org, Aug 30 2016

that'd be great.  it might have been related to the clang/argv[0] weirdness that was changed in  issue 591436 :
  https://chromium-review.googlesource.com/330128

i guess make sure you specifically check the test that caused this code to be added in the first place --  issue 284940  and the TEST:
  https://chromium-review.googlesource.com/168045

Comment 8 by vapier@chromium.org, Mar 10 2017

Cc: yunlian@chromium.org
 Issue 700566  has been merged into this issue.

Comment 9 by bcf@chromium.org, Mar 10 2017

Cc: bcf@chromium.org
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 16 2017

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

commit f9fa626551554d375044802f81950f8a5c5cbdd3
Author: Yunlian Jiang <yunlian@google.com>
Date: Thu Mar 16 18:25:49 2017

gcc: help clang find the linker path outside the chroot.

Outside the chroot, the ${CTARGET}-ld is not in the ${PATH} so the
clang could not find the linker. This patch adds the sdk/bin to the
search path to help clang find the linker.

BUG= chromium:597106 
TEST=./armv7a-cros-linux-gnueabi/bin/armv7a-cros-linux-gnueabi-clang
     -c test.c finds the linker.

Change-Id: I276b2e00e07724ba4fd556cbcccc9865d2fe21ee
Reviewed-on: https://chromium-review.googlesource.com/443408
Commit-Ready: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>

[rename] https://crrev.com/f9fa626551554d375044802f81950f8a5c5cbdd3/sys-devel/gcc/gcc-4.9.2-r152.ebuild
[modify] https://crrev.com/f9fa626551554d375044802f81950f8a5c5cbdd3/sys-devel/gcc/files/sysroot_wrapper.hardened

Status: Fixed (was: Assigned)

Comment 12 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61
Status: Verified (was: Fixed)
Closing. Please reopen it if its not fixed. Thanks!

Sign in to add a comment