[MDEV-9381] [PATCH] solaris10 build fixes Created: 2016-01-07  Updated: 2016-02-23  Resolved: 2016-02-15

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.0, 10.1
Fix Version/s: 5.5.49

Type: Bug Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

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-8448 cannot build on solaris 10 Sparc Closed
relates to MDEV-8941 Compile on Solaris (SPARC) fails with... Closed

 Description   

modifications to 10.0.23 to get it compiled on solaris 10 (patched up
to current) using the latest solaris-studio compilers (12.4):
 
configuration options used:
 
env \
  CC=cc \
  CFLAGS="-xtarget=ultra2 -xarch=sparcvis -xO4 -xstrconst -mt" \
  LDFLAGS=-s \
  CXX=CC \
  CXXFLAGS="-xtarget=ultra2 -xarch=sparcvis -xO4 -noex -mt" \
    cmake . -L \
      -DCMAKE_INSTALL_PREFIX=/opt/mysql \
      -DINSTALL_SBINDIR=sbin \
      -DDEFAULT_SYSCONFDIR=/opt/mysql/etc \
      -DENABLED_LOCAL_INFILE=1 \
      -DMYSQL_UNIX_ADDR=/tmp/.mysql.sock \
      -DWITH_EXTRA_CHARSETS=complex \
      -DWITH_READLINE=ON \
      -DWITH_MYSQLD_LDFLAGS=-lmtmalloc
gmake
 
 
daemon can be installed, initialized and started, and does
(at least :-) simple things, including handling of innodb databases.
 
test suite passes with a minor handful of failures (some wrt. ipv6,
which is neither configured nor used on the host; some because
of differing error messages; one seems a bug in the test-suite)
 
here is what i had to patch (see pull request), in order of
appearance during build of the server:
 
1)
linking  unittest/strings/strings-t  and  unittest/mysys/my_vsnprintf-t
throws undefined-symbol errors such as
"undefined symbol strdup_root, first referenced in
 CMakeFiles/strings-t.dir/strings-t.c.o"
 
this is solved for me by adding after "../../strings/libstrings.a"
"../../mysys/libmysys.a ../../strings/libstrings.a -lrt"
to the respective cmake-generated CMakeFiles/....dir/link.txt files
 
i changed
  unittest/mysys/CMakeLists.txt, unittest/strings/CMakeLists.txt
such that linkage works.  the change probably should be #ifdef'ed.
 
 
2)
studio-cplusplus seems not to like anonymous structs / unions the way as
gnu-cplusplus does.
this affects Gcalc_heap::Info in
  sql/item_geofunc.h
and it's use in
  sql/item_geofunc.cc, sql/gcalc_slicescan.cc.
 
i rewrote the code to use trivial struct / union names.
 
 
3)
for studio-compiler, when declaring an array, dimensions must be constant.
affected files:
   storage/spider/spd_conn.cc, storage/spider/spd_db_conn.cc,
   storage/spider/spd_ping_table.cc, storage/spider/spd_table.cc,
   storage/spider/spd_trx.cc
 
i rewrote the code to declare a pointer and use alloca()
 
 
4)
studio-compiler uses -W to propagate options to sub-commands of the
compile-process and, in particular, error-terminates on -Wall.
so i had to conditionalize the adding of -W (and -f) options in
  storage/connect/CMakeLists.txt.
 
the attached patch should probably get generalized w.r.t. other compilers.
 
 
5)
another anonymous struct problem in
  storage/connect/xindex.h, storage/connect/xindex.cpp
 
 
6)
had to add a trivial cast in
  storage/connect/maputil.cpp
 
 
7)
studio-cplusplus has problem with template inside struct in
  storage/sphinx/ha_sphinx.cc
 
i rearranged the code, so the template is outside the struct, and a
union is used
 
 
i still get oodles of warnings  "Identifier expected instead of }." (from
enums or initializers like "{ foo, bar, }"), and  "bar hides foo::bar".
oh, well.


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