Opened 3 years ago

Last modified 3 years ago

#64412 assigned defect

mariadb-10.6/7 fails to build on Mojave 10.14.6

Reported by: ArtKoKo Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: mojave Cc:
Port: mariadb-10.6 mariadb-10.7

Description

The reported error is :

:info:build /opt/.../work/server-mariadb-10.7.1/storage/innobase/include/fil0fil.h:1497:11: error: 'asm goto' constructs are not supported yet
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/.../mariadb-10.7/work/build'
:info:build Command failed:  cd "/opt/.../mariadb-10.7/work/build" && /usr/bin/make -j8 -w all VERBOSE=ON 
:info:build Exit code: 2
:error:build Failed to build mariadb-10.7: command execution failed
:debug:build Error code: CHILDSTATUS 10468 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"

Attachments (2)

main.log.zip (79.2 KB) - added by ArtKoKo 3 years ago.
patch-asm_goto.diff (677 bytes) - added by outis 3 years ago.
fix

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by ArtKoKo

Attachment: main.log.zip added

comment:1 in reply to:  description Changed 3 years ago by outis

The code generating the error (in 'server-mariadb-10.7.1/storage/innobase/include/fil0fil.h') is:

#if defined __clang_major__ && __clang_major__ < 10
  /* 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__)
  static_assert(STOPPING == 1U << 31, "compatibility");
  __asm__ goto("lock btsl $31, %0\t\njnc %l1" : : "m" (n_pending)
               : "cc", "memory" : not_stopped);
  return true;
not_stopped:
  return false;
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)

On my own system (which is experiencing this issue), the version info for clang++ used in the build is:

Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Devel/Mac/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

It appears that even though the MariaDB code contends that clang++ 10.+ supports asm goto, the Apple version (a least) does not. LLVM's related bug report and clang 9's release notes both say initial support was created for version 9, which supports MariaDB's statement (I couldn't find anything in the v10.0.0 documents that confirmed whether full support was available). This could be considered a MariaDB bug, but only if they offer support for MacOS. Whether or not it is, a fix in macports would be quite useful (and could always be pushed upstream).

Changed 3 years ago by outis

Attachment: patch-asm_goto.diff added

fix

comment:2 Changed 3 years ago by outis

An initial attempt at a fix, which avoids asm goto if on an Apple platform, is now attached. The first line in the excerpt of fil0fil.h is simply changed to:

#if defined __clang_major__ && (__clang_major__ < 10 || __APPLE__)

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: mariadb removed

Apple clang and open source clang use different version numbering schemes. Open source clang 10 is not the same thing as Apple clang 10.

It would not be correct to check for __APPLE__ here since it is perfectly valid to use either Apple clang or open source clang on Apple platforms. If you want to know if Apple clang is being used, you would check for __apple_build_version__.

Note: See TracTickets for help on using tickets.