Update 29.04.2017: A more complete description and solution is presented at:
https://jira.mariadb.org/browse/MDEV-12310
diff -ur mariadb-10.1.22~/mysys/mysys_priv.h mariadb-10.1.22/mysys/mysys_priv.h
--- mariadb-10.1.22~/mysys/mysys_priv.h 2017-03-11 20:09:10.000000000 +0000
+++ mariadb-10.1.22/mysys/mysys_priv.h 2017-04-28 15:48:49.811392259 +0000
@@ -108,7 +108,7 @@
void my_error_unregister_all(void);
-#if !defined(O_PATH) && defined(O_EXEC) / FreeBSD /
+#if !defined(O_PATH) && defined(O_EXEC) && !defined(__sun__) / FreeBSD /
#define O_PATH O_EXEC
#endif
Otherwise mariadb would abort on startup with:
ERROR: 1030 Got error 8 "Exec format error" from storage engine MyISAM