Driver: Don't look for libc++ headers in the install directory on Android.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 6 Dec 2019 23:54:47 +0000 (15:54 -0800)
committerPeter Collingbourne <peter@pcc.me.uk>
Sat, 7 Dec 2019 02:24:23 +0000 (18:24 -0800)
commit198fbcb817492ff45946e3f7517de15e8cdf0607
treef514b38c1e89980057a7e1b12816685862d2cecc
parent7ac966240184e604c03a7caf62f070ebb2977498
Driver: Don't look for libc++ headers in the install directory on Android.

The NDK uses a separate set of libc++ headers in the sysroot. Any headers
in the installation directory are not going to work on Android, not least
because they use a different name for the inline namespace (std::__1 instead
of std::__ndk1).

This effectively makes it impossible to produce a single toolchain that is
capable of targeting both Android and another platform that expects libc++
headers to be installed in the installation directory, such as Mac.

In order to allow this scenario to work, stop looking for headers in the
install directory on Android.

Differential Revision: https://reviews.llvm.org/D71154
clang/lib/Driver/ToolChains/Linux.cpp
clang/test/Driver/android-no-installed-libcxx.cpp [new file with mode: 0644]
clang/test/Driver/stdlibxx-isystem.cpp