[omniORB] Patches to compile OO4 on AIX

Carl Thompson cet@carlthompson.net
Thu, 15 Nov 2001 09:49:46 -0800


This is a multi-part message in MIME format.
--------------080702070405070105020402
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I have attached a new version of the GCC makefile which adds a needed linker 
option when building C++ shared libraries.  Also, the changes to 
OPEN_SSL_LIB which crept into my patch for other platforms don't need to be 
done unless the default is supposed to use where OpenSSL is compiled rather 
than where OpenSSL is installed.

Carl

Carl Thompson wrote:

> Hello,
> 
>      I have attached patches to OO4 snapshot 2001-11-14 to allow it to 
> be compiled on AIX.  Also includes some minor fixes for Windows and 
> other platforms...
> 
>      IBM's VisualAge C++ compiler is severely broken.  It didn't take 
> long for me to give up trying to get it to work.  Consequently, this 
> patch just gets GCC 2.95 working on AIX.  I added the file
> 
>   mk/platforms/powerpc_aix_4.3_gcc.mk
> 
> which has the settings you need.
> 
> 
>      You _should_ be using a version of GCC compiled to use the GNU 
> assembler from the GNU binutils package because on at least one of the 
> big files (/src/lib/omniORB/dynamic/irstub.cc) the compiler generates 
> too much assembler code for the IBM assembler to handle.  If you don't 
> want to change your GCC you can just try skipping libomniDynamic if you 
> don't need it.
> 
>      Your GCC must use the IBM linker because linker options need to be 
> passed.  You don't have any choice anyway because the GNU linker 
> currently does not work on AIX.
> 
>      Note that I had to hack up src/tool/omniidl/cxx/idlpython.cc a bit 
> because the Python method that was used to find the libraries did not 
> seem to work in all cases.  I don't know Python so I fixed it using C++ 
> code.
> 
> Enjoy,
> Carl Thompson


--------------080702070405070105020402
Content-Type: text/plain;
 name="powerpc_aix_4.3_gcc.mk"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="powerpc_aix_4.3_gcc.mk"

#
# powerpc_aix_4.3_gcc.mk - make variables and rules specific to gcc 2.95
#                           on PowerPC AIX 4.3
#

AIX = 1
PowerPCProcessor = 1

ABSTOP = $(shell cd $(TOP); pwd)

AIX_MAJOR_VERS := $(shell uname -v)
AIX_MINOR_VERS := $(shell uname -r)

#
# Python set-up
#
# You must set a path to a Python 1.5.2 interpreter.

#PYTHON = /usr/local/bin/python
PYTHON = $(ABSTOP)/python/bin/python
PYTHONLIBDIR = $(ABSTOP)/python/lib/python1.5/config

#
# Include general unix things
#

include $(THIS_IMPORT_TREE)/mk/unix.mk

#
# C preprocessor macro definitions for this architecture
#

IMPORT_CPPFLAGS += -D__aix__ -D__powerpc__ -D__OSVERSION__=${AIX_MAJOR_VERS}

#
# Standard programs
#

AR			= ar r
RANLIB			= /bin/true
MKDIRHIER		= mkdir -p
INSTALL		= $(BASE_OMNI_TREE)/bin/scripts/install-sh -c

CMAKEDEPEND     += -D_AIX
CXXMAKEDEPEND   += -D__cplusplus -D_AIX

############################################################################
# Using gcc 2.95 (built with --enable-threads)                             #
#      Not well tested yet.                                                #
############################################################################
CXX             = gcc
CXXDEBUGFLAGS   = -O2
CXXOPTIONS      =
CXXLINK         = gcc
MTFLAGS         =
#
CC              = gcc
CLINK           = gcc
#############################################################################


# Name all static libraries with -ar.a suffix.
LibPattern = lib%-ar.a
LibDebugPattern = lib%-ar.a
LibNoDebugPattern = lib%-ar.a
LibSuffixPattern = %-ar.a
LibSearchPattern = -l%-ar

# Name all shared libraries with .a suffix
LibSharedPattern = lib%.a
LibSharedSuffixPattern = %.a
LibSharedSearchPattern = -l%

#
# OMNI thread stuff
#
ThreadSystem = Posix

OMNITHREAD_POSIX_CPPFLAGS = -DNoNanoSleep -DPthreadDraftVersion=10
OMNITHREAD_CPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
OMNITHREAD_LIB = -lomnithread$(OMNITHREAD_MAJOR_VERSION)$(OMNITHREAD_MINOR_VERSION) $(OMNITHREAD_PLATFORM_LIB)
OMNITHREAD_STATIC_LIB = -lomnithread-ar -lpthreads-ar
OMNITHREAD_PLATFORM_LIB = -lpthreads

#
# CORBA stuff
#

CorbaImplementation = OMNIORB

CXXLINKOPTIONS=-Wl,-bbigtoc
CLINKOPTIONS=-Wl,-bbigtoc

define CXXExecutable
(set -x; \
 $(RM) $@; \
 $(CXXLINK) -o $@ $(CXXLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \
    $(filter-out $(LibSharedSuffixPattern), $(filter-out $(LibSuffixPattern),$^)) $$libs; \
)
endef

define CExecutable
(set -x; \
 $(RM) $@; \
 $(CLINK) -o $@ $(CLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \
    $(filter-out $(LibSharedSuffixPattern), $(filter-out $(LibSuffixPattern),$^)) $$libs; \
)
endef

# Default location of the omniORB configuration file [falls back to this if
# the environment variable OMNIORB_CONFIG is not set] :

OMNIORB_CONFIG_DEFAULT_LOCATION = /etc/omniORB.cfg

# Default directory for the omniNames log files.
OMNINAMES_LOG_DEFAULT_LOCATION = /var/omninames

##########################################################################
#
# Shared library support stuff
#
# Default setup. Work for most platforms. For those exceptions, override
# the rules in their platform files.
#
SHAREDLIB_SUFFIX   = a

SharedLibraryFullNameTemplate = lib$$1$$2$$3$$4.$(SHAREDLIB_SUFFIX)
SharedLibrarySoNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX).$$3
SharedLibraryLibNameTemplate = lib$$1$$2$$3.$(SHAREDLIB_SUFFIX)


BuildSharedLibrary = 1       # Enable
SHAREDLIB_CPPFLAGS =

define MakeCXXSharedLibrary
 $(ParseNameSpec); \
 soname=$(SharedLibrarySoNameTemplate); \
 set -x; \
 $(RM) $@; \
 $(CXXLINK) -shared -Wl,-bbigtoc \
     -o $$soname $(IMPORT_LIBRARY_FLAGS) \
    $(filter-out $(LibSuffixPattern),$^) $$extralibs ; \
 ar cq $@ $$soname; \
 $(RM) $$soname;
endef


# ExportSharedLibrary- export sharedlibrary
#  Expect shell variable:
#  namespec = <library name> <major ver. no.> <minor ver. no.> <micro ver. no>
#  e.g. namespec = "COS 3 0 0" --> shared library libCOS300.a
#
define ExportSharedLibrary
$(ExportLibrary); \
$(ParseNameSpec); \
 libname=$(SharedLibraryLibNameTemplate); \
 set -x; \
 cd $(EXPORT_TREE)/$(LIBDIR); \
 $(RM) $$libname; \
 ln -s $(<F) $$libname;
endef

OPEN_SSL_ROOT = $(ABSTOP)/../../../openssl/work/src

OPEN_SSL_CPPFLAGS = -I$(OPEN_SSL_ROOT)/include
OPEN_SSL_LIB = -L$(OPEN_SSL_ROOT) -lssl -lcrypto
OMNIORB_SSL_LIB += $(OPEN_SSL_LIB)
OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS)

--------------080702070405070105020402--