Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc++] Change workaround for init_priority((100)) outside of system…
… headers We had previously been using a different workaround for pretending that we were inside a system header, however it had some undesirable effects on dependency parsing for build systems, as explained in [1]. This patch changes the workaround to use `#pragma GCC system_header`, which shouldn't suffer from the same issue. Unfortunately, it is a lot more verbose. The issue is that `#pragma GCC system_header` is ignored when we are inside a source file, so we have to create a header just for the sake of using it. IMO this seems like an artificial restriction without much benefit, but investigating that is a different story. For now, this should at least solve build system problems at the cost of some readability. [1]: https://reviews.llvm.org/D95972#3178968 Differential Revision: https://reviews.llvm.org/D115334
- Loading branch information
Showing
6 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#pragma GCC system_header | ||
GetSystemTimeInit GetSystemTimeAsFileTimeFunc _LIBCPP_INIT_PRIORITY_MAX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#pragma GCC system_header | ||
_LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#pragma GCC system_header | ||
_LIBCPP_HIDDEN ios_base::Init __start_std_streams _LIBCPP_INIT_PRIORITY_MAX; |