public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] analyzer: Define INCLUDE_UNIQUE_PTR
@ 2021-09-10  8:01 Maxim Blinov
  2021-09-10 14:38 ` David Malcolm
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Blinov @ 2021-09-10  8:01 UTC (permalink / raw)
  To: gcc-patches

Un-break the build for AArch64 Darwin. Build currently fails with an
error very similar to pr82091:

```
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(+)

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"
-- 
2.30.1 (Apple Git-130)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] analyzer: Define INCLUDE_UNIQUE_PTR
  2021-09-10  8:01 [PATCH] analyzer: Define INCLUDE_UNIQUE_PTR Maxim Blinov
@ 2021-09-10 14:38 ` David Malcolm
  0 siblings, 0 replies; 2+ messages in thread
From: David Malcolm @ 2021-09-10 14:38 UTC (permalink / raw)
  To: Maxim Blinov, gcc-patches

On Fri, 2021-09-10 at 09:01 +0100, Maxim Blinov wrote:
> Un-break the build for AArch64 Darwin. Build currently fails with an
> error very similar to pr82091:
> 
> ```
> 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.  */
> 
> ```

Sorry about the breakage.

Does the patch fix the build for you?

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

Thanks
Dave


> 
> gcc/analyzer/ChangeLog:
>         * engine.cc: Define INCLUDE_UNIQUE_PTR.
> ---
>  gcc/analyzer/engine.cc | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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"



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-10 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10  8:01 [PATCH] analyzer: Define INCLUDE_UNIQUE_PTR Maxim Blinov
2021-09-10 14:38 ` David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).