Bug #61427 Erroneous Compilation pre-requisite details
Submitted: 6 Jun 2011 20:01 Modified: 30 Apr 2015 11:27
Reporter: Naveen Shetty Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5.12 OS:Linux (CentOS 5.5 (32 bit - Final) )
Assigned to: CPU Architecture:Any
Tags: C++ compiler, CentOS, GCC 4.1.2, linux, pre-requisites for compilation

[6 Jun 2011 20:01] Naveen Shetty
Description:
MySQL 5.5.12 doesn't compile with the GCC 4.1.2, the 'make' command fails with an error as follows:
[ 84%] Building CXX object sql/CMakeFiles/sql.dir/mysqld.cc.o
/root/workspace/mysql-5.5.11/sql/mysqld.cc: In function ‘void handle_connections_sockets()’:
/root/workspace/mysql-5.5.11/sql/mysqld.cc:5213: error: invalid conversion from ‘size_socket*’ to ‘socklen_t*’
/root/workspace/mysql-5.5.11/sql/mysqld.cc:5213: error:   initializing argument 3 of ‘int accept(int, sockaddr*, socklen_t*)’
/root/workspace/mysql-5.5.11/sql/mysqld.cc:5280: error: invalid conversion from ‘int*’ to ‘socklen_t*’
/root/workspace/mysql-5.5.11/sql/mysqld.cc:5280: error:   initializing argument 3 of ‘int getsockname(int, sockaddr*, socklen_t*)’
make[2]: *** [sql/CMakeFiles/sql.dir/mysqld.cc.o] Error 1
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make: *** [all] Error 2 

How to repeat:
These are the environment details:
User, used for the compile, make, install and test-suite run: root
S/w versions:
Centos 5.5 (32bit Final)
CMake 2.8.4
GCC (C++) 4.1.2
GNU Make 3.81

Here are the details for re-creation of the error:
1. Download the code to the folder structure mentioned.
2. Run 'cmake .' in the /usr/local/mysql-5.5.12 directory
3. run 'make .', this would fail with the error in the Description 

Suggested fix:
Make the pre-requisite GCC version as 4.4 (and above) or the most suitable as per the updates of MySQL.

Make the change on this page, http://dev.mysql.com/doc/refman/5.1/en/source-installation.html or add another page for ver 5.5
[7 Jun 2011 4:28] Valeriy Kravchuk
http://dev.mysql.com/doc/refman/5.5/en/source-installation.html probably needs updating. It still mentions gcc 3.2, that is obviously wrong.

P.S. gcc 4.2.1 on Mac works for all MySQL versions.
[8 Jun 2011 18:39] Vladislav Vaintroub
This is about compilation error on 32 bit. GCC 4.1.2 works fine for me on RHEL5 64 bit. Probably the socket_size check is wrong or something like that.
[9 Jun 2011 14:52] Paul DuBois
I updated the manual with these "known to work" GCC versions:

5.0, 5.1: GCC 3.6.4
5.5+: GCC 4.2.1
[9 Jun 2011 21:47] Naveen Shetty
Please send me the URL for the reference manual page that changed, as I don't see the changes on the original page:
http://dev.mysql.com/doc/refman/5.5/en/source-installation.html
[9 Jun 2011 22:26] Paul DuBois
It's the same URL, but you won't see the change until the documentation rebuilds and has been published.
[14 Jun 2011 14:04] Valeriy Kravchuk
While manual fix-related part of this report is clear now, we may still have problem in server code here (as pointed out by Vladislav). 

Please, log the output of "cmake ." and send the log (and CMakeCache.txt file) to this bug report to clarify what's wrong with SOCKET_SIZE_TYPE check.
[14 Jun 2011 14:14] Paul DuBois
Unassigning from myself; it's no longer a docs bug.
[14 Jun 2011 14:38] Davi Arnaut
The log files are in the subdirectory CMakeFiles:

CMakeFiles/CMakeError.log and CMakeFiles/CMakeOutput.log

(These are the cmake equivalent of autoconf's config.log)
[20 Jun 2011 15:46] Naveen Shetty
Anything required from my end ?
[20 Jun 2011 16:02] Valeriy Kravchuk
We need content of CMakeFiles/CMakeError.log and CMakeFiles/CMakeOutput.log after the failed compilation.
[20 Jul 2011 23: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".
[4 May 2012 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".