[cfe-dev] [PATCH] header search
mike-m
mikem.llvm at gmail.com
Tue May 4 04:29:57 PDT 2010
Find attached patch which fixes <cstddef> issue on some linux distros and adds
yet more C++ search dirs for various linux distros. Details follow.
1)
Updated C++ include header search paths for various Debian/Ubuntu and Fedora
linux distros. The main changes are static ordering of directories to check
for GNU c++ includes:
- newer versions of libstdc++ are checked for first
- distros listing is reverse chronological order
- more clear that N-distros need the same dir check
Tracking for the following new distros has been added; unless otherwise noted,
all adds have been validated to not break things by building clang selfhost:
- Ubuntu 10.04 LTS 64-bit, 32-bit
- Ubuntu 9.10 32-bit
- Ubuntu 9.04 64-bit
- Ubuntu 8.10 64-bit
- Ubuntu 8.04 LTS 64-bit, 32-bit
- Debian 6.0 64-bit, 32-bit
- Debian 5.0 64-bit, 32-bit
- Fedora 9 64-bit (untested but paths checked with distro rpms)
- Fedora 8 64-bit (untested but paths checked with distro rpms)
2)
Moved clang-builtin include dir position to immediately precede /usr/include,
matching gcc compiler. Fixes #include_next shenanigans that lead to failures
when clang++ is used to compile source with <cstddef>. libstdc++ versions
4.3.0, 4.3.1 and 4.3.2 are at issue, which ship 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.
================================================================================
Comparison of <...> search dirs on ubuntu 8.10:
[note: '*' marks repositioned include dir]
unpatched clang++:
/home/mike/work/llvm/ubuntu/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
/usr/include
patched clang++:
/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/ubuntu/out.debug/Debug/lib/clang/2.0/include
/usr/include
g++:
/usr/include/c++/4.3
/usr/include/c++/4.3/x86_64-linux-gnu
/usr/include/c++/4.3/backward
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/include
/usr/lib/gcc/x86_64-linux-gnu/4.3.2/include-fixed
/usr/include
================================================================================
Comparison of <...> search dirs on darwin 10.3.0:
[note: '*' marks repositioned include dir]
unpatched clang++:
/tank1/work/llvm/ubuntu/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
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
patched clang++:
/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/ubuntu/out.debug/Debug/lib/clang/2.0/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
g++:
/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/local/include
/usr/lib/gcc/i686-apple-darwin10/4.2.1/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
--mike-m
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hsearch0.patch
Type: application/octet-stream
Size: 10426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100504/d055ec4b/attachment.obj>
More information about the cfe-dev
mailing list