From 6bc5d759a21c72b2eafb805eefe6b38f4c07e60a Mon Sep 17 00:00:00 2001 From: silverqx Date: Tue, 7 Jun 2022 08:09:41 +0200 Subject: [PATCH] enabled thread_local for clang >=14.0.4 for Linux --- include/orm/macros/threadlocal.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/orm/macros/threadlocal.hpp b/include/orm/macros/threadlocal.hpp index e35b34154..b71a6b061 100644 --- a/include/orm/macros/threadlocal.hpp +++ b/include/orm/macros/threadlocal.hpp @@ -7,10 +7,13 @@ TINY_SYSTEM_HEADER #include -// BUG TLS, clang linux crashes, gcc mingw lld/ld doesn't compile (duplicit tls), clang mingw ld stdlib weird 100,000 linker errors (COMDAT symbol xyz does not match section name), clang mingw lld stdlib works, but I'm giving up this clang MinGW support because still occasional crashes on TLS exit/destruction, it crashes around 1 time from 5, and now I have discovered that Clang 13 on Linux works, something was fixed in Clang 13?, so I'm enabling support for Clang >=13 on Linux, AND NOW with clang >= 13 and Qt 6.2.2 crashes again, Qt 5.15.2 is not crashing, Clang is king 😂🤣🤯, 02.01.2022 - now I have discovered that TinyOrmPlayground crashes even with Clang 13 and Qt 5.15.2, so I'm disabling thread_local for Clang on Linux silverqx -#if !defined(__clang__) && \ - !(defined(__GNUG__) && !defined(__clang__) && defined(__MINGW32__)) && \ - !defined TINYORM_DISABLE_THREAD_LOCAL +// BUG TLS, clang linux crashes, gcc mingw lld/ld doesn't compile (duplicit tls), clang mingw ld stdlib weird 100,000 linker errors (COMDAT symbol xyz does not match section name), clang mingw lld stdlib works, but I'm giving up this clang MinGW support because still occasional crashes on TLS exit/destruction, it crashes around 1 time from 5, and now I have discovered that Clang 13 on Linux works, something was fixed in Clang 13?, so I'm enabling support for Clang >=13 on Linux, AND NOW with clang >= 13 and Qt 6.2.2 crashes again, Qt 5.15.2 is not crashing, Clang is king 😂🤣🤯, 02.01.2022 - now I have discovered that TinyOrmPlayground crashes even with Clang 13 and Qt 5.15.2, so I'm disabling thread_local for Clang on Linux. New INFO Clang 14.0.4, no crashes with Qt 5.15.2/Qt 6.2.4 and also TinyOrmPlayground works, so I'm enabling for >=Clang 14.0.4 🤯 silverqx +#if !(defined(__clang__) && defined(__MINGW32__)) && \ + !(defined(__clang__) && !defined(__MINGW32__) && \ + (__clang_major__ < 14 || \ + (__clang_major__ == 14 && __clang_minor__ == 0 && __clang_patchlevel__ < 4))) && \ + !(defined(__GNUG__) && !defined(__clang__) && defined(__MINGW32__)) && \ + !defined(TINYORM_DISABLE_THREAD_LOCAL) # define T_THREAD_LOCAL thread_local #endif