]> granicus.if.org Git - clang/commit
Significantly fix Clang's header search for Ubuntu (and possibly other
authorChandler Carruth <chandlerc@gmail.com>
Wed, 27 Aug 2014 08:41:41 +0000 (08:41 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 27 Aug 2014 08:41:41 +0000 (08:41 +0000)
commit08b8fe7867c3ebf729101aa707b381eb53a01626
treead0c38b4e00b49d0ca1830faa380aa891fe8e8cf
parentbbac840f3cb6bfe82f3faac2777352d9dfb06643
Significantly fix Clang's header search for Ubuntu (and possibly other
modern Debian-based distributions) due to on-going multiarch madness.

It appears that when the multiarch heeader search support went into the
clang driver, it went in in a quite bad state. The order of includes
completely failed to match the order exhibited by GCC, and in a specific
case -- when the GCC triple and the multiarch triple don't match as with
i686-linux-gnu and i386-linux-gnu -- we would absolutely fail to find
the libstdc++ target-specific header files.

I assume that folks who have been using Clang on Ubuntu 32-bit systems
have been applying weird patches to hack around this. I can't imagine
how else it could have worked. This was originally reported by a 64-bit
operating system user who had a 32-bit crosscompiler installed. We tried
to use that rather than the bi-arch support of the 64-bit compiler, but
failed due to the triple differences.

I've corrected all the wrong orderings in the existing tests and added
a specific test for the multiarch triple strings that are different in
a significant way. This should significantly improve the usability of
Clang when checked out vanilla from upstream onto Ubuntu machines with
an i686 GCC installation for whatever reason.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216531 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/lib/i386-linux-gnu/.keep [new file with mode: 0644]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/lib/x86_64-linux-gnu/.keep [new file with mode: 0755]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/usr/include/c++/4.8/backward/.keep [new file with mode: 0755]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/usr/include/i386-linux-gnu/c++/4.8/.keep [new file with mode: 0644]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/usr/include/x86_64-linux-gnu/c++/4.8/32/.keep [new file with mode: 0755]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/usr/lib/gcc/i686-linux-gnu/4.8/crtbegin.o [new file with mode: 0644]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/usr/lib/gcc/x86_64-linux-gnu/4.8/32/crtbegin.o [new file with mode: 0755]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o [new file with mode: 0755]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/usr/lib/i386-linux-gnu/.keep [new file with mode: 0644]
test/Driver/Inputs/ubuntu_14.04_multiarch_tree2/usr/lib/x86_64-linux-gnu/.keep [new file with mode: 0644]
test/Driver/linux-header-search.cpp