[cfe-commits] clang on Ubuntu 11.04 (natty) 32 bits

Óscar Fuentes ofv at wanadoo.es
Thu Apr 28 20:24:42 PDT 2011


Some weeks ago a patch for supporting Ubuntu 11.04 x86_64 was
applied. However, for i686 clang can't figure out the library paths (the
-L paramaters appear as nonsense relative paths). I
looked at ToolChains.cpp and there it is assumed that on Linux there
exists a directory /usr/lib/gcc/<platform-triple>. On my install there
is no /usr/lib/gcc directory. Creating a /usr/lib/gcc symlink to
/usr/lib/i386-linux-gnu allows me to go further, but then this:

#include <errno.h>

ends with the error message:

/usr/include/linux/errno.h:4:10: fatal error: 'asm/errno.h' file not found

"asm/errno.h" is in the directory /usr/include/i386-linux-gnu. gcc has
that directory on its search list, but clang doesn't.

As a side note, I noticed that clang checks the existence of lots of
directories, including quite a few that doesn't make sense for the
current platform (like those having x86_64 on its name) and adds to the
include search list directories for more than one compiler. In my case
it adds 4.4 and 4.5 (this is an upgraded machine and the previos OS
version came with gcc 4.4, which still is installed). This doesn't look
right at all, considering that the 4.4 header directories are listed
before those corresponding to 4.5, but then clang uses the 4.5 libraries
for linking.

Any pointers on how to configure clang for matching gcc's directory
search list appreciated.




More information about the cfe-commits mailing list