[MDEV-8448] cannot build on solaris 10 Sparc Created: 2015-07-10  Updated: 2016-02-17  Resolved: 2016-02-15

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.0.20-galera, 5.5, 10.0, 10.1
Fix Version/s: 5.5.49, 10.0.24, 10.1.12

Type: Bug Priority: Major
Reporter: VILTARD Pascal Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: SPARC
Environment:

Solaris Sparc 64 bits, Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
SolarisStudio 12.3 opencsw packages and SunFreeware packages


Attachments: Text File make error.txt    
Issue Links:
Relates
relates to MDEV-88 use of anonymous unions and structs i... Closed
relates to MDEV-4976 errors in gcalc_slicescan.h / Solaris Closed
relates to MDEV-8941 Compile on Solaris (SPARC) fails with... Closed
relates to MDEV-9381 [PATCH] solaris10 build fixes Closed
Sprint: 5.5.48-0

 Description   

download mariadb-10.0.20
./configure
make 
[ 12%] Built target strings
Scanning dependencies of target strings-t
[ 12%] Building C object unittest/strings/CMakeFiles/strings-t.dir/strings-t.c.o
Linking C executable strings-t
Undefined                    first referenced
 symbol                             in file
rw_pr_rdlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_unlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_wrlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_destroy                       CMakeFiles/strings-t.dir/strings-t.c.o
PSI_server                          CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_init                          CMakeFiles/strings-t.dir/strings-t.c.o
strdup_root                         CMakeFiles/strings-t.dir/strings-t.c.o
ld: fatal: symbol referencing errors. No output written to strings-t
make[2]: *** [unittest/strings/strings-t] Error 2
make[1]: *** [unittest/strings/CMakeFiles/strings-t.dir/all] Error 2
make: *** [all] Error 2



 Comments   
Comment by Elena Stepanova [ 2015-07-12 ]

serg,
Do we still pretend on supporting Solaris Sparc?

Comment by VILTARD Pascal [ 2015-07-14 ]

I see "MDEV-5268 cannot build on Solaris 11 x86" I try it but some troubles. So I create this jira.
Pascal

Comment by VILTARD Pascal [ 2015-07-14 ]

and https://mariadb.com/kb/en/mariadb/buildbot-setup-for-solaris-sparc/
???

Comment by Sergei Golubchik [ 2015-07-16 ]

We don't have a Sparc builder at the moment. If you have a fix for this issue, we'll be happy to apply it. Otherwise it'll have to wait until we get a Sparc builder.

Comment by VILTARD Pascal [ 2015-08-11 ]

strings-t.dir/strings-t.c contents : my_sys.h
include/my_sys.h contents : my_pthread.h
include\my_pthread.h contents : extern int rw_pr_rdlock(rw_pr_lock_t *); @ 567

and in CMakeLists.txt we have :
@ line 377
INCLUDE(maintainer)

IF(WITH_UNIT_TESTS)
ENABLE_TESTING()
ADD_SUBDIRECTORY(unittest/mytap)
ADD_SUBDIRECTORY(unittest/strings) *breaks*
compile unittest/strings-t.c

and after
@ line 401 : ADD_SUBDIRECTORY(mysys)

Comment by Sergei Golubchik [ 2015-08-11 ]

Are you trying to describe a fix? I don't understand what we need to change, sorry. Could you please create a patch (unified diff) and attach it to this bug report? Thanks!

Comment by VILTARD Pascal [ 2015-12-13 ]

Hello Sergei,

I do not forget you.

I have troubles to go up a server Zope on Sparc 10 Solaris (openCSW , python and certificates).
So I decide to stop for a moment Solaris 10.

I had health worries, not much time of free. I bought a x5120 to install Solaris x86.
and I try to open the internet connection.

Pascal.

----- Mail original -----
De: "Sergei Golubchik (JIRA)" <jira@mariadb.atlassian.net>
À: pviltard@free.fr
Envoyé: Samedi 12 Décembre 2015 13:45:00
Objet: [JIRA] (MDEV-8448) cannot build on solaris 10 Sparc

