Issue metadata
Sign in to add a comment
|
clang links with chroot's x86_64-pc-linux-gnu libraries instead of x86_64-cros-linux-gnu |
||||||||||||||||||||||
Issue description
$ cat test.cpp
int main() {
std::cout << "Hello World" << std::endl;
return 0;
}
$ x86_64-cros-linux-gnu-clang++ ../../test.cpp -o main -Wl,-t|& grep x86_64-pc-linux-gnu
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x/crtbeginS.o
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x/libgcc_eh.a(unwind-dw2.o)
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x/libgcc_eh.a(unwind-dw2-fde-dip.o)
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x/crtendS.o
This happens even whnm a board's sysroot is specified:
$ x86_64-cros-linux-gnu-clang++ test.cpp -o main -Wl,-t --sysroot=/build/betty|& grep x86_64-pc-linux-gnu
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x/crtbeginS.o
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x/libgcc_eh.a(unwind-dw2.o)
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x/libgcc_eh.a(unwind-dw2-fde-dip.o)
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x/crtendS.o
The expectation is that x86_64-cros-linux-gnu libraries should be used, e.g.:
/usr/lib/gcc/x86_64-cros-linux-gnu/4.9.x/crtbeginS.o
/usr/lib/gcc/x86_64-cros-linux-gnu/4.9.x/libgcc_eh.a(unwind-dw2.o)
/usr/lib/gcc/x86_64-cros-linux-gnu/4.9.x/libgcc_eh.a(unwind-dw2-fde-dip.o)
/usr/lib/gcc/x86_64-cros-linux-gnu/4.9.x/libstdc++.so
/usr/lib/gcc/x86_64-cros-linux-gnu/4.9.x/libgcc_s.so.1
/usr/lib/gcc/x86_64-cros-linux-gnu/4.9.x/libgcc_s.so.1
/usr/lib/gcc/x86_64-cros-linux-gnu/4.9.x/crtendS.o
It is rather fortunate that the above x86_64-cros-linux-gnu binaries are same as x86_64-pc-linux-gnu and we don't see any problems.
,
Apr 9 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/06edb884e91542068f8f54fd4605d3e66e7cc348 commit 06edb884e91542068f8f54fd4605d3e66e7cc348 Author: Manoj Gupta <manojgupta@google.com> Date: Mon Apr 09 22:18:59 2018 llvm-next: Cherry-pick 2 upstream commits. Cherrypick following CLs to llvm-next: Author: Manoj Gupta <manojgupta@google.com> [Driver] Update GCC libraries detection logic for Gentoo. Summary: 1. Find GCC's LDPATH from the actual GCC config file. 2. Avoid picking libraries from a similar named tuple if the exact tuple is installed. Author: Manoj Gupta <manojgupta@google.com> Disable -fmerge-all-constants as default. Summary: "-fmerge-all-constants" is a non-conforming optimization and should not be the default. It is also causing miscompiles when building Linux Kernel (https://lkml.org/lkml/2018/3/20/872). BUG= chromium:828942 BUG= chromium:828505 TEST=USE="llvm-next" sudo emerge llvm works. Change-Id: I1372bc0a9a8b3475fc8bcaedee5e83bdb42f627c Reviewed-on: https://chromium-review.googlesource.com/1003040 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org> [rename] https://crrev.com/06edb884e91542068f8f54fd4605d3e66e7cc348/sys-devel/llvm/llvm-7.0_pre326829_p20180318-r9.ebuild [add] https://crrev.com/06edb884e91542068f8f54fd4605d3e66e7cc348/sys-devel/llvm/files/cherry/abb490ec962c6db7c2071ba9d1bd0cd60b4a1b3a.patch [add] https://crrev.com/06edb884e91542068f8f54fd4605d3e66e7cc348/sys-devel/llvm/files/cherry/6f11d411da7302cfb1d049928a8222c649eef441.patch
,
May 1 2018
Marking as fixed after latest llvm roll. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by manojgupta@chromium.org
, Apr 3 2018