FIPS SLI revamp: __thread check is sensitive to compiler flags

Lucas Mulling via Gcrypt-devel <[email protected]>
Newsgroups gmane.comp.encryption.gpg.libgcrypt.devel
Message-ID <CAK8Nc5Pc3V9D9M0sGOg2S45tLb637NMYNKYTsK6Z+NwdFUzF=w@mail.gmail.com>
Hi,

We were backporting FIPS SLI changes to 1.10.3, in our target environment
`-Wall` and -`Werror=unused-variable` are set, making the check for
`__thread` fail. FYI if anyone else has this problem, fix attached.

Thanks,
Lucas Mülling

_______________________________________________
Gcrypt-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gcrypt-devel
fix-__thread-check.patch (text/x-patch, 668 B)
Index: libgcrypt-1.10.3/configure.ac
===================================================================
--- libgcrypt-1.10.3.orig/configure.ac
+++ libgcrypt-1.10.3/configure.ac
@@ -1502,7 +1502,10 @@ AC_CACHE_CHECK([whether compiler support
        [gcry_cv_gcc_storage_class__thread],
        [gcry_cv_gcc_storage_class__thread=no
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>],
-          [static  __thread  int bar;]
+          [
+            [static  __thread  int bar = 0;]
+            [(void)bar;]
+          ]
           )],
           [gcry_cv_gcc_storage_class__thread=yes])])
 if test "$gcry_cv_gcc_storage_class__thread" = "yes" ; then
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.