Percona Server 5.6.35 doesn't build with gcc on OpenIndiana

Bug #1686781 reported by Alexander Pyhalov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Triaged
Low
Unassigned
5.7
Invalid
Undecided
Unassigned

Bug Description

The code introduced since 5.6.33 explicitly forbids building with GCC on SunOS :

--- percona-server-5.6.33-79.0/cmake/os/SunOS.cmake 2016-10-13 14:00:28.000000000 +0300
+++ percona-server-5.6.35-81.0/cmake/os/SunOS.cmake 2017-03-23 16:21:17.000000000 +0300
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,6 +17,33 @@
 INCLUDE(CheckCSourceRuns)
 INCLUDE(CheckCSourceCompiles)

+# We require SunStudio 12u2 (CC 5.11)
+IF(NOT FORCE_UNSUPPORTED_COMPILER)
+ IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
+ # CC -V yields
+ # CC: Studio 12.5 Sun C++ 5.14 SunOS_sparc Dodona 2016/04/04
+ # CC: Sun C++ 5.13 SunOS_sparc Beta 2014/03/11
+ # CC: Sun C++ 5.11 SunOS_sparc 2010/08/13
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_CXX_COMPILER} "-V"
+ OUTPUT_VARIABLE stdout
+ ERROR_VARIABLE stderr
+ RESULT_VARIABLE result
+ )
+ STRING(REGEX MATCH "CC: Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr})
+ IF (NOT CMAKE_MATCH_1 OR CMAKE_MATCH_1 STREQUAL "")
+ STRING(REGEX MATCH "CC: Studio 12\\.5 Sun C\\+\\+ 5\\.([0-9]+)"
+ VERSION_STRING ${stderr})
+ ENDIF()
+ SET(CC_MINOR_VERSION ${CMAKE_MATCH_1})
+ IF(${CC_MINOR_VERSION} LESS 11)
+ MESSAGE(FATAL_ERROR "SunStudio 12u2 or newer is required!")
+ ENDIF()
+ ELSE()
+ MESSAGE(FATAL_ERROR "Unsupported compiler!")
+ ENDIF()
+ENDIF()
+
 # Enable 64 bit file offsets
 SET(_FILE_OFFSET_BITS 64)

@@ -29,7 +56,7 @@

 # CMake defined -lthread as thread flag. This crashes in dlopen
 # when trying to load plugins workaround with -lpthread
-SET(CMAKE_THREADS_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE)
+SET(CMAKE_THREAD_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE)

 # Solaris specific large page support
 CHECK_SYMBOL_EXISTS(MHA_MAPSIZE_VA sys/mman.h HAVE_DECL_MHA_MAPSIZE_VA)
diff -ur percona-server-5.6.33-79.0/cmake/os/WindowsCache.cmake percona-server-5.6.35-81.0/cmake/os/WindowsCache.cmake

We use GCC as primary compiler at OpenIndiana, please, this check should be relaxed.

Tags: upstream
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Is CMake option -DFORCE_UNSUPPORTED_COMPILER=ON a viable workaround?

tags: added: upstream
Changed in percona-server:
status: New → Incomplete
Revision history for this message
Alexander Pyhalov (alp-rsu) wrote :

Yes, I've built it this way, but it's just a workaround. Treating gcc as unsupported compiler is strange.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

OpenIndiana is an unsupported platform for us with either compiler. Please file a bug on bugs.mysql.com. For us, we can accept a PR that removes the fatal error property from "Unsupported compiler!" message added by the above commit in CMake.

Revision history for this message
Olaf Bohlen (olbohlen) wrote :

That is a pity: we use Openindiana Hipster at work just because of percona. We had problems with recent SuSE Linux systems and then went to Hipster because of the good integration...

Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

Version 5.7 supports gcc 4.4+: https://github.com/percona/percona-server/blob/5.7/cmake/os/SunOS.cmake

Comment for the commit which affects version 5.6 says "configuring unit tests fails, we do not recognize developer studio 12.5
build with -DCMAKE_CXX_FLAGS='-std=c++03 -m64' -DCMAKE_C_FLAGS='-m64'

Fix: backport compiler version check in cmake/os/SunOS.cmake from 5.7" But backports was certainly not full. I reported this behavior at https://bugs.mysql.com/bug.php?id=86914

Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

Setting this one to "Confirmed", but title should say something like "Fully backport 5.7 fix into 5.6"

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3690

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.