Description:
compile with following cmake option get core with protoc
the cmake options are:
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_UNIT_TESTS=OFF -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_bin \
-DMYSQL_TCP_PORT=3306 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=0 \
-DWITH_INNOBASE_STORAGE_ENiGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DWITH_EXTRA_CHARSETS=all \
-DWITH_SEMISYNC_MASTER=ON -DWITH_SEMISYNC_SLAVE=ON -DDEFAULT_CHARSET="utf8" -DDEFAULT_COLLATION="utf8_general_ci" \
-DWITH_LTO=on -DFPROFILE_DIR=./ -DFPROFILE_GENERATE=on -DFPROFILE_USE=off
the error i got:
[ 33%] Running C++ protobuf compiler on /data00/code/hybrid_rds-mysql-server-8.0/plugin/group_replication/protobuf/replication_group_member_actions.proto - lite version
[ 33%] Built target GenDigestServerSource
terminate called after throwing an instance of 'std::system_error'
what(): Unknown error -1
my gcc version is
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
the problem is gcc may ignore -lpthread when build protoc
How to repeat:
as I mentioned above
Suggested fix:
add STRING_APPEND(CMAKE_CXX_FLAGS " -Wl,--no-as-needed -lpthread") in extra/protobuf/CMakeLists.txt when compiled with lto