Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #1772] Makefiles not correct on Solaris with Sun CC #706

Closed
icinga-migration opened this issue Aug 2, 2011 · 7 comments
Closed

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/1772

Created by Tommi on 2011-08-02 09:37:45 +00:00

Assignee: Tommi
Status: Resolved (closed on 2012-04-20 12:55:15 +00:00)
Target Version: 1.7
Last Update: 2012-04-20 12:55:15 +00:00 (in Redmine)


Makefiles in solaris sparc are not correct when using Sun compiler (SunStudio) instead of gcc.
1.There is no asprintf available, but configure tests indicating is available. Usually in this environtment the supplied snprintf should be used in general in preference to system supplied function
2. Sun Linker ld requires to build modules with .so extension and with -KPIC option including all included object files. This means common used objects like snprintf and utils needs to be builded in addition to the core build (in "common" subdir) with these options in a different subdir and then included into the make file , otherwise build will fail

Changesets

2012-01-29 16:17:35 +00:00 by Tommi 06a7dee

fix build issues on modules and broken snprintf function causing segv on solaris #1772
refs #1772, #1253

Relations:

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-12-19 23:09:08 +00:00

  • Status changed from New to Assigned
  • Assigned to set to Assaf

@assaf

if you can, please check on that.

@icinga-migration
Copy link
Author

Updated by Tommi on 2012-01-29 16:48:54 +00:00

  • Status changed from Assigned to Feedback
  • Assigned to changed from Assaf to Tommi
  • Done % changed from 0 to 100

first try of patch applied.
in configure.in add "-fPIC" to MOD_LDFLAGS and MOD_CFLAGS and define SNPRINTF_BROKEN symbol for handhover to snprintf.c. There existing HAVE_*PRINTF settings will be undefined causing get supplied snprintf to be active over system defined versions. This should prevent many SEGV happens in the past
Makefile.in for idoutils has been changed to build idomod as .so file first, then rename it back to idomod.o
This needs to be checked in other environments

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-01-29 18:59:28 +00:00

since this patch includes the change of idomod.o to idomod.so this must remain seperated from upstream. you can't just change the extension.

you could however create a special configure flag like "--enable-solaris-build" which then takes care of setting all needed specialities via configure replacement in the makefiles. this needs to be tested on the various platforms then, not harming their funationality during build.

@icinga-migration
Copy link
Author

Updated by Tommi on 2012-01-29 19:14:01 +00:00

the filename to install remains as idomod.o. checkit out. idomod.so is only a buildtime temporary name. This because its safe also for other os. I succeded with RHEL.

idomod.o: idomod.c $(COMMON_INC) $(COMMON_OBJS)
    $(CC) $(MOD_CFLAGS) $(CFLAGS) -o idomod.so idomod.c $(COMMON_OBJS) $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) $(SOCKETLIBS) $(OTHERLIBS)
    mv idomod.so idomod.o

install:
    $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(BINDIR)
    $(INSTALL) -m 774 $(INSTALL_OPTS) ido2db $(DESTDIR)$(BINDIR)
    $(INSTALL) -m 774 $(INSTALL_OPTS) log2ido $(DESTDIR)$(BINDIR)
    $(INSTALL) -m 774 $(INSTALL_OPTS) idomod.o $(DESTDIR)$(BINDIR)

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-01-30 08:02:57 +00:00

mv just for solaris? i'd rather create a special configure flag for solaris builds, allowing different suffixes as well different configure flags (as you already did with os detection).

@icinga-migration
Copy link
Author

Updated by Tommi on 2012-01-30 11:28:07 +00:00

Is there a problem with the mv? I think the default well known extension for a shared object is .so, not .o, which is usually only used for compiled object files. The move is only there to keep the user configs untouched.
A special configure switch for solaris? never saw such thing before. I also think users are not expecting this. This should be part of the autoconf. I think there are already autoconf macros detecting the right shared lib extension, but i couldnt found one and my knowledge of autotools is too limited for writing such macros myself.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-04-20 12:55:15 +00:00

  • Status changed from Feedback to Resolved
  • Target Version set to 1.7

this will be resolved with the general .so change of idomod as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant