View Issue Details

IDProjectCategoryView StatusLast Update
0004887libmicrohttpdportabilitypublic2021-09-02 17:54
Reportertomasheran Assigned ToChristian Grothoff  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformAnyOSSolarisOS Version11.next
Product Version0.9.52 
Target Version0.9.53Fixed in Version0.9.53 
Summary0004887: _SET_INIT_AND_DEINIT_FUNCS isn't ready for Solaris Studio compiler
DescriptionThe way src/include/autoinit_funcs.h is structured is only around GNU C and MS Visual Studio compilers.

Solaris Studio isn't supported in that header file and (by default) the fact that the header file "couldn't figure out" the way how to register the library constructors and destructors is silently ignored and so when the library is built using Solaris Studio, MHD_init() is never called (automatically upon library load).
Additional InformationLuckily, Solaris Studio does understand GNU C's "__attribute__ ((constructor|destructor))" syntax and so this patch seems to fix the situation:

diff -r d61abfd2e00c -r 035e9e268ad6 src/include/autoinit_funcs.h
--- a/src/include/autoinit_funcs.h Wed Feb 08 12:57:20 2017 +0100
+++ b/src/include/autoinit_funcs.h Fri Feb 10 14:17:39 2017 +0100
@@ -67,7 +67,7 @@
 */
 #define AUTOINIT_FUNCS_VERSION 0x01000001
 
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__SUNPRO_C)
 #/* if possible - check for supported attribute */
 #ifdef __has_attribute
 #if !__has_attribute(constructor) || !__has_attribute(destructor)
@@ -76,7 +76,7 @@
 #endif /* __has_attribute */
 #endif /* __GNUC__ */
 
-#if defined(__GNUC__) && !defined(_GNUC_ATTR_CONSTR_NOT_SUPPORTED)
+#if (defined(__GNUC__) || defined(__SUNPRO_C)) && !defined(_GNUC_ATTR_CONSTR_NOT_SUPPORTED)
 
 #define GNUC_SET_INIT_AND_DEINIT(FI,FD) \
   void __attribute__ ((constructor)) _GNUC_init_helper_##FI(void) \
TagsNo tags attached.

Activities

Christian Grothoff

2017-02-12 09:39

manager   ~0011717

Fixed in 9aa15f70..4cd33c30

Christian Grothoff

2021-09-02 17:54

manager   ~0018186

Fix committed to master branch.

Related Changesets

libmicrohttpd: master 4cd33c30

2017-02-12 10:38

Christian Grothoff


Details Diff
fix 0004887 Affected Issues
0004887
mod - src/include/autoinit_funcs.h Diff File

Issue History

Date Modified Username Field Change
2017-02-10 14:28 tomasheran New Issue
2017-02-12 09:39 Christian Grothoff Assigned To => Christian Grothoff
2017-02-12 09:39 Christian Grothoff Status new => resolved
2017-02-12 09:39 Christian Grothoff Resolution open => fixed
2017-02-12 09:39 Christian Grothoff Fixed in Version => 0.9.53
2017-02-12 09:39 Christian Grothoff Note Added: 0011717
2017-02-12 09:39 Christian Grothoff Target Version => 0.9.53
2017-04-12 00:00 Christian Grothoff Status resolved => closed
2021-09-02 17:54 Christian Grothoff Changeset attached => libmicrohttpd master 4cd33c30
2021-09-02 17:54 Christian Grothoff Note Added: 0018186