GNU g++ with omniORB2 under Solaris 2.5

Sai-Lai Lo S.Lo@orl.co.uk
Mon, 16 Jun 1997 19:04:08 +0100


>>>>> Thomas Wenger writes:

> So I have to build the omniORB binaries with gnu g++. But there is a 
> problem when linking posix.o.

CC was used to link posix.o into a shared library. It doesn't work because
the object file was compiled by g++.

> Does anybody know how to use omniORB with g++ under Solaris?

I don't know about g++ under Solaris but with g++ 2.7.2 under x86 Linux,
C++ shared libraries that have exceptions enabled *do not work*. Your
option at the moment is to use static libraries only. 


To compile omniORB using gcc 2.7.2
----------------------------------

- Edit the make configuration file  mk/sun4_sosV_5.5.mk

  Change the following make variables:

  CXX             = g++
  CXXDEBUGFLAGS   = 
  CXXOPTIONS      = -fhandle-exceptions -Wall -Wno-unused
  CXXLINK         = g++

  #OMNITHREAD_STATIC_LIB = -Wl,-Bstatic -lomnithread -Wl,-Bdynamic -lthread -lposix4
  OMNITHREAD_STATIC_LIB = -Wl,-Bstatic -lomnithread -Wl,-Bdynamic -lpthread -lposix4
  OMNIORB_STATIC_LIB = -Wl,-Bstatic -lomniORB2 -Wl,-Bdynamic $(OMNITHREAD_STATIC_LIB) \
                       -lsocket -lnsl

- Do not build the shared libraries. 
  This is achieved by replacing the entire content of
      ./src/lib/omnithread/sharedlib/sun4_sosV_5.5.mk
  and ./src/lib/omniORB2/sharedlib/sun4_sosV_5.5.mk
  with these two lines:

.DEFAULT:
	@echo done


- Change the lines in file src/appl/omniNames/log.cc to the
  following:

  // a bug in the Solaris runtime means that the fd doesn't get closed.
  #if defined(__sunos__) && defined(__SUNPRO_CC)
        if (close(fd) < 0)
          throw IOError();
  #endif

  Thanks to Stefan Ubben for pointing this out.


Regards,

Sai-Lai Lo

-- 
E-mail:         S.Lo@orl.co.uk          |       Olivetti & Oracle Research Lab
                                        |       24a Trumpington Street
Tel:            +44 223 343000          |       Cambridge CB2 1QA
Fax:            +44 223 313542          |       ENGLAND