Bug #82781 Remove use of boost::chrono
Submitted: 29 Aug 2016 10:35 Modified: 30 Aug 2016 14:39
Reporter: Steinar Gunderson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.1 OS:Any
Assigned to: CPU Architecture:Any

[29 Aug 2016 10:35] Steinar Gunderson
Description:
With recent g++ (6.1.1, on Debian testing), MySQL now fails to link:

[9/9] Linking CXX executable client/mysqlpump
FAILED: client/mysqlpump 
: && /usr/lib/ccache/c++   -Wall -Wextra -Wformat-security -Wvla -Wmissing-format-attribute -Wundef -Woverloaded-virtual -Wno-unused-parameter -Wlogical-op -O3 -g -fno-omit-frame-pointer -fno-strict-aliasing -std=c++11 -DDBUG_OFF  -fuse-ld=gold  client/dump/CMakeFiles/mysqlpump.dir/program.cc.o  -o client/mysqlpump  -lpthread client/dump/libmysqlpump_lib.a client/dump/libboost_lib.a client/base/libclient_base.a libmysql/libmysqlclient.a -lm -lrt -latomic -ldl extra/liblz4_lib.a -lpthread && :
../client/dump/program.cc:175: error: undefined reference to 'boost::chrono::steady_clock::now()'
../client/dump/program.cc:216: error: undefined reference to 'boost::chrono::steady_clock::now()'
../client/dump/sql_formatter.cc:275: error: undefined reference to 'boost::chrono::system_clock::now()'
../client/dump/sql_formatter.cc:274: error: undefined reference to 'boost::chrono::system_clock::to_time_t(boost::chrono::time_point<boost::chrono::system_clock, boost::chrono::duration<long, boost::ratio<1l, 1000000000l> > > const&)'
../client/dump/sql_formatter.cc:250: error: undefined reference to 'boost::chrono::system_clock::now()'
../client/dump/sql_formatter.cc:249: error: undefined reference to 'boost::chrono::system_clock::to_time_t(boost::chrono::time_point<boost::chrono::system_clock, boost::chrono::duration<long, boost::ratio<1l, 1000000000l> > > const&)'
../client/dump/abstract_progress_watcher.cc:31: error: undefined reference to 'boost::chrono::system_clock::now()'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

boost::chrono was never in the allowed Boost subset, so we should just remove its use rather than to spend time on figuring out what went wrong.

How to repeat:
cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST=$WITH_BOOST -DENABLE_DOWNLOADS=1 -G Ninja
ninja

Suggested fix:
N/A
[30 Aug 2016 14:39] Paul DuBois
Posted by developer:
 
Noted in 8.0.1 changelog.

Use of boost::chrono was replaced with std::chrono because the former
was causing link errors.