[openssl-dev] MSVC 2015 internal compiler error

Erik Forsberg erik at efca.com
Wed Jan 27 23:12:33 UTC 2016


I also noticed compiler warnings generated by this code using SunStudio compilers.
This patch fixes those for me and seems to do the correct thing. Maybe it
makes the VC compiler work too ?

*** lhash.h     Thu Jan 14 01:51:33 2016
--- ../../../x64/include/openssl//lhash.h       Wed Jan 27 15:09:47 2016
***************
*** 99,105 ****
          unsigned long name##_LHASH_HASH(const void *);
  # define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
          unsigned long name##_LHASH_HASH(const void *arg) { \
!                 const o_type *a = arg; \
                  return name##_hash(a); }
  # define LHASH_HASH_FN(name) name##_LHASH_HASH
  
--- 99,105 ----
          unsigned long name##_LHASH_HASH(const void *);
  # define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
          unsigned long name##_LHASH_HASH(const void *arg) { \
!                 o_type *a = (o_type *) arg; \
                  return name##_hash(a); }
  # define LHASH_HASH_FN(name) name##_LHASH_HASH
  
***************
*** 108,115 ****
          int name##_LHASH_COMP(const void *, const void *);
  # define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
          int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
!                 const o_type *a = arg1;             \
!                 const o_type *b = arg2; \
                  return name##_cmp(a,b); }
  # define LHASH_COMP_FN(name) name##_LHASH_COMP
  
--- 108,115 ----
          int name##_LHASH_COMP(const void *, const void *);
  # define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
          int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
!                 o_type *a = (o_type *) arg1;             \
!                 o_type *b = (o_type *) arg2; \
                  return name##_cmp(a,b); }
  # define LHASH_COMP_FN(name) name##_LHASH_COMP
  
***************
*** 118,125 ****
          void name##_LHASH_DOALL_ARG(void *, void *);
  # define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
          void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
!                 o_type *a = arg1; \
!                 a_type *b = arg2; \
                  name##_doall_arg(a, b); }
  # define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
  
--- 118,125 ----
          void name##_LHASH_DOALL_ARG(void *, void *);
  # define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
          void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
!                 o_type *a = (o_type *) arg1; \
!                 a_type *b = (o_type *) arg2; \
                  name##_doall_arg(a, b); }
  # define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
  

>-- Original Message --
>
>On Sat, Jan 16, 2016 at 11:42:52AM +0100, Gisle Vanem wrote:
>> While building OpenSSL from today's git-repo:
>> 
>> ssl\d1_srtp.c : fatal error C1001: An internalerror has occurred in the compiler.
>> (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 246)
>>  To work around this problem, try simplifying or changing the program near the locations listed above.
>> Please choose the Technical Support command on the Visual C++
>>  Help menu, or open the Technical Support help file for more information
>> 
>> INTERNAL COMPILER ERROR in 'f:\gv\VC_2015\bin\cl.exe'
>>     Please choose the Technical Support command on the Visual C++
>>     Help menu, or open the Technical Support help file for more information
>> 
>> -----
>> 
>> Seems to be related to:
>>   typedef const char *OPENSSL_CSTRING;
>> 
>> in safestack.h Changing this into:
>> 
>>   #ifdef _MSC_VER
>>   typedef       char *OPENSSL_CSTRING;
>>   #else
>>   typedef const char *OPENSSL_CSTRING;
>>   #endif
>> 
>> helps, but triggers the same internal compiler error later on.
>> 
>> It suspect the compiler sees 'const const *x' in some
>> places. So I assume that's the trigger for this fault.
>
>So we've been seeing this on AppVeyor too.  As far as I can see,
>this happens somewhere between commit 249d9719 and 59fd40d4.  The
>file itself has only minor changes, turning some "SSL_CIPHER *"
>into "const SSL_CIPHER *", so it's most likely one of the include
>files that changed in between.
>
>It includes changes to safestack, including adding inline
>functions instead of the defines.  So that is probably why it
>fails, but I currently don't see a way to work around this, or how
>we could simplify things.
>
>The problem also only seems to have with VC 14/2015.  It works in
>all the older versions we have on AppVeyor.
>
>Have you actually tried to contact Microsoft about this issue?
>
>
>Kurt
>
>_______________________________________________
>openssl-dev mailing list
>To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev



More information about the openssl-dev mailing list