[cfe-commits] [clang] bug + patch: Failed to find -lstdc++ in Ubuntu 11.04 x86

Stepan Dyatkovskiy STPWORLD at yandex.ru
Tue Sep 13 00:35:00 PDT 2011


Hello everybody. I have Ubuntu 11.04 x86 (not _64) installed on my Dell n5010 laptop. And I found that clang++ fails to compile ".cpp" files with next bucket of errors:

/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The reason of this error is..

Most of linux systems places c++ libs in directory like this:
/usr/lib/gcc/<triple>/<version>
e.g.:
/usr/lib/gcc/i686-linux-gnu/4.5.2

But Ubuntu 11.04 has very specific paths of c++ libs:
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/<version>

And of course this path was not taken into account in current clang implementation.
Please find attached patch that fixes this error for review. If it will failed to download - let me know.

Regards,
Stepan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ubuntu11.04.cpplibpaths.patch
Type: application/octet-stream
Size: 1139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110913/bfaa2eec/attachment.obj>


More information about the cfe-commits mailing list