Details
- 
    
Bug
 - 
    Status: Closed (View Workflow)
 - 
    
Major
 - 
    Resolution: Fixed
 - 
    10.6, 10.7(EOL), 10.8(EOL)
 - 
    macOS 10.13.6 (High Sierra) with Xcode 9.4.1
 
Description
I get the following error while trying to build current MariaDB Server 10.6 or 10.7 from GitHub on macOS High Sierra:
					[ 43%] Building C object storage/heap/CMakeFiles/heap.dir/hp_update.c.o
			 | 
		
					[ 43%] Building C object storage/heap/CMakeFiles/heap.dir/hp_write.c.o
			 | 
		
					[ 43%] Linking CXX static library libheap.a
			 | 
		
					[ 43%] Built target heap
			 | 
		
					[ 43%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/btr/btr0btr.cc.o
			 | 
		
					In file included from /Users/Valerii/git/server/storage/innobase/btr/btr0btr.cc:28:
			 | 
		
					In file included from /Users/Valerii/git/server/storage/innobase/include/btr0btr.h:31:
			 | 
		
					In file included from /Users/Valerii/git/server/storage/innobase/include/dict0dict.h:32:
			 | 
		
					In file included from /Users/Valerii/git/server/storage/innobase/include/dict0mem.h:45:
			 | 
		
					In file included from /Users/Valerii/git/server/storage/innobase/include/buf0buf.h:33:
			 | 
		
					/Users/Valerii/git/server/storage/innobase/include/fil0fil.h:1497:11: error:
			 | 
		
					      'asm goto' constructs are not supported yet
			 | 
		
					  __asm__ goto("lock btsl $31, %0\t\njnc %l1" : : "m" (n_pending)
			 | 
		
					          ^
			 | 
		
					1 error generated.
			 | 
		
					make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/btr/btr0btr.cc.o] Error 1
			 | 
		
					make[1]: *** [storage/innobase/CMakeFiles/innobase.dir/all] Error 2
			 | 
		
					make: *** [all] Error 2
			 | 
		
					Yuliyas-Air:buildtmp Valerii$
			 | 
		
Server was built like this (similar 10.3-105 builds go without such a problem):
					Yuliyas-Air:buildtmp Valerii$ pwd
			 | 
		
					/Users/Valerii/git/server/buildtmp
			 | 
		
					Yuliyas-Air:buildtmp Valerii$ cmake .. -DCMAKE_INSTALL_PREFIX=/Users/Valerii/dbs/maria10.7 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF -DPLUGIN_TOKUDB=NO -DWITH_SSL=system -DENABLE_DTRACE=1
			 | 
		
Some more details about the environment:
					Yuliyas-Air:server Valerii$ git branch
			 | 
		
					  10.2
			 | 
		
					  10.3
			 | 
		
					  10.4
			 | 
		
					  10.5
			 | 
		
					  10.6
			 | 
		
					* 10.7
			 | 
		
					  10.8
			 | 
		
					Yuliyas-Air:server Valerii$ git log -1
			 | 
		
					commit 9f2a6bbe6ba03ca5297cd37b75301d05eb44e044 (HEAD -> 10.7, origin/bb-10.7-MDEV-27316, origin/10.7)
			 | 
		
					Author: Thirunarayanan Balathandayuthapani <thiru@mariadb.com>
			 | 
		
					Date:   Thu Dec 23 12:50:00 2021 +0530
			 | 
		
| 
					 | 
		
					    MDEV-27316 Assertion `!(index)->is_spatial()' failed
			 | 
		
| 
					 | 
		
					      This issue is caused by MDEV-24621
			 | 
		
					    (commit 045757af4c301757ba449269351cc27b1691a7d6).
			 | 
		
					    InnoDB tries to insert the number of rows into an empty spatial
			 | 
		
					    index table, but it fails to apply the buffered insert.
			 | 
		
					    InnoDB should insert into the spatial index directly instead of
			 | 
		
					    buffering the insert operation.
			 | 
		
					Yuliyas-Air:server Valerii$ gcc --version
			 | 
		
					Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
			 | 
		
					Apple LLVM version 10.0.0 (clang-1000.10.44.4)
			 | 
		
					Target: x86_64-apple-darwin17.7.0
			 | 
		
					Thread model: posix
			 | 
		
					InstalledDir: /Library/Developer/CommandLineTools/usr/bin
			 | 
		
					Yuliyas-Air:server Valerii$
			 | 
		
Quick check of the source code:
| 
					 | 
		
					1487 /** Note that operations on the tablespace must stop.
			 | 
		
					1488 @return whether the operations were already stopped */
			 | 
		
					1489 inline bool fil_space_t::set_stopping_check()
			 | 
		
					1490 {
			 | 
		
					1491   mysql_mutex_assert_owner(&fil_system.mutex);
			 | 
		
					1492 #if defined __clang_major__ && __clang_major__ < 10
			 | 
		
					1493   /* Only clang-10 introduced support for asm goto */
			 | 
		
					1494   return n_pending.fetch_or(STOPPING, std::memory_order_relaxed) & STOPPING     ;
			 | 
		
					1495 #elif defined __GNUC__ && (defined __i386__ || defined __x86_64__)
			 | 
		
					1496   static_assert(STOPPING == 1U << 31, "compatibility");
			 | 
		
					1497   __asm__ goto("lock btsl $31, %0\t\njnc %l1" : : "m" (n_pending)
			 | 
		
					1498                : "cc", "memory" : not_stopped);
			 | 
		
					1499   return true;
			 | 
		
					1500 not_stopped:
			 | 
		
					1501   return false;
			 | 
		
					1502 #elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
			 | 
		
					1503   static_assert(STOPPING == 1U << 31, "compatibility");
			 | 
		
					1504   return _interlockedbittestandset(reinterpret_cast<volatile long*>
			 | 
		
					1505                                    (&n_pending), 31);
			 | 
		
					1506 #else
			 | 
		
					...
			 | 
		
seems to hint that the check for clang 10+ version is NOT enough for macOS 10.1.3.x and Xcode 9.4.1 case.
Attachments
Issue Links
- is caused by
 - 
                    
MDEV-26720 Suboptimal translation of single-bit std::atomic::fetch_or() and fetch_and()
-         
 - Closed
 
 -