[omniORB] Makefile for AIX
Gary D. Duzan
gdd0@gte.com
Tue, 12 Oct 1999 09:27:00 -0400
The fix listed below is correct. However, since g++ doesn't do
exceptions correctly with shared libraries and threads, the point is
somewhat moot.
While I'm thinking of it, there is a possible optimization for
sharedlibs on AIX. Since building object files for a shared library is
the same as for a static library on AIX, it would be much faster to
simply copy or link to the object files created in the parent directory
and use them instead of doing the exact same compile twice. I actually
added rules to do this to an earlier (2.5.0?) version, and it seemed to
work fine.
Gary Duzan
GTE Laboratories
p.s. It might also be worth it to grab "libtool" and use it for
building libraries in general. That way the libtool maintainers get to
worry about all the platform issues involved and the OmniORB folks can
stick to writing top-notch ORB code.
In Message <38032006.7B184A2B@psenterprise.com> ,
Peter Ledbrook <p.ledbrook@psenterprise.com> wrote:
=>Hi,
=>
=>There's a slight problem in the omniDynamic/sharedlib/dir.mk, although
=>the same problem might exist elsewhere. Here is the code section:
=>
=>ifeq ($(notdir $(CXX)),xlC_r)
=>
=>$(dynlib): $(DYN2_OBJS)
=> (set -x; \
=> $(RM) $@; \
=> $(MAKECPPSHAREDLIB) \
=> -o $(dynsoname) $(IMPORT_LIBRARY_FLAGS) \
=> $(filter-out $(LibSuffixPattern),$^) $(OMNITHREAD_LIB) \
=> -L../../orbcore/sharedlib -l$(libcorename) -p 40; \
=> ar cq $(dynlib) $(dynsoname); \
=> $(RM) $(dynsoname); \
=> )
=>
=>endif
=>
=>ifeq ($(notdir $(CXX)),g++)
=>
=>$(dynlib): $(DYN2_OBJS)
=> (set -x; \
=> $(RM) $@; \
=> $(CXXLINK) -shared -mthreads \
=> -o $(dynsoname) $(IMPORT_LIBRARY_FLAGS) \
=> $(filter-out $(LibSuffixPattern),$^) $(OMNITHREAD_LIB) \
=> ../../orbcore/sharedlib/$(lib);
=>\ << Here's the
=>problem
=> ar cq $(dynlib) $(dynsoname); \
=> $(RM) $(dynsoname); \
=> )
=>
=>endif
=>
=>g++ still uses the underlying system linker, ld, which means the above
=>bit of code generates a 'hard' link (what the linker calls an ipath) to
=>libomniORB27.so.a. The solution was provided for xlC_r but it is also
=>required for gcc. So,
=>
=> ../../orbcore/sharedlib/$(lib); \
=>
=>should be replaced by
=>
=> -L../../orbcore/sharedlib -l$(libcorename); \
=>
=>Hope this all makes sense! I'm not in my most coherent of states.
=>Anyway, to get round these problems, it might be worth specifying a
=>platform linker flag:
=>
=> -bnoipath // For xlC_r
=>
=>or
=>
=> -Xlinker -noipath // For g++
=>
=>that is used for ALL linking.
=>
=>Any queries about this, don't hesitate to ask.
=>
=>Cheers,
=>
=>Peter
=>
=>