[ https://mariadb.atlassian.net/browse/MDEV-8448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergei Golubchik updated MDEV-8448:
-----------------------------------
Priority: Major (was: Minor)


This message was sent by Atlassian JIRA
(v7.1.0-OD-02-030#71001)

Comment by Sergei Golubchik [ 2015-12-13 ]

No-no, don't worry. I've increased the priority because we've got a set of contributed patches for fixing compilation issues on Sparc. The priority is a reminder for me, not for you. And we do have a Sparc builder now. I suspect you can now simply wait until this issue is closed, and in the next release the compilation on Sparc will work.

Comment by Elena Stepanova [ 2016-01-03 ]

Also fails in buildbot, looks the same: http://buildbot.askmonty.org/buildbot/builders/sol10-sparc/builds/347/steps/compile/logs/stdio

gmake[2]: Entering directory `/u0/people/bbt/mdb/solaris-sparc/build/mariadb-5.5.47'
Undefined			first referenced
 symbol  			    in file
rw_pr_rdlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_unlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_wrlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_destroy                       CMakeFiles/strings-t.dir/strings-t.c.o
PSI_server                          CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_init                          CMakeFiles/strings-t.dir/strings-t.c.o
[  8%] Building C object mysys/CMakeFiles/mysys.dir/charset-def.c.o
[  8%] Building C object mysys/CMakeFiles/mysys.dir/checksum.c.o
[  8%] Building C object mysys/CMakeFiles/mysys.dir/array.c.o
[  8%] Building C object mysys/CMakeFiles/mysys.dir/charset.c.o
strdup_root                         CMakeFiles/strings-t.dir/strings-t.c.o
ld: fatal: symbol referencing errors. No output written to strings-t

I've added 5.5 to 'Fix version(s)', because the build is currently attempted on 5.5 in buildbot. We might choose not to fix it for 5.5, but then we need to disable the build.

Comment by Elena Stepanova [ 2016-01-05 ]

On 10.1 it's a bit different:

cc: Warning: -s conflicts with -xdebuginfo=line,param,variable,tagtype,codetag,decl. -s turned off
Undefined			first referenced
 symbol  			    in file
encryption_handler                  CMakeFiles/comp_sql.dir/comp_sql.c.o
ld: fatal: symbol referencing errors. No output written to comp_sql
gmake[2]: *** [scripts/comp_sql] Error 2
gmake[2]: Leaving directory `/u0/people/bbt/mdb/solaris-sparc/build/mariadb-10.1.10'
gmake[1]: *** [scripts/CMakeFiles/comp_sql.dir/all] Error 2

http://buildbot.askmonty.org/buildbot/builders/sol10-sparc/builds/349/steps/compile/logs/stdio

Comment by Sergei Golubchik [ 2016-02-09 ]

Ok, this happens because of the following:

  • We compile with CFLAGS="... -xO4... "
  • That goes into CMAKE_C_FLAGS
  • CMAKE_BUILD_TYPE is not set, so it is RelWithDebInfo by default
  • CMAKE_C_FLAGS_RELWITHDEBINFO has -xO2 by default.
  • On the compiler line CMAKE_C_FLAGS_RELWITHDEBINFO is added after CMAKE_C_FLAGS, so compiler works with -xO2
  • cc from sun studio apparently only supports function inlining at -xO4
  • we have a check for a working inline keyword in configure.cmake, but these tests only use CMAKE_C_FLAGS
  • So the inline test passes (under -xO4), but compilation fails (under -xO2)

As a workaround, one can set cmake -DCMAKE_C_FLAGS_RELWITHDEBINFO="... -xO4..."

Also I'll try to fix the configure.cmake check to detect that inline is broken at configure time, not during compilation

Comment by Sergei Golubchik [ 2016-02-09 ]

Having fixed the above, the next error is

"sql/gcalc_slicescan.h", line 191: Warning: Anonymous struct is being declared.
"sql/gcalc_slicescan.h", line 202: Warning: Anonymous struct is being declared.
"sql/gcalc_slicescan.h", line 208: Warning: Anonymous struct is being declared.
"sql/gcalc_slicescan.h", line 209: Warning: Types cannot be declared in anonymous union.
"sql/gcalc_slicescan.h", line 212: Error: The name Gcalc_heap::Info::union::___AUD is unusable except in a non-static member function.
"sql/gcalc_slicescan.h", line 214: Error: The name Gcalc_heap::Info::union::___AUD is unusable except in a non-static member function.
"sql/gcalc_slicescan.h", line 386: Error: The name Gcalc_heap::Info::union::___AUD is unusable except in a non-static member function.
3 Error(s) and 4 Warning(s) detected.

Comment by Friedrich Haubensak [ 2016-02-16 ]

trying to compile mariadb-5.5.48 out of the box using

cmake . -L \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DCMAKE_C_COMPILER=cc \
  -DCMAKE_CXX_COMPILER=CC \
  -DCMAKE_C_FLAGS_RELWITHDEBINFO='-g -DNDEBUG -xtarget=ultra2 -xarch=sparcvis -xO4 -xstrconst -mt' \
  -DCMAKE_CXX_FLAGS_RELWITHDEBINFO='-g -DNDEBUG -xtarget=ultra2 -xarch=sparcvis -xO4 -noex -mt' \
  -DCMAKE_INSTALL_PREFIX=/opt/fli/mysql \
  -DINSTALL_SBINDIR=sbin \
  -DDEFAULT_SYSCONFDIR=/opt/fli/mysql/etc \
  -DENABLED_LOCAL_INFILE=1 \
  -DMYSQL_UNIX_ADDR=/tmp/.mysql.sock \
  -DWITH_EXTRA_CHARSETS=complex \
  -DWITH_READLINE=ON \
  -DWITH_MYSQLD_LDFLAGS=-lmtmalloc

indeed prevents -xO2 from sneaking in into options that are actually used in compiling, but the linker error

Undefined sumbol			first referenced in file
rw_pr_rdlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_unlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_wrlock                        CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_destroy                       CMakeFiles/strings-t.dir/strings-t.c.o
PSI_server                          CMakeFiles/strings-t.dir/strings-t.c.o
rw_pr_init                          CMakeFiles/strings-t.dir/strings-t.c.o
strdup_root                         CMakeFiles/strings-t.dir/strings-t.c.o
ld: fatal: symbol referencing errors. No output written to strings-t
gmake[2]: *** [unittest/strings/strings-t] Error 2

is still showing up

Comment by Sergei Golubchik [ 2016-02-16 ]

RIght, my comment was incomplete. Also -g disables inlining. But it now works in buldbot. We use this command:

export LDFLAGS=-s
cmake . -L -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_C_COMPILER=cc \
        -DCMAKE_CXX_COMPILER=CC \
        -DCMAKE_C_FLAGS_RELEASE="'-DNDEBUG -xtarget=ultra2 -xarch=sparcvis -xO4 -xstrconst -mt'" \
        -DCMAKE_CXX_FLAGS_RELEASE="'-DNDEBUG -xtarget=ultra2 -xarch=sparcvis -xO4 -noex -mt'" \
        -DCMAKE_INSTALL_PREFIX=/opt/fli/mysql \
        -DINSTALL_SBINDIR=sbin \
        -DDEFAULT_SYSCONFDIR=/opt/fli/mysql/etc \
        -DENABLED_LOCAL_INFILE=1 \
        -DMYSQL_UNIX_ADDR=/tmp/.mysql.sock \
        -DWITH_EXTRA_CHARSETS=complex \
        -DWITH_MYSQLD_LDFLAGS=-lmtmalloc

Note, I no longer set CC, CXX, CFLAGS and CXXFLAGS in the
environment.

Comment by VILTARD Pascal [ 2016-02-17 ]

Hello,

You went faster.
I am going to test it in the next days.

Best Regards,
Pascal

----- Mail original -----
De: "Sergei Golubchik (JIRA)" <jira@mariadb.atlassian.net>
À: pviltard@free.fr
Envoyé: Mardi 16 Février 2016 16:37:00
Objet: [JIRA] (MDEV-8448) cannot build on solaris 10 Sparc

[ https://mariadb.atlassian.net/browse/MDEV-8448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=80935#comment-80935 ]

Sergei Golubchik commented on MDEV-8448:
----------------------------------------

RIght, my comment was incomplete. Also -g disables inlining. But it now works in buldbot. We use this command:

export LDFLAGS=-s
cmake . -L -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_C_COMPILER=cc \
        -DCMAKE_CXX_COMPILER=CC \
        -DCMAKE_C_FLAGS_RELEASE="'-DNDEBUG -xtarget=ultra2 -xarch=sparcvis -xO4 -xstrconst -mt'" \
        -DCMAKE_CXX_FLAGS_RELEASE="'-DNDEBUG -xtarget=ultra2 -xarch=sparcvis -xO4 -noex -mt'" \
        -DCMAKE_INSTALL_PREFIX=/opt/fli/mysql \
        -DINSTALL_SBINDIR=sbin \
        -DDEFAULT_SYSCONFDIR=/opt/fli/mysql/etc \
        -DENABLED_LOCAL_INFILE=1 \
        -DMYSQL_UNIX_ADDR=/tmp/.mysql.sock \
        -DWITH_EXTRA_CHARSETS=complex \
        -DWITH_MYSQLD_LDFLAGS=-lmtmalloc

Note, I no longer set CC, CXX, CFLAGS and CXXFLAGS in the
environment.


This message was sent by Atlassian JIRA
(v7.1.0-OD-06-005#71002)

Generated at Thu Feb 08 07:27:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.