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"


Reply via email to