[v2] analyzer: Define INCLUDE_UNIQUE_PTR

Message ID 20210914083557.15566-1-maxim.blinov@embecosm.com
State Committed
Commit 745781d24cd7562202687cfbe05597ee673d4537
Headers
Series [v2] analyzer: Define INCLUDE_UNIQUE_PTR |

Commit Message

Maxim Blinov Sept. 14, 2021, 8:35 a.m. UTC
  Un-break the build for AArch64 Darwin, see PR bootstrap/102242.  Build
fails with log below:

```
In file included from ../../../gcc-master-wip-apple-si/gcc/analyzer/engine.cc:69:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:678:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/stdexcept:239:5: error: no member named 'fancy_abort' in namespace 'std::__1'; did you mean simply 'fancy_abort'?
    _VSTD::abort();
    ^~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:852:15: note: expanded from macro '_VSTD'

../../../gcc-master-wip-apple-si/gcc/system.h:777:13: note: 'fancy_abort' declared here
extern void fancy_abort (const char *, int, const char *)
            ^
```

Judging from the following comment in gcc/system.h, we just need to
define INCLUDE_UNIQUE_PTR since commit eafa9d96923 added the inclusion
of <memory>:

```
/* Some of the headers included by <memory> can use "abort" within a
   namespace, e.g. "_VSTD::abort();", which fails after we use the
   preprocessor to redefine "abort" as "fancy_abort" below.
   Given that unique-ptr.h can use "free", we need to do this after "free"
   is declared but before "abort" is overridden.  */

```

gcc/analyzer/ChangeLog:
	* engine.cc: Define INCLUDE_UNIQUE_PTR.
---
 gcc/analyzer/engine.cc | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Gerald Pfeifer Sept. 16, 2021, 10:38 p.m. UTC | #1
On Tue, 14 Sep 2021, Maxim Blinov wrote:
> Un-break the build for AArch64 Darwin, see PR bootstrap/102242.  Build
> fails with log below:

David already acked this with

  "Does the patch fix the build for you?

  If so, looks good for trunk.  Please reference PR bootstrap/102242 
  in the ChangeLog entry."

Can you please go ahead and commit this to fix the regression and
bootstrap failure (and add PR bootstrap/102242 to the ChangeLog)?

Oh, I don't see your name in the MAINTAINERS file, so I went ahead
and committed this in your behalf.

(One out of four bootstrap failures gone, hopefully.)

Gerald

PS: It might have made sense to Cc: David on your updated patch and
note that you do not have commit access.
  

Patch

diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 24f0931197d..f21f8e5b78a 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -19,6 +19,7 @@  along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
+#define INCLUDE_UNIQUE_PTR
 #include "system.h"
 #include "coretypes.h"
 #include "tree.h"