From af78514a18ca5c9aaa10813bb4dc639d7ccdf0cc Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Tue, 30 Mar 2021 14:56:39 +0100 Subject: [PATCH] modules : Make sure we include in system.h. It appears that many targets include the map header transitively in other std headers included from system.h. However there are some editions of clang/libc++ in Xcode that do not, which results in a bootstrap fail - since when resolver.h is included there is then a conflict in declaring abort(). The fix is to ensure that map is pulled in by system.h and before resolver.h is included. As a precautionary measure and to alert anyone perhaps adding another header to resolver.h this patch also gates the direct includes there on !IN_GCC. c++tools/ChangeLog: * resolver.h: Do not include std headers directly when building in GCC. gcc/cp/ChangeLog: * mapper-client.cc (INCLUDE_MAP): New; require map to be included from system.h. * mapper-resolver.cc (INCLUDE_MAP): Likewise. --- c++tools/resolver.h | 2 ++ gcc/cp/mapper-client.cc | 1 + gcc/cp/mapper-resolver.cc | 1 + 3 files changed, 4 insertions(+) diff --git a/c++tools/resolver.h b/c++tools/resolver.h index 1933912..a9547bf 100644 --- a/c++tools/resolver.h +++ b/c++tools/resolver.h @@ -24,8 +24,10 @@ along with GCC; see the file COPYING3. If not see // Mapper interface for client and server bits #include "cody.hh" // C++ +#if !IN_GCC #include #include +#endif // This is a GCC class, so GCC coding conventions on new bits. class module_resolver : public Cody::Resolver diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc index 774e2b2..b9e0216 100644 --- a/gcc/cp/mapper-client.cc +++ b/gcc/cp/mapper-client.cc @@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see #endif #define INCLUDE_STRING #define INCLUDE_VECTOR +#define INCLUDE_MAP #include "system.h" #include "line-map.h" diff --git a/gcc/cp/mapper-resolver.cc b/gcc/cp/mapper-resolver.cc index bcf6c88..db443fb 100644 --- a/gcc/cp/mapper-resolver.cc +++ b/gcc/cp/mapper-resolver.cc @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see #define INCLUDE_STRING #define INCLUDE_VECTOR #define INCLUDE_ALGORITHM +#define INCLUDE_MAP #include "system.h" // We don't want or need to be aware of networking -- 2.7.4