Bug #85536 Build error on 5.5.54
Submitted: 20 Mar 2017 10:14 Modified: 21 Mar 2017 8:15
Reporter: Roel Van de Paar (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:5.5.54 OS:Any
Assigned to: CPU Architecture:Any

[20 Mar 2017 10:14] Roel Van de Paar
Description:
$ cat VERSION 
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=54
MYSQL_VERSION_EXTRA=

...
[ 18%] Building C object mysys/CMakeFiles/mysys.dir/my_getsystime.c.o
[ 18%] Building C object mysys/CMakeFiles/mysys.dir/my_getwd.c.o
[ 19%] Building C object mysys/CMakeFiles/mysys.dir/my_compare.c.o
[ 19%] Building C object mysys/CMakeFiles/mysys.dir/my_init.c.o
[ 19%] Building C object mysys/CMakeFiles/mysys.dir/my_lib.c.o
/git/MS55_dbg/mysys/my_lib.c: In function ‘my_dir’:
/git/MS55_dbg/mysys/my_lib.c:140:3: error: ‘readdir_r’ is deprecated [-Werror=deprecated-declarations]
   while (!(READDIR(dirp,(struct dirent*) dirent_tmp,dp)))
   ^~~~~
In file included from /usr/include/features.h:364:0,
                 from /usr/include/pthread.h:21,
                 from /git/MS55_dbg/include/my_global.h:274,
                 from /git/MS55_dbg/mysys/mysys_priv.h:16,
                 from /git/MS55_dbg/mysys/my_lib.c:19:
/usr/include/dirent.h:189:12: note: declared here
 extern int __REDIRECT (readdir_r,
            ^
cc1: all warnings being treated as errors
make[2]: *** [mysys/CMakeFiles/mysys.dir/my_lib.c.o] Error 1
mysys/CMakeFiles/mysys.dir/build.make:1358: recipe for target 'mysys/CMakeFiles/mysys.dir/my_lib.c.o' failed
make[1]: *** [mysys/CMakeFiles/mysys.dir/all] Error 2
CMakeFiles/Makefile2:2187: recipe for target 'mysys/CMakeFiles/mysys.dir/all' failed
make: *** [all] Error 2
Makefile:160: recipe for target 'all' failed

How to repeat:
# Using Ubuntu 16.10, up-to-date as of 20 March 2017
# Development tools/compiler etc. installed, idem
# Using current 5.5 tree on github;
  git clone --recursive --depth=1 https://github.com/mysql/mysql-server.git -b 5.5 MS55 
# Using cmake;
  cmake . -DWITH_ZLIB=system -DCMAKE_BUILD_TYPE=Debug -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DDEBUG_EXTNAME=OFF -DWITH_EMBEDDED_SERVER=OFF -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp -DWITH_SSL=system -DWITH_PAM=ON

Suggested fix:
A workaround would be appreciated
[20 Mar 2017 10:15] Roel Van de Paar
.
[20 Mar 2017 10:30] Roel Van de Paar
Seems this build error only happens on Ubuntu (16.10 x64), Centos 7 x64 works
[20 Mar 2017 12:51] Umesh Shastry
-- OL7 seems to be fine

[umshastr@hod03]/export/umesh/server/source/bugs/85536/mysql-5.5.54: cmake . -DWITH_ZLIB=system -DCMAKE_BUILD_TYPE=Debug -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DDEBUG_EXTNAME=OFF -DWITH_EMBEDDED_SERVER=OFF -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp -DWITH_SSL=system -DWITH_PAM=ON
-- Running cmake version 2.8.12.2
-- Found Git: /usr/bin/git (found version "2.1.0")
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
.
-- COMPILE_DEFINITIONS: HAVE_CONFIG_H
-- CMAKE_C_FLAGS:  -fPIC -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement -Werror
-- CMAKE_CXX_FLAGS:  -fPIC -fno-implicit-templates -fno-exceptions -fno-rtti -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter -Werror
-- CMAKE_C_FLAGS_DEBUG: -O -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DENABLED_DEBUG_SYNC
-- CMAKE_CXX_FLAGS_DEBUG: -O -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DENABLED_DEBUG_SYNC
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    DEBUG_EXTNAME
    DOWNLOAD_BOOST
    ENABLE_DOWNLOADS
    WITH_BOOST
    WITH_PAM

-- Build files have been written to: /export/umesh/server/source/bugs/85536/mysql-5.5.54
[umshastr@hod03]/export/umesh/server/source/bugs/85536/mysql-5.5.54: make -j32
Scanning dependencies of target abi_check
Scanning dependencies of target INFO_BIN
Scanning dependencies of target INFO_SRC
Scanning dependencies of target gen_dtrace_header
Scanning dependencies of target mytap
Scanning dependencies of target mysqlservices
Scanning dependencies of target gen_lex_hash
Scanning dependencies of target vio
Scanning dependencies of target innochecksum
Scanning dependencies of target regex
Scanning dependencies of target comp_sql
Scanning dependencies of target my_safe_process
Scanning dependencies of target readline
Scanning dependencies of target strings
[  0%] [  0%] [  0%] [  0%] [  0%] [  0%] [  0%] [  1%] [  1%] [  1%] Building C object libservices/CMakeFiles/mysqlservices.dir/my_snprintf_service.c.o
[  1%] [  1%] [  1%] Generating include/probes_mysql_dtrace.h, include/probes_mysql_nodtrace.h
Building C object libservices/CMakeFiles/mysqlservices.dir/thd_alloc_service.c.o
Building CXX object mysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/safe_process.cc.o
[  2%] Building C object scripts/CMakeFiles/comp_sql.dir/comp_sql.c.o
Building CXX object sql/CMakeFiles/gen_lex_hash.dir/gen_lex_hash.cc.o
[  2%] [  2%] [  2%] [  2%] [  3%] Building C object unittest/mytap/CMakeFiles/mytap.dir/tap.c.o
Building C object libservices/CMakeFiles/mysqlservices.dir/thd_wait_service.c.o
.
Linking C shared module udf_example.so
[100%] Built target udf_example
[100%] Built target explain_filename-t
[umshastr@hod03]/export/umesh/server/source/bugs/85536/mysql-5.5.54:
[21 Mar 2017 5:03] Umesh Shastry
-- 16.04 LTS no issues seen

root@ubuntu1604lts:/home/ushastry/Downloads/mysql-5.5.54# cmake . -DWITH_ZLIB=system -DCMAKE_BUILD_TYPE=Debug -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DDEBUG_EXTNAME=OFF -DWITH_EMBEDDED_SERVER=OFF -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp -DWITH_SSL=system -DWITH_PAM=ON
-- Running cmake version 3.5.1
-- Found Git: /usr/bin/git (found version "2.7.4") 
-- The C compiler identification is GNU 5.4.1
-- The CXX compiler identification is GNU 5.4.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void *
-- Check size of void * - done
-- Looking for include file libaio.h
-- Looking for include file libaio.h - found
-- Looking for io_queue_init in aio
-- Looking for io_queue_init in aio - found
-- Looking for SHM_HUGETLB
-- Looking for SHM_HUGETLB - found
-- MySQL 5.5.54
-- Packaging as: mysql-5.5.54-Linux-x86_64
.
-- COMPILE_DEFINITIONS: HAVE_CONFIG_H
-- CMAKE_C_FLAGS:  -fPIC -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement -Werror
-- CMAKE_CXX_FLAGS:  -fPIC -fno-implicit-templates -fno-exceptions -fno-rtti -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter -Werror
-- CMAKE_C_FLAGS_DEBUG: -O -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DENABLED_DEBUG_SYNC
-- CMAKE_CXX_FLAGS_DEBUG: -O -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DENABLED_DEBUG_SYNC
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    DEBUG_EXTNAME
    DOWNLOAD_BOOST
    ENABLE_DOWNLOADS
    WITH_BOOST
    WITH_PAM

-- Build files have been written to: /home/ushastry/Downloads/mysql-5.5.54
root@ubuntu1604lts:/home/ushastry/Downloads/mysql-5.5.54# make -j4
Scanning dependencies of target INFO_BIN
Scanning dependencies of target abi_check
Scanning dependencies of target INFO_SRC
Scanning dependencies of target readline
[  0%] Built target INFO_BIN
Scanning dependencies of target strings
[  0%] Built target INFO_SRC
Scanning dependencies of target mytap
[  1%] Building C object strings/CMakeFiles/strings.dir/bchange.c.o
[  1%] Building C object unittest/mytap/CMakeFiles/mytap.dir/tap.c.o
[  1%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/readline.c.o
[  1%] Building C object strings/CMakeFiles/strings.dir/bmove_upp.c.o
[  1%] Linking C static library libmytap.a
[  1%] Built target abi_check
Scanning dependencies of target mysqlservices
..
[100%] Building CXX object sql/CMakeFiles/sql.dir/sql_builtin.cc.o
[100%] Linking CXX static library libsql.a
[100%] Built target sql
Scanning dependencies of target mysqld
Scanning dependencies of target explain_filename-t
[100%] Building CXX object sql/CMakeFiles/mysqld.dir/main.cc.o
[100%] Building CXX object unittest/mysys/CMakeFiles/explain_filename-t.dir/explain_filename-t.cc.o
[100%] Linking CXX executable mysqld
[100%] Linking CXX executable explain_filename-t
[100%] Built target mysqld
Scanning dependencies of target udf_example
[100%] Building C object sql/CMakeFiles/udf_example.dir/udf_example.c.o
[100%] Built target explain_filename-t
[100%] Linking C shared module udf_example.so
[100%] Built target udf_example
root@ubuntu1604lts:/home/ushastry/Downloads/mysql-5.5.54#
[21 Mar 2017 8:15] Umesh Shastry
Hello Roel,

Thank you for the report and feedback.
Verified as described on Ubuntu 16.10.

Thanks,
Umesh
[21 Mar 2017 8:19] Umesh Shastry
Build details..

Attachment: 85536.build (application/octet-stream, text), 40.41 KiB.