[LLVMdev] clang looking for gold plugin when used with '-emit-llvm' option
Ashok Nalkund
ashoknn at qualcomm.com
Wed May 16 14:47:01 PDT 2012
Hi All,
I built the binaries from the 3.1 final tag
(http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_31/final/ etc) as below:
> ../llvm/configure --enable-targets=host-only --prefix=/local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin
> make install
I notice that I can compile a program using clang as below:
> ashoknn at ashoknn-vm:/local/mnt/workspace/ashoknn/crd/neo/temp/jit$clang test.c
> ashoknn at ashoknn-vm:/local/mnt/workspace/ashoknn/crd/neo/temp/jit$
If I try to generate the bitcode only, it gives an error:
> ashoknn at ashoknn-vm:/local/mnt/workspace/ashoknn/crd/neo/temp/jit$clang -emit-llvm test.c
> /usr/bin/ld: /local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/../lib/LLVMgold.so: error loading plugin
> /usr/bin/ld: /local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/../lib/LLVMgold.so: error in plugin cleanup (ignored)
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> ashoknn at ashoknn-vm:/local/mnt/workspace/ashoknn/crd/neo/temp/jit$
I then ran it with -v option and it produces:
> ashoknn at ashoknn-vm:/local/mnt/workspace/ashoknn/crd/neo/temp/jit$clang -emit-llvm test.c -v
> clang version 3.1 (tags/RELEASE_31/final 156878)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> "/local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -disable-free -main-file-name test.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.21.0.20110327 -momit-leaf-frame-pointer -v -resource-dir /local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/local/include -internal-isystem /local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/../lib/clang/3.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /local/mnt/workspace/ashoknn/crd/neo/temp/jit -ferror-limit 19 -fmessage-length 177 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -fcolor-dia!
gnostics
-o /tmp/test-LU0kNI.o -x c test.c
> clang -cc1 version 3.1 based upon LLVM 3.1 default target x86_64-unknown-linux-gnu
> ignoring nonexistent directory "/include"
> #include "..." search starts here:
> #include <...> search starts here:
> /usr/local/include
> /local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/../lib/clang/3.1/include
> /usr/include/x86_64-linux-gnu
> /usr/include
> End of search list.
> "/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../x86_64-linux-gnu/crti.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/crtbegin.o -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5 -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/usr/lib/x86_64-linux-gnu/../../lib64 -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../.. -L/lib -L/usr/lib -plugin /local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/../lib/LLVMgold.so /tmp/test-LU0kNI.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/l!
ib/x86_6
4-linux-gnu/gcc/x86_64-linux-gnu/4.5/crtend.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5/../../../../x86_64-linux-gnu/crtn.o
> /usr/bin/ld: /local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/../lib/LLVMgold.so: error loading plugin
> /usr/bin/ld: /local/mnt/workspace/ashoknn/crd/neo/llvmsvn/build/bin/bin/../lib/LLVMgold.so: error in plugin cleanup (ignored)
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> ashoknn at ashoknn-vm:/local/mnt/workspace/ashoknn/crd/neo/temp/jit$
Any clues?
TIA,
Ashok
More information about the llvm-dev
mailing list