Bug #80907 "Unsupported platform" error while building MySQL source code on Z-systems
Submitted: 30 Mar 2016 10:50 Modified: 3 May 2016 11:38
Reporter: Anuja Kamat Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.11 OS:Red Hat (RHEL 6)
Assigned to: CPU Architecture:Any
Tags: s390x, Unsupported platform, z-system

[30 Mar 2016 10:50] Anuja Kamat
Description:
On Z-Systems:  #error "Unsupported platform" is seen while building MySQL 5.7.11 from source code.

Scanning dependencies of target innobase
[ 29%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/api/api0api.cc.o
In file included from /home/test/mysql-server/storage/innobase/include/os0atomic.h:317,
                 from /home/test/mysql-server/storage/innobase/include/ut0ut.h:39,
                 from /home/test/mysql-server/storage/innobase/include/univ.i:593,
                 from /home/test/mysql-server/storage/innobase/include/ha_prototypes.h:32,
                 from /home/test/mysql-server/storage/innobase/api/api0api.cc:27:
/home/test/mysql-server/storage/innobase/include/os0atomic.ic:213:2: error: #error "Unsupported platform"
/home/test/mysql-server/storage/innobase/include/os0atomic.h:68: warning: inline function 'lock_word_t os_atomic_test_and_set(volatile lock_word_t*, lock_word_t)' used but never defined
/home/test/mysql-server/storage/innobase/include/os0atomic.h:80: warning: 'lock_word_t os_atomic_val_compare_and_swap(volatile lock_word_t*, lock_word_t, lock_word_t)' declared 'static' but never defined
gmake[2]: *** [storage/innobase/CMakeFiles/innobase.dir/api/api0api.cc.o] Error 1
gmake[1]: *** [storage/innobase/CMakeFiles/innobase.dir/all] Error 2
gmake: *** [all] Error 2

How to repeat:
Note: The is applicable for System-Z RHEL 6.

git clone https://github.com/mysql/mysql-server.git
cd mysql-server
git checkout 5.7
cmake . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=.
gmake

Suggested fix:
Patch as per https://github.com/mysql/mysql-server/pull/58  

 #endif /* _WIN32 */
  
  #if defined __i386__ || defined __x86_64__ || defined _M_IX86 \
 -    || defined _M_X64 || defined __WIN__
 +    || defined _M_X64 || defined __WIN__ || defined __s390__
  
 #define IB_STRONG_MEMORY_MODEL

-#endif /* __i386__ || __x86_64__ || _M_IX86 || _M_X64 || __WIN__ */
 +#endif /* __i386__ || __x86_64__ || _M_IX86 || _M_X64 || __WIN__ || __s390__ */
  
  /**********************************************************//**
  Atomic compare-and-swap and increment for InnoDB. */
[30 Mar 2016 11:10] MySQL Verification Team
Hello Anuja,

Thank you for the report and contribution.

Thanks,
Umesh
[26 Apr 2016 10:32] Anuja Kamat
Hi Umesh,

Any updates on this.

Thanks,
Anuja Kamat
[3 May 2016 4:32] MySQL Verification Team
Hi Anuja,

Did you submit same contribution in Bug #81281 as well? In that case I'll have to mark one of as duplicate. Please confirm

Thanks,
Umesh
[3 May 2016 11:00] Anuja Kamat
Hi Umesh,

OCA Admin has submitted Bug #81281. It is the same bug.

Regards,
Anuja
[3 May 2016 11:38] MySQL Verification Team
Marking as duplicate of Bug #81281