sysroot wrapper does not work in standalone mode w/clang |
||||||
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
,
Aug 30 2016
I assume this happens outside chroot and there is "-B ${path_to_the_linker}" option in the commandline?
,
Aug 30 2016
yes & yes -- i provided an example command line to show the failure
,
Aug 30 2016
So I could just skip
'clang_cmdline += ['-B' + linker_path]' if ${linker_path} is None.
Does this make sense?
,
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.
,
Aug 30 2016
It seems current clang can find the correct linker by itself. I will prepare a patch to remove the -B flag.
,
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
,
Mar 10 2017
,
Mar 10 2017
,
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
,
Mar 21 2017
,
May 30 2017
,
Aug 1 2017
,
Aug 3 2017
Closing. Please reopen it if its not fixed. Thanks! |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by llozano@chromium.org
, Aug 29 2016Status: Assigned (was: Unconfirmed)