]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
modules : Make sure we include <map> in system.h.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 30 Mar 2021 13:56:39 +0000 (14:56 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 1 Apr 2021 18:32:16 +0000 (19:32 +0100)
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
gcc/cp/mapper-client.cc
gcc/cp/mapper-resolver.cc

index 19339125b261c8b2ddf9a7b87817c8a6a04c58cb..a9547bf6994002351219f355534878a8360be5ef 100644 (file)
@@ -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 <string>
 #include <map>
+#endif
 
 // This is a GCC class, so GCC coding conventions on new bits.  
 class module_resolver : public Cody::Resolver
index 774e2b2b095c6a4f6b5aef37e800a1f827921655..b9e02168d550970054fbc54a94fc970196f6a78e 100644 (file)
@@ -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"
index bcf6c8871e5f48a41e6957d6683d514180e227b1..db443fb4948c4c70adeb2bc1785d34fcf4ef975f 100644 (file)
@@ -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