diff --git a/tests/auto/functional/orm/tiny/model_return_relation/CMakeLists.txt b/tests/auto/functional/orm/tiny/model_return_relation/CMakeLists.txt index 6206e2d07..60bc0575b 100644 --- a/tests/auto/functional/orm/tiny/model_return_relation/CMakeLists.txt +++ b/tests/auto/functional/orm/tiny/model_return_relation/CMakeLists.txt @@ -10,3 +10,18 @@ add_test(NAME model_return_relation COMMAND model_return_relation) include(TinyTestCommon) tiny_configure_test(model_return_relation DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) + +# To avoid: error: redefinition of 'bool __tls_guard' +# Even the latest GCC v14.2.1 has still TLS wrapper related bugs if the class that +# defines the thread_local static is templated and polymorphic. 😞 +# This is the only test case where this is happening and I didn't find any workaround +# after 8 hours of investigation. +# Only workaround I found is to #include the torrent_includeslist.hpp then it compiles, +# so I'm disabling the thread_local for this test case. +# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66944 +# thread_local is already disabled on MSYS2 g++ so no need to target unix platform. +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_definitions(model_return_relation + PRIVATE TINYORM_DISABLE_THREAD_LOCAL + ) +endif() diff --git a/tests/auto/functional/orm/tiny/model_return_relation/model_return_relation.pro b/tests/auto/functional/orm/tiny/model_return_relation/model_return_relation.pro index 0a03a8f3e..bdef021db 100644 --- a/tests/auto/functional/orm/tiny/model_return_relation/model_return_relation.pro +++ b/tests/auto/functional/orm/tiny/model_return_relation/model_return_relation.pro @@ -2,4 +2,15 @@ include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) include($$TINYORM_SOURCE_TREE/tests/models/models.pri) +# To avoid: error: redefinition of 'bool __tls_guard' +# Even the latest GCC v14.2.1 has still TLS wrapper related bugs if the class that +# defines the thread_local static is templated and polymorphic. 😞 +# This is the only test case where this is happening and I didn't find any workaround +# after 8 hours of investigation. +# Only workaround I found is to #include the torrent_includeslist.hpp then it compiles, +# so I'm disabling the thread_local for this test case. +# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66944 +# thread_local is already disabled on MSYS2 g++ so no need to target unix platform. +gcc:!clang: DEFINES *= TINYORM_DISABLE_THREAD_LOCAL + SOURCES += tst_model_return_relation.cpp