[MDEV-20178] MariaDB server does not compile on AIX Created: 2019-07-25  Updated: 2020-12-15  Resolved: 2020-12-15

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4.6
Fix Version/s: 10.5.9

Type: Bug Priority: Major
Reporter: Etienne Guesnet Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: None
Environment:

AIX 7.1 PowerPC 8 or more
GCC 8.3 or more
CMake 3.14 Bullfreeware or CMake 3.16 (git master) vanilla


Issue Links:
Blocks
blocks CONC-430 MariaDB connector-c does not compile ... Closed
is blocked by MDEV-19508 Issue with: #define SI_KERNEL in incl... Closed
is blocked by MDEV-22173 OSX built mariadbd cannot connections... Closed
is blocked by MDEV-23892 Fails to compile on platforms that re... Closed
Duplicate
is duplicated by MDEV-24099 Mariadb 10.3.25 Issue with ip_len on AIX Closed

 Description   

MariaDB does not compile or work on AIX 7.1. Tested with GCC 8.3.
Lot of other issues about compiling MariaDB on AIX with xlc.

My goal is to port MariaDB to AIX. For now, MariaDB compiles, and most of the test suite passes (pass: 3084, fail: 39, disabled: 593, skipped: 381, total: 4097). Some plugins are disabled (including Linux only plugins, gamma, beta and experimental, and some dynamics plugins that do not work for now).

It has been build with CMake 3.14 provided by Bullfreeware (patched CMake). CMake now proposes a new behavior for AIX so if it works well I will propose patches compatible with vanilla CMake (3.16 or more).

See CONC-430 for connector-c.

Work in progress at https://github.com/EGuesnet/server/tree/AIX



 Comments   
Comment by Elena Stepanova [ 2019-07-28 ]

So, what is the actual problem? First, you said it doesn't compile, but then you said "for now, MariaDB compiles".

Comment by Etienne Guesnet [ 2019-07-29 ]

MariaDB 10.4.6 vanilla does not compile. There are lot of problems:

  • Undefined symbols due to specific AIX ld
  • Undefined macro (see MDEV-19508)
  • RTOC_L error in debug mod
  • and so on...

I have patched MariaDB in a local version. And this version compiles and most of the tests pass. I will propose patches as soon as CMake 3.16 will be released (new behavior on AIX). I open this issue and a fork in Github as a Work In Progress.

Comment by Fazal Majid [ 2020-05-09 ]

MariaDB 10.5.2 does not compile on Solaris (SmartOS/Illumos) either due to SI_KERNEL, which is a linuxism. I worked around this with the following patch:

mordac ~/build/mariadb-10.5.2/sql>diff -u mysqld.cc

{.dist,}

— mysqld.cc.dist Sat May 9 11:13:54 2020
+++ mysqld.cc Sat May 9 11:14:26 2020
@@ -3124,7 +3124,11 @@
}
break;
case SIGHUP:
+#ifdef SI_KERNEL
if (!abort_loop && origin != SI_KERNEL)
+#else
+ if (!abort_loop)
+#endif
{
int not_used;
mysql_print_status(); // Print some debug info

There are also conflicts due to innodb redefining the system offset, an undefined global variable concurrency if HAVE_THR_SETCONCURRENCY (a Solaris API, if I am not mistaken, although there is a pthread_setconcurrency() equivalent that isn't used in MariaDB, which just calls pthread_dummy() instead). Presumably code that was ripped out of Oracle mysql (which obviously is tested against Solaris) and Mariadb which isn't. Also a number of other issues I worked around.

If the MariaDB team is interested in supporting Solaris and Illumos as platforms, I'll be happy to elaborate. We don't like Oracle any more than you do

Comment by Etienne Guesnet [ 2020-05-11 ]

I think your trouble was the MDEV-19508. It was already corrected by PR-1392.

Comment by RadaKichenin [ 2020-05-21 ]

Hi Etienne Guesnet,

I am trying to compile mariadb (https://github.com/EGuesnet/server/tree/10.4-AIX-vanilla-cmake) on AIX 7.1 using gcc 8.3 and cmake 3.16. So far I was able to do cmake. But make fails repeatedly. Can you please help and let me know what are the step involved in compiling MAriaDB successfuly?

Thanks & Regards
Radakichenin

Comment by Etienne Guesnet [ 2020-05-22 ]

Hi RadaKichenin,
The new branch I am working on is https://github.com/EGuesnet/server/tree/AIX . However, it is based on the 10.5 unstable MariaDB branch.
To compile, you need also to use the patched MariaDB-connector-c, https://github.com/EGuesnet/mariadb-connector-c/tree/AIX .
If you want to compile stable MariaDB on AIX, the simplest way is to use SRPM, that contains stable source, all patches and compilation commands. They are freely available on AIX Toolbox (last is 10.4.8) and Bullfreeeware (last is 10.4.12).
See this page to see how to compile an SRPMS on AIX.
Regards,
Etienne Guesnet.

Comment by RadaKichenin [ 2020-05-22 ]

Hi Etienne Guesnet,

Thank you so much for your guidance. I was aware of the SPRMs for MariaDB. But wanted to compile it from source code for a Training assignment.
I will try compiling https://github.com/EGuesnet/server/tree/AIX after patching the connector-c. If I fail, I will go with the SRPMs ..

Thanks & Regards
Radakichenin

Comment by Daniel Black [ 2020-12-15 ]

Thanks MDEV-23892 and MDEV-19508 still to be fixed but this is a great contribution and thanks for your patience through a very long review process.

Generated at Thu Feb 08 08:57:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.