Commit f0f5ce58 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-27402 'asm goto' is not supported on Apple Xcode 9.4.1

Even though Apple Xcode is based on and similar to Clang,
it does not support the asm goto construct which was added
in commit 668a5f3d (MDEV-26720)
to work around a compiler deficiency that results in suboptimal
code being generated for IA-32 and AMD64.

We will disable this manual optimization if __APPLE_CC__ is defined.

Similar constructs are also used in sync/srw_lock.cc, but that code
is not used on Apple, because we have not implemented a Linux futex
compatible interface on Apple macOS.

Thanks to Valerii Kravchuk for reporting and testing this.
parent 48b974b2
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2021, MariaDB Corporation.
Copyright (c) 2013, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -1545,7 +1545,7 @@ inline void fil_space_t::reacquire()
inline bool fil_space_t::set_stopping_check()
{
mysql_mutex_assert_owner(&fil_system.mutex);
#if defined __clang_major__ && __clang_major__ < 10
#if (defined __clang_major__ && __clang_major__ < 10) || defined __APPLE_CC__
/* Only clang-10 introduced support for asm goto */
return n_pending.fetch_or(STOPPING, std::memory_order_relaxed) & STOPPING;
#elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment