[LLVMbugs] [Bug 8031] New: clang include path on Linux is not found

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 30 15:15:14 PDT 2010


           Summary: clang include path on Linux is not found
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nobled at dreamwidth.org
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=5429)
 --> (http://llvm.org/bugs/attachment.cgi?id=5429)
Fix Clang include path on Linux

Tested in both 2.7 and 2.8svn trunk.

With Clang/LLVM 2.7 packaged for Ubuntu, the compile headers live in
/usr/lib/clang/1.1/include, but running `llvm-clang -print-file-name=include`
just prints:

Which basically means "file not found".

Worse, when compiling, they never seem to get included unless you do it
manually yourself:
llvm-clang -I/usr/lib/clang/1.1/include [...]

Without that, I get errors like:
/usr/include/c++/4.4.3/cstddef:43:10: fatal error: 'stddef.h' file not found
#include <stddef.h>
1 diagnostic generated.


/usr/include/limits.h:125:16: fatal error: 'limits.h' file not found
# include_next <limits.h>
1 diagnostic generated.

The attached patch fixes this by replacing the hardcoded "1.0/include" by using
CLANG_VERSION_STRING. (Though it could probably use a regression test; the
include directory's location is set independently in a couple Makefiles--the
logic could probably be merged into one place somewhere.)

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list