[cfe-dev] Error: /usr/bin/ld: cannot find -lgcc_s

Santosh Nagarakatte santosh.nagarakatte at gmail.com
Thu Nov 11 10:49:15 PST 2010


Hi all,

I am building bitvisor-1.1, a hypervisor with clang. I am getting the
following error with the trunk while compiling it
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s

I am able to compile it successfully with gcc. I tried with clang-2.8
and I was getting the following error.

"Unsupported asm: input constraint with a matching output constraint
of incompatible type!"

I changed the CC in Makefile to clang -v, I get the following information

clang -v -Wl,-melf_x86_64 -g -nostdlib -Wl,-r -o ccid.o IDMan_CcAtr.o
IDMan_CcIfdhandler.o IDMan_CcInitCard.o IDMan_CcProtocol.o
IDMan_CcReaderControl.o IDMan_CcUsb.o
clang version 2.9 (trunk 118799)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: warning: argument unused during compilation: '-g'
 "/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 ccid.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbegin.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../..
-L/usr/lib/x86_64-linux-gnu -melf_x86_64 -r IDMan_CcAtr.o
IDMan_CcIfdhandler.o IDMan_CcInitCard.o IDMan_CcProtocol.o
IDMan_CcReaderControl.o IDMan_CcUsb.o -lgcc --as-needed -lgcc_s
--no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
clang: error: linker command failed with exit code 1 (use -v to see invocation)



Any suggestions on how I can get clang to compile bitvisor-1.1?

Santosh

--
Santosh G Nagarakatte,
PhD Student,
Computer and Information Science Department
University of Pennsylvania,
Philadelphia-19104
http://www.cis.upenn.edu/~santoshn




More information about the cfe-dev mailing list