In SimpleChrome workflow, toolchain binaries are wrapped with a shell that invokes the binaries via ld-linux-x86-64.so.2, for example, gdb is invoked like below -
..../ld-linux-x86-64.so.2 --library-path "..." "gdb.real" "$@"
However, this does not work for clang,
/lib64/ld-linux-x86-64.so.2 /usr/bin/clang-3.8 -v -c ~/test.c
clang version 3.8.0 (/var/cache/chromeos-cache/distfiles/host/egit-src/clang.git 4483c0162c2672fc09fb738e9c683ebde1f146f3) (/var/cache/chromeos-cache/distfiles/host/egit-src/llvm.git fad81ab170b3d422f0aaa15b88157fdb16d3e75d)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/4.9.x-google
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x-google
Found candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x-google
Found candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.x-google
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/4.9.x-google
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/lib64/ld-2.19.so" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -v -dwarf-column-info -coverage-file /home/shenhan/test.c -resource-dir /lib64/../lib64/clang/3.8.0 -internal-isystem /usr/local/include -internal-isystem /lib64/../lib64/clang/3.8.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/shenhan -ferror-limit 19 -fmessage-length 276 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o test.o -x c /home/shenhan/test.c
-cc1: error while loading shared libraries: -cc1: cannot open shared object file
ld-2.19.so: error: unable to execute command: No such file or directory
ld-2.19.so: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.8.0 (/var/cache/chromeos-cache/distfiles/host/egit-src/clang.git 4483c0162c2672fc09fb738e9c683ebde1f146f3) (/var/cache/chromeos-cache/distfiles/host/egit-src/llvm.git fad81ab170b3d422f0aaa15b88157fdb16d3e75d)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
ld-2.19.so: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
ld-2.19.so: error: unable to execute command: No such file or directory
ld-2.19.so: note: diagnostic msg: Error generating preprocessed source(s).
The clang drive is totally confused by the command line that it passes "-cc1" to "ld-2.19.so"...
Comment 1 by bugdroid1@chromium.org
, Apr 12 2016