[dev.icinga.com #521] Doesn't compile with Sun Studio compiler on Solaris: asprintf() doesn't exist #251
Comments
Updated by alexs77 on 2010-06-21 11:49:37 +00:00 Problem also exists when using gcc on Solaris (gccfss [[http://cooltools.sunsource.net/gcc/\]\] in this case):
Interestingly, during
But despite that, icinga tried to use the non-existant The problem also exists in git icinga-core (checked out 2010-06-21):
|
Updated by mfriedrich on 2010-06-21 16:25:47 +00:00 the n_a was removed during a cleanup, i think it's default expected in this function with embedded perl - readded it.
seems rather strange to me. |
Updated by alexs77 on 2010-06-21 17:46:11 +00:00
Yes, I then also read the error message correctly, and it is like you say - it fails because of n_a. :)
But still… If you check eg. checks.c:483, asprintf() is invoked (or not…). Is icinga going to work fine, if all those asprintf() (in checks.c and whereever…) actually do nothing?
It exists - but in the base directory, not in the common directory! If I copy/link it from base -> common, all is well (that's actually an error carried over from Nagios 3.2.0). I remembered that I had to do this on Nagios as well. It seems to be well known . |
Updated by mfriedrich on 2010-06-21 21:50:04 +00:00
hm, we need to get a deeper look on the asprintf problem on solaris. any thoughts on this? or on the opsera patches? especially those:
the best thing would be to check for them available during configure and if not there, setting a #define which is being checked in source compilation - e,g, in include/common.h and module/idoutils/include/common.h - #ifdef USE_SOLARIS include "include/sunos_icinga.h" which holds all function prototypes, common/sunos_icinga.c holds the definitions then. thoughts on that? regarding snprintf - common/Makefile does not hold anything to compile. Can you point me there where snprintf gets set into base/ instead of common/? which Makefile invokes that exactly? 'make all' steps into base, cgi and html dirs do make the files. cd but then i'm stuck. but since shared.o (thanks to Andreas Ericsson's patches) also runs into common/ and is compiled during base/ I would consider the same solution for that. add below
this
also adding that to OBJ variable. this will result in snprintf.o in common/ and can be used in further context with solaris while others won't need that (make clean removes it again). can you please test that?
|
Updated by mfriedrich on 2010-06-21 21:55:41 +00:00
|
Updated by mfriedrich on 2010-06-21 21:56:05 +00:00
|
Updated by mfriedrich on 2010-06-21 21:56:17 +00:00
|
Updated by alexs77 on 2010-06-23 07:47:20 +00:00 snprintf.oI get this now:
But that doesn't seem to hurt - it compiles fine now (as far as that's concerned). ndoutils_* patchesI also think, that these should only be used, if required. For that, I thought about this:
(Haven't checked it.) Idea: We already check if asprintf() & co. are present. The patch should add #HAVE_ASPRINTF. Now I'd split https://dev.icinga.org/attachments/156/ndoutils\_sunos.h and https://dev.icinga.org/attachments/157/ndoutils\_sunos.c into two (or more) files: asprintf.c & asprintf.h and vasprintf.c/.h. Then, add a #ifndef HAVE_ASPRINTF and include asprintf.h/c. .... Uhm.... Check out |
Updated by alexs77 on 2010-06-30 08:59:32 +00:00
Using the latest version of the mfriedrichs/solaris branch, it eventually fails with:
|
Updated by mfriedrich on 2010-06-30 15:21:10 +00:00 mh solaris is outdated, the new approach is here: https://git.icinga.org/?p=icinga-core.git;a=shortlog;h=refs/heads/mfriedrich/sun |
Updated by mfriedrich on 2010-10-22 15:21:25 +00:00
i'll leave the last diff over here (git branch cleanup) but i do think that issues are resolved as reported? removed diff and converted it to attachment |
Updated by alexs77 on 2010-10-25 09:25:28 +00:00 dnsmichi wrote:
Uhm, in 1.2.0, I still get the ../common/snprintf.o error.
Should it have been fixed? |
Updated by mfriedrich on 2010-10-25 09:48:47 +00:00 current 1.2.1 holds an reported fix for that. check #858 |
Updated by alexs77 on 2010-10-25 11:56:19 +00:00 dnsmichi wrote:
Thx. I downloaded 1.2.1 and it breaks because of helloworld.o (cf #524 ). Also, lots of messages like this one:
asprintf() is unknown. |
Updated by mfriedrich on 2011-01-10 17:02:42 +00:00
this should be finally resolved by now as sunos detection now compiles common/snprintf.c and makes use of the .o lib all around the corner. |
Updated by mfrosch on 2017-01-17 13:29:15 +00:00
|
This issue has been migrated from Redmine: https://dev.icinga.com/issues/521
Created by alexs77 on 2010-06-21 11:29:01 +00:00
Assignee: mfriedrich
Status: Resolved (closed on 2011-01-10 17:02:42 +00:00)
Target Version: 1.3
Last Update: 2017-01-17 13:29:14 +00:00 (in Redmine)
Trying to compile icinga-1.0.1 on Solaris 10 using Sun Studio 12 update 1 compiler:
Main problem:
"icinga.c", line 651: warning: implicit function declaration: asprintf
Solaris 10 doesn't have asprintf.
(Note: Because of this issue, I tried to use git icinga-core, but didn't work too well... -> Issue #520 )
Attachments
Changesets
2010-06-21 16:25:06 +00:00 by mfriedrich e60e86d
2010-06-22 07:25:35 +00:00 by mfriedrich b3c4e71057a55c93385e218af37bba26f6557d84
2010-06-24 12:02:23 +00:00 by mfriedrich 49cae46314f5980ae1db2ef387c96dd1477de935
The text was updated successfully, but these errors were encountered: