[PATCH] header search

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] header search

mike-m
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

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

hsearch0.patch (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] header search

Rafael Espindola
Not sure if I can approve the patch, but I like it a lot. Probably as
good as it gets until we manage to factor this in a config file or
something (and select the default at configure time).

Thanks,
--
Rafael Ávila de Espíndola

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] header search

Chris Lattner
In reply to this post by mike-m
Seems ok to me, please apply, thanks!

-Chris

On May 4, 2010, at 4:29 AM, mike-m wrote:

> 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
> <hsearch0.patch>_______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev