Bug #72177 cannot build mysql on Solaris
Submitted: 1 Apr 2014 7:03 Modified: 22 Apr 2018 21:00
Reporter: Eugene Zheganin Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.6.17 OS:Solaris (Solaris 11.1 SRU 17.5)
Assigned to: CPU Architecture:Any
Tags: solaris libnsl

[1 Apr 2014 7:03] Eugene Zheganin
Description:
Cannot build mysql on Solaris.
Solaris 11.1 SRU 17.5
GCC 4.5.2
Cmake 2.8.11.2

[...]
Scanning dependencies of target mysys_ssl
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/crypt_genhash_impl.cc.o
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_default.cc.o                                           
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_getopt.cc.o                                            
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_aes.cc.o                                               
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_sha1.cc.o                                              
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_sha2.cc.o                                              
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_md5.cc.o                                               
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_rnd.cc.o                                               
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_murmur3.cc.o                                           
[ 20%] Building CXX object mysys_ssl/CMakeFiles/mysys_ssl.dir/my_aes_yassl.cc.o                                         
Linking CXX static library libmysys_ssl.a
[ 20%] Built target mysys_ssl
Scanning dependencies of target comp_err
[ 20%] Building C object extra/CMakeFiles/comp_err.dir/comp_err.c.o
Linking CXX executable comp_err
Undefined                    first referenced
 symbol                             in file
recv                                yassl/libyassl.a(socket_wrapper.cpp.o)
send                                yassl/libyassl.a(socket_wrapper.cpp.o)
shutdown                            yassl/libyassl.a(socket_wrapper.cpp.o)
ld: fatal: symbol referencing errors. No output written to comp_err
collect2: ld returned 1 exit status
gmake[2]: *** [extra/comp_err] Error 1
gmake[1]: *** [extra/CMakeFiles/comp_err.dir/all] Error 2
gmake: *** [all] Error 2

How to repeat:
Get mysql 5.6.17 sources.
Unpack them.
Cwd to the sources directory, get an gcc and cmake.

Issue the following set of commands:

export CFLAGS="-g -m64"
export LDFLAGS="-g -m64"
export CXXFLAGS="-g -m64"
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DENABLE_DTRACE=yes .

and wait for the crash to happen.

Suggested fix:
Add -lsocket -lnsl to a extra/CMakeFiles/comp_err.dir/link.txt file, and the build continues.

I guess same behaviour may be achieved by setting LDFLAGS.
[1 Apr 2014 7:10] Eugene Zheganin
Similar error happens later, so I guess setting proper LDFLAGS is mandatory until this will be fixed:

[...]
Linking CXX static library libmyisam_embedded.a
[ 73%] Built target myisam_embedded
Scanning dependencies of target myisam_ftdump
[ 73%] Building C object storage/myisam/CMakeFiles/myisam_ftdump.dir/myisam_ftdump.c.o
Linking CXX executable myisam_ftdump
Undefined                    first referenced
 symbol                             in file
recv                                ../../extra/yassl/libyassl.a(socket_wrapper.cpp.o)
send                                ../../extra/yassl/libyassl.a(socket_wrapper.cpp.o)
shutdown                            ../../extra/yassl/libyassl.a(socket_wrapper.cpp.o)
ld: fatal: symbol referencing errors. No output written to myisam_ftdump
collect2: ld returned 1 exit status
gmake[2]: *** [storage/myisam/myisam_ftdump] Error 1
gmake[1]: *** [storage/myisam/CMakeFiles/myisam_ftdump.dir/all] Error 2
gmake: *** [all] Error 2
[1 Apr 2014 7:29] Eugene Zheganin
I can confirm that setting these LDFLAGS fixes the build on Solaris.
[22 Mar 2018 21:00] MySQL Verification Team
Then you was able to build on Solaris?. Thanks.
[23 Apr 2018 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".