[cfe-commits] [Request for approval] header search (2)

mike-m mikem.llvm at gmail.com
Wed May 12 14:18:40 PDT 2010


DESCRIPTION:
  Moved clang-builtin include dir position to immediately precede C includes.
  This aligns with how gcc compiler does things. Fixes #include_next
  shenanigans that lead to failures when clang++ is used to compile source
  with <cstddef>. Specifically, libstdc++ versions 4.3.[012] is at issue,
  which ships bundled on Debian 5.04, Ubuntu 8.10 and Fedora 10.

  Example error from Ubuntu 8.10:

  > /usr/include/c++/4.3/cstddef:47:15: fatal error: 'stddef.h' file not found
  > #include_next <stddef.h>
  >               ^
  > 1 error generated.

HISTORY:
  The previous version of this patch broke buildbot 'clang-i686-xp-msvc9'.
  This version addresses that issue but has not been tested. I'm hoping to
  apply this patch, and watch the build bots closely. If it fails,
  I'll revert patch.

TESTING:
  This patch passes lit tests and was tested on the following platforms
  to compile with <cstddef> and a small diff shows how include-ordering
  has changed.


======================================================================
== darwin10
======================================================================
 #include <...> search starts here:
- /tank1/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include/c++/4.2.1
  /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64
  /usr/include/c++/4.2.1/backward
  /usr/include/c++/4.0.0
  /usr/include/c++/4.0.0/i686-apple-darwin8
  /usr/include/c++/4.0.0/backward
  /usr/local/include
+ /tank1/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include
  /System/Library/Frameworks (framework directory)
  /Library/Frameworks (framework directory)
 End of search list.


======================================================================
== ubuntu1004
======================================================================
 #include <...> search starts here:
- /home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include/c++/4.4
  /usr/include/c++/4.4/x86_64-linux-gnu
  /usr/include/c++/4.4/backward
  /usr/local/include
+ /home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include
 End of search list.


======================================================================
== ubuntu1004 (32-bit)
======================================================================
 #include <...> search starts here:
- /home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include/c++/4.4
  /usr/include/c++/4.4/backward
  /usr/include/c++/4.4/i486-linux-gnu
  /usr/local/include
+ /home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include
 End of search list.


======================================================================
== fedora12
======================================================================
 #include <...> search starts here:
- /home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include/c++/4.4.3
  /usr/include/c++/4.4.3/x86_64-redhat-linux
  /usr/include/c++/4.4.3/backward
  /usr/local/include
+ /home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include
 End of search list.


======================================================================
== debian504
======================================================================
 #include <...> search starts here:
- /home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include/c++/4.3
  /usr/include/c++/4.3/x86_64-linux-gnu
  /usr/include/c++/4.3/backward
  /usr/local/include
+ /home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include
 End of search list.


======================================================================
== freebsd80
======================================================================
 #include <...> search starts here:
- /usr/home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include/c++/4.2
  /usr/include/c++/4.2/backward
  /usr/local/include
+ /usr/home/mike/work/llvm/hsearch2/out.debug/Debug/lib/clang/2.0/include
  /usr/include
 End of search list.

--mike-m
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hsearch2.patch
Type: application/octet-stream
Size: 3707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100512/7f26b510/attachment.obj>
-------------- next part --------------



More information about the cfe-commits mailing list