[libcxx-commits] [PATCH] D141882: [libc++] Remove #pragma GCC system_header

Hans Wennborg via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 24 07:11:21 PDT 2023


hans added a comment.

In D141882#4132544 <https://reviews.llvm.org/D141882#4132544>, @smeenai wrote:

>> it's just a matter of replacing `-I` with `-isystem` to get the correct behaviour
>
> `-I` is ahead of `-isystem` in the header search path list, so just swapping the flags might not work as expected, since the libc++ headers need to be ordered in a particular way with respect to the resource directory and C library headers (and potentially other platform-specific headers, such as libandroid_support for Android). I'm fine with this change (we'll need to clean up some tech debt, but this is good motivation to get that done); I just wanted to point out that it's not always just as simple as "use `-isystem` instead of `-I`".

This (flag type affecting header search order) broke Chromium's Windows builds when we tried to include libc++ with `-imsvc` (clang-cl's `-isystem` equivalent) last year (crbug.com/1338539). We were never able to find a solution, so if this change lands it will cause us pain.

These pragmas have been in libc++'s header since the initial import. Does anyone know what was the original motivation, and whether or not it still applies?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141882/new/

https://reviews.llvm.org/D141882



More information about the libcxx-commits mailing list