Closed phprus closed 1 month ago
Is there some problem with macro? https://github.com/oneapi-src/oneTBB/blob/306c75f5e906fc221e12f45dae45900f0d8db6ba/src/tbb/concurrent_monitor.h#L294
@pavelkumbrasev
Yes.
If LTO is enabled (it is by default), then pragma GCC diagnostic ignored
cannot suppress the warning.
We need to add -Wno-stringop-overflow
when linking.
I can create a PR if this warning suppression approach is possible in oneTBB.
We need to add -Wno-stringop-overflow when linking.
Will the link flag help during the compilation stage or did I miss something?
Will the link flag help during the compilation stage or did I miss something?
If LTO is enabled, the -Wno-stringop-overflow
flag must be added to linker, since when LTO is enabled, GCC performs analysis at linking.
For example into TBB_COMMON_LINK_FLAGS
or TBB_LIB_LINK_FLAGS
.
Linking without warnings:
[ 10%] Linking CXX shared library ../../gnu_12.2_cxx20_64_relwithdebinfo/libtbb.so
cd /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbb && /usr/bin/cmake -E cmake_link_script CMakeFiles/tbb.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O2 -g -DNDEBUG -flto=auto -fno-fat-lto-objects -Wl,--version-script="/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/src/tbb/def/lin64-tbb.def" -Wl,-z,relro,-z,now,-z,noexecstack -shared -Wl,-soname,libtbb.so.12 -o ../../gnu_12.2_cxx20_64_relwithdebinfo/libtbb.so.12.13 CMakeFiles/tbb.dir/address_waiter.cpp.o CMakeFiles/tbb.dir/allocator.cpp.o CMakeFiles/tbb.dir/arena.cpp.o CMakeFiles/tbb.dir/arena_slot.cpp.o CMakeFiles/tbb.dir/concurrent_bounded_queue.cpp.o CMakeFiles/tbb.dir/dynamic_link.cpp.o CMakeFiles/tbb.dir/exception.cpp.o CMakeFiles/tbb.dir/governor.cpp.o CMakeFiles/tbb.dir/global_control.cpp.o CMakeFiles/tbb.dir/itt_notify.cpp.o CMakeFiles/tbb.dir/main.cpp.o CMakeFiles/tbb.dir/market.cpp.o CMakeFiles/tbb.dir/tcm_adaptor.cpp.o CMakeFiles/tbb.dir/misc.cpp.o CMakeFiles/tbb.dir/misc_ex.cpp.o CMakeFiles/tbb.dir/observer_proxy.cpp.o CMakeFiles/tbb.dir/parallel_pipeline.cpp.o CMakeFiles/tbb.dir/private_server.cpp.o CMakeFiles/tbb.dir/profiling.cpp.o CMakeFiles/tbb.dir/rml_tbb.cpp.o CMakeFiles/tbb.dir/rtm_mutex.cpp.o CMakeFiles/tbb.dir/rtm_rw_mutex.cpp.o CMakeFiles/tbb.dir/semaphore.cpp.o CMakeFiles/tbb.dir/small_object_pool.cpp.o CMakeFiles/tbb.dir/task.cpp.o CMakeFiles/tbb.dir/task_dispatcher.cpp.o CMakeFiles/tbb.dir/task_group_context.cpp.o CMakeFiles/tbb.dir/thread_dispatcher.cpp.o CMakeFiles/tbb.dir/thread_request_serializer.cpp.o CMakeFiles/tbb.dir/threading_control.cpp.o CMakeFiles/tbb.dir/version.cpp.o CMakeFiles/tbb.dir/queuing_rw_mutex.cpp.o -ldl -Wno-stringop-overflow
cd /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbb && /usr/bin/cmake -E cmake_symlink_library ../../gnu_12.2_cxx20_64_relwithdebinfo/libtbb.so.12.13 ../../gnu_12.2_cxx20_64_relwithdebinfo/libtbb.so.12 ../../gnu_12.2_cxx20_64_relwithdebinfo/libtbb.so
cd /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbb && /usr/bin/cmake -DBINARY_DIR=/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto -DSOURCE_DIR=/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba -DBIN_PATH=/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/gnu_12.2_cxx20_64_relwithdebinfo -DVARS_TEMPLATE=linux/env/vars.sh.in -DVARS_NAME=vars.sh -DTBB_INSTALL_VARS=OFF -DTBB_CMAKE_INSTALL_LIBDIR=lib -P /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/integration/cmake/generate_vars.cmake
gmake[2]: Leaving directory '/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto'
[ 10%] Built target tbb
/usr/bin/gmake -f src/tbbmalloc/CMakeFiles/tbbmalloc.dir/build.make src/tbbmalloc/CMakeFiles/tbbmalloc.dir/depend
gmake[2]: Entering directory '/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto'
cd /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/src/tbbmalloc /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbbmalloc /home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/DependInfo.cmake --color=
Dependencies file "src/tbbmalloc/CMakeFiles/tbbmalloc.dir/__/tbb/itt_notify.cpp.o.d" is newer than depends file "/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/compiler_depend.internal".
Dependencies file "src/tbbmalloc/CMakeFiles/tbbmalloc.dir/backend.cpp.o.d" is newer than depends file "/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/compiler_depend.internal".
Dependencies file "src/tbbmalloc/CMakeFiles/tbbmalloc.dir/backref.cpp.o.d" is newer than depends file "/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/compiler_depend.internal".
Dependencies file "src/tbbmalloc/CMakeFiles/tbbmalloc.dir/frontend.cpp.o.d" is newer than depends file "/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/compiler_depend.internal".
Dependencies file "src/tbbmalloc/CMakeFiles/tbbmalloc.dir/large_objects.cpp.o.d" is newer than depends file "/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/compiler_depend.internal".
Dependencies file "src/tbbmalloc/CMakeFiles/tbbmalloc.dir/tbbmalloc.cpp.o.d" is newer than depends file "/home/phprus/test/tbb/oneTBB-306c75f5e906fc221e12f45dae45900f0d8db6ba/build/cpp20rwd-lto/src/tbbmalloc/CMakeFiles/tbbmalloc.dir/compiler_depend.internal".
Possible solution: PR #1470
Version
Commit: 306c75f5e906fc221e12f45dae45900f0d8db6ba
Environment
OS: Debian 12 gcc version 12.2.0 (Debian 12.2.0-14)
Steps To Reproduce
CMake command:
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_STANDARD=20 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON ../..
Build warnings: